00001 package cedar.jetweb.job; 00002 00003 import java.util.Vector; 00004 import java.util.Enumeration; 00005 00006 import java.io.PrintWriter; 00007 import java.io.PrintStream; 00008 00009 import cedar.jetweb.JetWebException; 00018 public class JobRequestException extends JetWebException { 00019 00020 private Vector missingParameters = new Vector(); 00021 00022 00028 JobRequestException(String msg){ 00029 super(msg,""); 00030 } 00031 00037 JobRequestException(Vector missing){ 00038 super("Job Request has missing parameters",""); 00039 missingParameters = missing; 00040 } 00041 00047 JobRequestException(Exception e){ 00048 super(e); 00049 } 00055 public String getMessage(){ 00056 StringBuffer b = new StringBuffer(); 00057 00058 if (getOriginalException()!=null) { 00059 b.append(getOriginalException().getMessage()); 00060 } else { 00061 b.append(super.getMessage()); 00062 } 00063 00064 int noMissing = missingParameters.size(); 00065 if (noMissing >0){ 00066 b.append("\n"); 00067 b.append(noMissing); 00068 b.append(" PARAMETERS MISSING:"); 00069 Enumeration miss = missingParameters.elements(); 00070 int count = 0; 00071 while (miss.hasMoreElements()){ 00072 if (count>0) b.append(","); 00073 b.append((String)miss.nextElement()); 00074 count++; 00075 } 00076 } 00077 return b.toString(); 00078 } 00079 00080 } 00081 00082 00083 00084 00085 00086 00087 00088 00089
Generated Wed Jan 17 09:14:27 GMT 2007