001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019 020 // 021 // This source code implements specifications defined by the Java 022 // Community Process. In order to remain compliant with the specification 023 // DO NOT add / change / or delete method signatures! 024 // 025 026 package javax.enterprise.deploy.shared; 027 028 /** 029 * Class ActionTypes defines enumeration values for the J2EE DeploymentStatus 030 * actions. 031 * 032 * @version $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Mi, 25. Okt 2006) $ 033 */ 034 public class ActionType { 035 /** 036 * The action is currently executing. 037 */ 038 public static final ActionType EXECUTE = new ActionType(0); 039 /** 040 * The action has been canceled. 041 */ 042 public static final ActionType CANCEL = new ActionType(1); 043 /** 044 * A stop operation is being performed on the DeploymentManager action command. 045 */ 046 public static final ActionType STOP = new ActionType(2); 047 048 private static final ActionType[] enumValueTable = new ActionType[]{ 049 EXECUTE, 050 CANCEL, 051 STOP, 052 }; 053 054 private static final String[] stringTable = new String[]{ 055 "execute", 056 "cancel", 057 "stop", 058 }; 059 060 private int value; 061 062 /** 063 * Construct a new enumeration value with the given integer value. 064 */ 065 protected ActionType(int value) { 066 this.value = value; 067 } 068 069 /** 070 * Returns this enumeration value's integer value. 071 * 072 * @return the value 073 */ 074 public int getValue() { 075 return value; 076 } 077 078 /** 079 * Returns the string table for class ActionType 080 */ 081 protected String[] getStringTable() { 082 return stringTable; 083 } 084 085 /** 086 * Returns the enumeration value table for class ActionType 087 */ 088 protected ActionType[] getEnumValueTable() { 089 return enumValueTable; 090 } 091 092 /** 093 * Return an object of the specified value. 094 * 095 * @param value a designator for the object. 096 */ 097 public static ActionType getActionType(int value) { 098 return enumValueTable[value]; 099 } 100 101 /** 102 * Return the string name of this ActionType or the integer value if 103 * outside the bounds of the table 104 */ 105 public String toString() { 106 return (value >= 0 && value <= 2) ? stringTable[value] : String.valueOf(value); 107 } 108 109 /** 110 * Returns the lowest integer value used by this enumeration value's 111 * enumeration class. 112 * 113 * @return the offset of the lowest enumeration value. 114 */ 115 protected int getOffset() { 116 return 0; 117 } 118 }