[Ejtools-cvs] libraries/j2ee.deployment/src/main/javax/enterprise/deploy/shared ActionType.java,NONE
Brought to you by:
letiemble
Update of /cvsroot/ejtools/libraries/j2ee.deployment/src/main/javax/enterprise/deploy/shared In directory sc8-pr-cvs1:/tmp/cvs-serv4692/src/main/javax/enterprise/deploy/shared Added Files: ActionType.java CommandType.java DConfigBeanVersionType.java ModuleType.java StateType.java package.html Log Message: Add up-to-date implementation for the JSR 88. No need for the Sun one. --- NEW FILE: ActionType.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.shared; import java.util.HashMap; import java.util.Map; /** * Class ActionTypes defines enumeration values for the J2EE DeploymentStatus actions. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class ActionType { /** Index value */ private Integer value; /** * A cancel operation is being preformed on the DeploymentManager action command. */ public final static ActionType CANCEL; /** The DeploymentManager action command is executing. */ public final static ActionType EXECUTE; /** A stop operation is being preformed on the DeploymentManager action command. */ public final static ActionType STOP; /** Internal table for string values */ private final static Map strings = new HashMap(); /** Internal table for values */ private final static Map values = new HashMap(); /** * Construct a new enumeration value with the given integer value. * * @param value Integer value */ protected ActionType(int value) { this.value = new Integer(value); values.put(this.value, this); } /** * Returns this enumeration value's integer value. * * @return the value */ public int getValue() { return this.value.intValue(); } /** * Return the string name of this ActionType or the integer value if outside the * bounds of the table. * * @return The String representation */ public String toString() { return (String) strings.get(this.value); } /** * Returns the enumeration value table for class ActionType * * @return Enumeration table of the values */ protected ActionType[] getEnumValueTable() { return (ActionType[]) values.values().toArray(new ActionType[0]); } /** * Returns the lowest integer value used by this enumeration value's enumeration * class. <p> * * The default implementation returns 0.</p> * * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } /** * Returns the string table for class ActionType * * @return The String representation table values */ protected String[] getStringTable() { return (String[]) strings.values().toArray(new String[0]); } /** * Return an object of the specified value. * * @param value a designator for the object. * @return The corresponding ActionType */ public static ActionType getActionType(int value) { return (ActionType) values.get(new Integer(value)); } /** Static block to initialize constants and to fill arrays. */ static { EXECUTE = new ActionType(0); strings.put(new Integer(0), "execute"); CANCEL = new ActionType(1); strings.put(new Integer(1), "cancel"); STOP = new ActionType(2); strings.put(new Integer(2), "stop"); } } --- NEW FILE: CommandType.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.shared; /** * Class CommandTypes defines enumeration values for the DeploymentStatus object. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class CommandType { /** Index value */ private int value; /** The DeploymentManger action operation being processed is distribute. */ public final static CommandType DISTRIBUTE; /** The DeploymentManger action operation being processed is redeploy. */ public final static CommandType REDEPLOY; /** The DeploymentManger action operation being processed is start. */ public final static CommandType START; /** The DeploymentManger action operation being processed is stop. */ public final static CommandType STOP; /** The DeploymentManger action operation being processed is undeploy. */ public final static CommandType UNDEPLOY; /** Internal table for string values */ private final static String[] stringTable; /** Internal table for values */ private final static CommandType[] valueTable; /** * 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 this.value; } /** * Return the string name of this CommandType or the integer value if outside * the bounds of the table. * * @return The String representation */ public String toString() { return stringTable[value]; } /** * Returns the enumeration value table for class CommandType * * @return Enumeration table of the values */ protected CommandType[] getEnumValueTable() { return valueTable; } /** * Returns the lowest integer value used by this enumeration value's enumeration * class. <p> * * The default implementation returns 0.</p> * * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } /** * Returns the string table for class CommandType * * @return The String representation table values */ protected String[] getStringTable() { return stringTable; } /** * Return an object of the specified value. * * @param value a designator for the object. * @return The corresponding CommandType */ public static CommandType getCommandType(int value) { return valueTable[value]; } /** Static block to initialize constants and to fill arrays. */ static { DISTRIBUTE = new CommandType(0); START = new CommandType(1); STOP = new CommandType(2); UNDEPLOY = new CommandType(3); REDEPLOY = new CommandType(4); valueTable = (new CommandType[]{DISTRIBUTE, START, STOP, UNDEPLOY, REDEPLOY}); stringTable = new String[]{"distribute", "start", "stop", "undeploy", "redeploy"}; } } --- NEW FILE: DConfigBeanVersionType.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.shared; /** * Class DConfigBeanVersionTypes defines enumeration values for the J2EE Platform * verion number. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class DConfigBeanVersionType { /** Index value */ private int value; /** J2EE Platform version 1.3 */ public final static DConfigBeanVersionType V1_3; /** J2EE Platform version 1.3.1 THIS CONSTANT SHOULD NEVER BE USED. */ public final static DConfigBeanVersionType V1_3_1; /** J2EE Platform version 1.4 */ public final static DConfigBeanVersionType V1_4; /** Internal table for string values */ private final static String[] stringTable; /** Internal table for values */ private final static DConfigBeanVersionType[] valueTable; /** * 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 this.value; } /** * Return the string name of this DConfigBeanVersionType or the integer value * if outside the bounds of the table. * * @return The String representation */ public String toString() { return stringTable[value]; } /** * Returns the enumeration value table for class DConfigBeanVersionType * * @return Enumeration table of the values */ protected DConfigBeanVersionType[] getEnumValueTable() { return valueTable; } /** * Returns the lowest integer value used by this enumeration value's enumeration * class. <p> * * The default implementation returns 0.</p> * * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } /** * Returns the string table for class DConfigBeanVersionType * * @return The String representation table values */ protected String[] getStringTable() { return stringTable; } /** * Return an object of the specified value. * * @param value a designator for the object. * @return The corresponding DConfigBeanVersionType */ public static DConfigBeanVersionType getDConfigBeanVersionType(int value) { return valueTable[value]; } /** Static block to initialize constants and to fill arrays. */ static { V1_3 = new DConfigBeanVersionType(0); V1_3_1 = new DConfigBeanVersionType(1); V1_4 = new DConfigBeanVersionType(2); valueTable = (new DConfigBeanVersionType[]{V1_3, V1_3_1, V1_4}); stringTable = new String[]{"V1_3", "V1_3_1", "V1_4"}; } } --- NEW FILE: ModuleType.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.shared; /** * Class ModuleTypes defines enumeration values for the J2EE module types. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class ModuleType { /** Index value */ private int value; /** The module is an Client Application archive. */ public final static ModuleType CAR; /** The module is an EAR archive. */ public final static ModuleType EAR; /** The module is an Enterprise Java Bean archive. */ public final static ModuleType EJB; /** The module is an Connector archive. */ public final static ModuleType RAR; /** The module is an Web Application archive. */ public final static ModuleType WAR; /** Internal table for extensions values */ private final static String[] extensionTable; /** Internal table for string values */ private final static String[] stringTable; /** Internal table for values */ private final static ModuleType[] valueTable; /** * Construct a new enumeration value with the given integer value. * * @param value Integer value. */ protected ModuleType(int value) { this.value = value; } /** * Returns this enumeration extension value's string value. * * @return The extension value */ public String getModuleExtension() { return extensionTable[value]; } /** * Returns this enumeration value's integer value. * * @return the value */ public int getValue() { return this.value; } /** * Return the string name of this ModuleType or the integer value if outside the * bounds of the table. * * @return The String representation */ public String toString() { return stringTable[value]; } /** * Returns the enumeration value table for class ModuleType * * @return Enumeration table of the values */ protected ModuleType[] getEnumValueTable() { return valueTable; } /** * Returns the lowest integer value used by this enumeration value's enumeration * class. <p> * * The default implementation returns 0.</p> * * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } /** * Returns the string table for class ModuleType * * @return The String representation table values */ protected String[] getStringTable() { return stringTable; } /** * Return an object of the specified value. * * @param value a designator for the object. * @return The corresponding ModuleType */ public static ModuleType getModuleType(int value) { return valueTable[value]; } /** Static block to initialize constants and to fill arrays. */ static { EAR = new ModuleType(0); EJB = new ModuleType(1); CAR = new ModuleType(2); RAR = new ModuleType(3); WAR = new ModuleType(4); valueTable = (new ModuleType[]{EAR, EJB, CAR, RAR, WAR}); stringTable = new String[]{"EAR", "EJB", "CAR", "RAR", "WAR"}; extensionTable = new String[]{"ear", "jar", "car", "rar", "war"}; } } --- NEW FILE: StateType.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package javax.enterprise.deploy.shared; /** * Class StateTypes defines enumeration values for the DeploymentStatus object. * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @since 1.0 */ public class StateType { /** Index value */ private int value; /** The action operation has completed normally. */ public final static StateType COMPLETED; /** The action operation has failed. */ public final static StateType FAILED; /** The DeploymentManager is running in disconnected mode. */ public final static StateType RELEASED; /** The action operation is running normally. */ public final static StateType RUNNING; /** Internal table for string values */ private final static String[] stringTable; /** Internal table for values */ private final static StateType[] valueTable; /** * 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 this.value; } /** * Return the string name of this StateType or the integer value if outside the * bounds of the table. * * @return The String representation */ public String toString() { return stringTable[value]; } /** * Returns the enumeration value table for class StateType * * @return Enumeration table of the values */ protected StateType[] getEnumValueTable() { return valueTable; } /** * Returns the lowest integer value used by this enumeration value's enumeration * class. <p> * * The default implementation returns 0.</p> * * @return the offset of the lowest enumeration value. */ protected int getOffset() { return 0; } /** * Returns the string table for class StateType * * @return The String representation table values */ protected String[] getStringTable() { return stringTable; } /** * Return an object of the specified value. * * @param value a designator for the object. * @return The corresponding StateType */ public static StateType getModuleType(int value) { return valueTable[value]; } /** Static block to initialize constants and to fill arrays. */ static { RUNNING = new StateType(0); COMPLETED = new StateType(1); FAILED = new StateType(2); RELEASED = new StateType(3); valueTable = (new StateType[]{RUNNING, COMPLETED, FAILED, RELEASED}); stringTable = new String[]{"running", "completed", "failed", "released"}; } } --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides shared objects for Tool Vendor and Product Vendor implementation classes. <h2>Package Specification</h2> <ul> <li><a href="http://jcp.org/jsr/detail/88.jsp">JSR 88, J2EE Application Deployment</a></li> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="http://java.sun.com/j2ee/tools">J2EE Tools</a></li> </ul> </body> </html> |