Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22496/org/jmonks/batchserver/framework/config
Modified Files:
ConfigurationException.java
Log Message:
no message
Index: ConfigurationException.java
===================================================================
RCS file: /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/config/ConfigurationException.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ConfigurationException.java 28 Mar 2006 04:53:45 -0000 1.9
--- ConfigurationException.java 24 May 2006 03:17:40 -0000 1.10
***************
*** 57,65 ****
* @param exceptionComponent Specifies the source component of this exception.
* @param message Messages states the problem.
*/
public ConfigurationException(String exceptionComponent,String message)
{
super(message);
! this.exceptionComponent=exceptionComponent;
}
--- 57,70 ----
* @param exceptionComponent Specifies the source component of this exception.
* @param message Messages states the problem.
+ *
+ * @throws IllegalArgumentException If exceptionComponent argument is null.
*/
public ConfigurationException(String exceptionComponent,String message)
{
super(message);
! if(exceptionComponent!=null)
! this.exceptionComponent=exceptionComponent;
! else
! throw new IllegalArgumentException("exception component cannot be null to construct configuration exception.");
}
***************
*** 75,78 ****
--- 80,130 ----
/**
+ * Traslates the configuration exception into error code to be retruned
+ * to the clients.
+ *
+ * @return Retruns the error code.
+ */
+ public ErrorCode getErrorCode()
+ {
+ ErrorCode errorCode=null;
+
+ if(FRAMEWORK_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.FRAMEWORK_CONFIGURATION_ERROR;
+ }
+ else if(JOB_CONFIG_FACTORY_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_CONFIG_FACTORY_CONFIGURATION_ERROR;
+ }
+ else if(JOB_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_CONFIGURATION_ERROR;
+ }
+ else if(JOB_CONTROLLER_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_CONTROLLER_CONFIGURATION_ERROR;
+ }
+ else if(LOGGING_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_LOGGING_CONFIGURATION_ERROR;
+ }
+ else if(REPOSITORY_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_REPOSITORY_CONFIGURATION_ERROR;
+ }
+ else if(JOB_CONNECTOR_CONFIG.equalsIgnoreCase(this.exceptionComponent))
+ {
+ errorCode=ErrorCode.JOB_CONNECTOR_CONFIGURATION_ERROR;
+ }
+ else
+ {
+ errorCode=ErrorCode.CUSTOM_ERROR_CODE.appendMessage("Component = " +
+ this.exceptionComponent + " Message = " );
+ }
+
+ return errorCode.appendMessage(super.getMessage());
+ }
+
+ /**
* <p>
* Returns the string representation of ConfigurationException class in the format
|