Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9584
Modified Files:
ErrorCode.java JobStatistics.java
Log Message:
no message
Index: ErrorCode.java
===================================================================
RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/ErrorCode.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ErrorCode.java 6 Sep 2006 22:07:22 -0000 1.2
--- ErrorCode.java 10 Sep 2006 17:56:13 -0000 1.3
***************
*** 82,89 ****
* @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);
--- 82,92 ----
* @param newMessage Mesage to be used to construct the ErrorCode.
*
! * @throws java.lang.IllegalArgumentException If given code is not greater than 9999 or newMessage is null.
*/
public static ErrorCode createErrorCode(int newCode, String newMessage)
{
+ if(newMessage==null)
+ throw new IllegalArgumentException("Message to create new ErrorCode should not be null.");
+
if(newCode>ErrorCode.FRAMEWORK_MAX_ERROR_CODE)
return new ErrorCode(newCode,newMessage);
Index: JobStatistics.java
===================================================================
RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/JobStatistics.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** JobStatistics.java 16 Mar 2006 05:56:31 -0000 1.4
--- JobStatistics.java 10 Sep 2006 17:56:13 -0000 1.5
***************
*** 32,35 ****
--- 32,39 ----
*/
private String jobName;
+ /**
+ * Exit code of the job.
+ */
+ private ErrorCode exitCode=null;
/**
***************
*** 43,46 ****
--- 47,51 ----
this.maxMemoryUsage=0;
this.recordsProcessed=0;
+ this.exitCode=ErrorCode.JOB_COMPLETED_SUCCESSFULLY;
}
***************
*** 134,137 ****
--- 139,160 ----
return this.jobName;
}
+
+ /**
+ * Sets the given error code as exit code.
+ *
+ * @param exitCode Error code controller is going to return to the framework.
+ */
+ public void setExitCode(ErrorCode exitCode)
+ {
+ this.exitCode=exitCode;
+ }
+
+ /**
+ * Gets the exit code.
+ */
+ public ErrorCode getExitCode()
+ {
+ return this.exitCode;
+ }
/**
***************
*** 151,154 ****
--- 174,178 ----
stringValue.append("[maxMemoryUsage = " + this.maxMemoryUsage + "]");
stringValue.append("[recordsProcessed = " + this.recordsProcessed + "]");
+ stringValue.append("[exitCode = " + this.exitCode.toString() + "]");
stringValue.append("}");
return stringValue.toString();
|