[Batchserver-cvs] batchserver/src/org/jmonks/batchserver/framework/common ErrorCode.java,1.12,1.13 E
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-03-28 04:53:28
|
Update of /cvsroot/batchserver/batchserver/src/org/jmonks/batchserver/framework/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv927 Added Files: ErrorCode.java Removed Files: ExitCode.java Log Message: no message --- NEW FILE: ErrorCode.java --- package org.jmonks.batchserver.framework.common; /** * <p> * The ErrorCode represents the error condition can generate in the system * and holds error code and message. This is like a enum class to make sure * the exit codes being passed around the application are valid (defined). * No instances of this class can be created from outside and cannot be instantiated. * </p> * * @author Suresh Pragada * @version 1.0 * @since 1.0 */ public final class ErrorCode { /** * Code represents the error. */ private int code; /** * Message illustrates the code. */ private String message=null; /** * <p> * Private constructor make sure no instances will be created of this class * from outside of this class. * </p> * * @param code Code represents the error. * @param errorMsg Message illustrates the exit code. */ private ErrorCode(int code, String errorMsg) { this.code=code; this.message=errorMsg; } /** * Returns the error code represents the error. * * @return Returns the error code represents the error. */ public int getCode() { return this.code; } /** * Returns the error message illustrates the exit code. * * @return Returns the error message. */ public String getMessage() { return this.message; } /** * <p> * Returns the string representation of ErrorCode class in the format * <br> {ErrorCode [code = value] [message = value]} * </p> * * @return Returns the string representation of ErrorCode. */ public String toString() { StringBuffer stringValue=new StringBuffer("{ErrorCode "); stringValue.append("[code = " + this.code + "]"); stringValue.append("[message = " + this.message + "]"); stringValue.append("}"); return stringValue.toString(); } /** * Configuration Error Codes. */ public static final ErrorCode JOB_COMPLETED_SUCCESSFULLY = new ErrorCode(0,"Job successfully completed."); public static final ErrorCode FRAMEWORK_CONFIGURATION_ERROR = new ErrorCode(1001,"Error while accessing or parsing the framework configuration file."); public static final ErrorCode JOB_CONFIG_FACTORY_CONFIGURATION_ERROR = new ErrorCode(1002,"Job configuration factory cannot be created by the given factory configuration."); public static final ErrorCode JOB_CONFIGURATION_ERROR = new ErrorCode(1003,"Error while loading the job configuration from the defined factory."); public static final ErrorCode JOB_IS_NOT_CONFIGURED = new ErrorCode(1004,"Job is not configured"); public static final ErrorCode JOB_CONTROLLER_CONFIGURATION_ERROR = new ErrorCode(1005,"Job controller configuration is not defined properly."); } --- ExitCode.java DELETED --- |