Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14059
Modified Files:
ErrorCode.java
Log Message:
no message
Index: ErrorCode.java
===================================================================
RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common/ErrorCode.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ErrorCode.java 24 May 2006 14:33:59 -0000 1.18
--- ErrorCode.java 23 Aug 2006 14:54:12 -0000 1.19
***************
*** 16,19 ****
--- 16,20 ----
public final class ErrorCode
{
+ public static final int FRAMEWORK_MAX_ERROR_CODE = 9999;
/**
* Code represents the error.
***************
*** 73,76 ****
--- 74,95 ----
return new ErrorCode(this.code, this.message+" " + messageToBeAppended);
}
+
+ /**
+ * Creates a new error code by accepting the code and message. The code
+ * should be greater than the value "9999", maximum range being used by the framework.
+ *
+ * @param newCode Code to be used to construct the ErrorCode.
+ * @param newMessage Mesage to be used to construct the ErrorCode.
+ *
+ * @throws java.lang.IllegalArgumentException If given code is not greater than 9999.
+ */
+ public static ErrorCode createErrorCode(int newCode, String newMessage)
+ {
+ if(newCode>ErrorCode.FRAMEWORK_MAX_ERROR_CODE)
+ return new ErrorCode(newCode,newMessage);
+ else
+ throw new IllegalArgumentException("Code to create new ErrorCode should be greater than " +
+ ErrorCode.FRAMEWORK_MAX_ERROR_CODE);
+ }
/**
***************
*** 172,179 ****
*/
public static final ErrorCode POOL_JOB_PROCESSOR_EXCEPTION = new ErrorCode(1202,"Exception while executing the processor to process the pool.");
- /**
- * Rpresents miscellaneous Error codes.
- */
- public static final ErrorCode CUSTOM_ERROR_CODE = new ErrorCode(1301, "Custom Error Message = ");
}
--- 191,194 ----
|