[Ejtools-cvs] CVS: thirdparty/sun/jsr88/src/main/javax/enterprise/deploy/shared ActionType.java,NONE
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-18 20:45:57
|
Update of /cvsroot/ejtools/thirdparty/sun/jsr88/src/main/javax/enterprise/deploy/shared In directory usw-pr-cvs1:/tmp/cvs-serv31212/sun/jsr88/src/main/javax/enterprise/deploy/shared Added Files: ActionType.java CommandType.java DConfigBeanVersionType.java ModuleType.java StateType.java Log Message: Initial Import --- NEW FILE: ActionType.java --- package javax.enterprise.deploy.shared; /** * Class ActionTypes defines enumeration values for the J2EE * DeploymentStatus actions. * * @author rsearls * @version */ public class ActionType { private int value; // This enumeration value's int value /** * The DeploymentManager action command is executing. */ public static final ActionType EXECUTE = new ActionType(0); /** * A cancel operation is being preformed on the DeploymentManager * action command. */ public static final ActionType CANCEL = new ActionType(1); /** * A stop operation is being preformed on the DeploymentManager * action command. */ public static final ActionType STOP = new ActionType(2); private static final String[] stringTable = { "execute", "cancel", "stop", }; private static final ActionType[] enumValueTable = { EXECUTE, CANCEL, STOP, }; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected ActionType(int value) { this.value = value; } /** * Returns this enumeration value's integer value. * @return the value */ public int getValue() { return value; } /** * Returns the string table for class ActionType */ protected String[] getStringTable() { return stringTable; } /** * Returns the enumeration value table for class ActionType */ protected ActionType[] getEnumValueTable() { return enumValueTable; } /** * Return an object of the specified value. * @param value a designator for the object. */ public static ActionType getActionType(int value) { return enumValueTable[value]; } /** * Return the string name of this ActionType or the * integer value if outside the bounds of the table */ public String toString() { String[] strTable = getStringTable(); int index = value - getOffset(); if (strTable != null && index >= 0 && index < strTable.length) return strTable[index]; else return Integer.toString (value); } /** * Returns the lowest integer value used by this enumeration value's * enumeration class. * <P> * The default implementation returns 0. * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } } --- NEW FILE: CommandType.java --- package javax.enterprise.deploy.shared; /** * Class CommandTypes defines enumeration values for the * DeploymentStatus object. * * @author rsearls * @version */ public class CommandType { private int value; // This enumeration value's int value /** * The DeploymentManger action operation being processed * is distribute. */ public static final CommandType DISTRIBUTE = new CommandType(0); /** * The DeploymentManger action operation being processed is start. */ public static final CommandType START = new CommandType(1); /** * The DeploymentManger action operation being processed is stop. */ public static final CommandType STOP = new CommandType(2); /** * The DeploymentManger action operation being processed is undeploy. */ public static final CommandType UNDEPLOY = new CommandType(3); /** * The DeploymentManger action operation being processed is redeploy. */ public static final CommandType REDEPLOY = new CommandType(4); private static final String[] stringTable = { "distribute", "start", "stop", "undeploy", "redeploy", }; private static final CommandType[] enumValueTable = { DISTRIBUTE, START, STOP, UNDEPLOY, REDEPLOY, }; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected CommandType(int value) { this.value = value; } /** * Returns this enumeration value's integer value. * @return the value */ public int getValue() { return value; } /** * Returns the string table for class CommandType */ protected String[] getStringTable() { return stringTable; } /** * Returns the enumeration value table for class CommandType */ protected CommandType[] getEnumValueTable() { return enumValueTable; } /** * Return an object of the specified value. * @param value a designator for the object. */ public static CommandType getCommandType(int value) { return enumValueTable[value]; } /** * Return the string name of this CommandType or the * integer value if outside the bounds of the table */ public String toString() { String[] strTable = getStringTable(); int index = value - getOffset(); if (strTable != null && index >= 0 && index < strTable.length) return strTable[index]; else return Integer.toString (value); } /** * Returns the lowest integer value used by this enumeration value's * enumeration class. * <P> * The default implementation returns 0. * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } } --- NEW FILE: DConfigBeanVersionType.java --- package javax.enterprise.deploy.shared; /** * Class DConfigBeanVersionTypes defines enumeration values for the J2EE * Platform verion number. * * @author rsearls * @version */ public class DConfigBeanVersionType { private int value; // This enumeration value's int value /** * J2EE Platform version 1.3 */ public static final DConfigBeanVersionType V1_3 = new DConfigBeanVersionType(0); /** * J2EE Platform version 1.3.1 */ public static final DConfigBeanVersionType V1_3_1 = new DConfigBeanVersionType(1); private static final String[] stringTable = { "V1_3", "V1_3_1", }; private static final DConfigBeanVersionType[] enumValueTable = { V1_3, V1_3_1, }; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected DConfigBeanVersionType(int value) { this.value = value; } /** * Returns this enumeration value's integer value. * @return the value */ public int getValue() { return value; } /** * Returns the string table for class DConfigBeanVersionType */ protected String[] getStringTable() { return stringTable; } /** * Returns the enumeration value table for class DConfigBeanVersionType */ protected DConfigBeanVersionType[] getEnumValueTable() { return enumValueTable; } /** * Return an object of the specified value. * @param value a designator for the object. */ public static DConfigBeanVersionType getDConfigBeanVersionType(int value) { return enumValueTable[value]; } /** * Return the string name of this DConfigBeanVersionType or the * integer value if outside the bounds of the table */ public String toString() { String[] strTable = getStringTable(); int index = value - getOffset(); if (strTable != null && index >= 0 && index < strTable.length) return strTable[index]; else return Integer.toString (value); } /** * Returns the lowest integer value used by this enumeration value's * enumeration class. * <P> * The default implementation returns 0. * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } } --- NEW FILE: ModuleType.java --- package javax.enterprise.deploy.shared; /** * Class ModuleTypes defines enumeration values for the J2EE * module types. * * @author Rebecca Searls */ public class ModuleType { private int value; // This enumeration value's int value /** * The module is an EAR archive. */ public static final ModuleType EAR = new ModuleType(0); /** * The module is an Enterprise Java Bean archive. */ public static final ModuleType EJB = new ModuleType(1); /** * The module is an Client Application archive. */ public static final ModuleType CAR = new ModuleType(2); /** * The module is an Connector archive. */ public static final ModuleType RAR = new ModuleType(3); /** * The module is an Web Application archive. */ public static final ModuleType WAR = new ModuleType(4); private static final String[] stringTable = { "ear", "ejb", "car", "rar", "war", }; private static final ModuleType[] enumValueTable = { EAR, EJB, CAR, RAR, WAR, }; /* * Module extensions. */ private static final String[] moduleExtension = { ".ear", ".jar", ".jar", ".rar", ".war", }; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected ModuleType(int value) { this.value = value; } /** * Returns this enumeration value's integer value. * @return the value */ public int getValue() { return value; } /** * Returns the string table for class ModuleType */ protected String[] getStringTable() { return stringTable; } /** * Returns the enumeration value table for class ModuleType */ protected ModuleType[] getEnumValueTable() { return enumValueTable; } /** * Return the file extension string for this enumeration. */ public String getModuleExtension() { return (moduleExtension[getValue()]); } /** * Return an object of the specified value. * @param value a designator for the object. */ public static ModuleType getModuleType(int value) { return enumValueTable[value]; } /** * Return the string name of this ModuleType or the * integer value if outside the bounds of the table */ public String toString() { String[] strTable = getStringTable(); int index = value - getOffset(); if (strTable != null && index >= 0 && index < strTable.length) return strTable[index]; else return Integer.toString (value); } /** * Returns the lowest integer value used by this enumeration value's * enumeration class. * <P> * The default implementation returns 0. If the enumeration class (a * subclass of class EnumSyntax) uses integer values starting at other than * 0, override this method in the subclass. * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } } --- NEW FILE: StateType.java --- package javax.enterprise.deploy.shared; /** * Class StateTypes defines enumeration values for the * DeploymentStatus object. * * @author rsearls * @version */ public class StateType { private int value; // This enumeration value's int value /** * The action operation is running normally. */ public static final StateType RUNNING = new StateType(0); /** * The action operation has completed normally. */ public static final StateType COMPLETED = new StateType(1); /** * The action operation has failed. */ public static final StateType FAILED = new StateType(2); /** * The DeploymentManager is running in discommected mode. */ public static final StateType RELEASED = new StateType(3); private static final String[] stringTable = { "running", "completed", "failed", "released", }; private static final StateType[] enumValueTable = { RUNNING, COMPLETED, FAILED, RELEASED, }; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected StateType(int value) { this.value = value; } /** * Returns this enumeration value's integer value. * @return the value */ public int getValue() { return value; } /** * Returns the string table for class StateType */ protected String[] getStringTable() { return stringTable; } /** * Returns the enumeration value table for class StateType */ protected StateType[] getEnumValueTable() { return enumValueTable; } /** * Return an object of the specified value. * @param value a designator for the object. */ public static StateType getStateType(int value) { return enumValueTable[value]; } /** * Return the string name of this StateType or the * integer value if outside the bounds of the table */ public String toString() { String[] strTable = getStringTable(); int index = value - getOffset(); if (strTable != null && index >= 0 && index < strTable.length) return strTable[index]; else return Integer.toString (value); } /** * Returns the lowest integer value used by this enumeration value's * enumeration class. * <P> * The default implementation returns 0. * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } } |