PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/jboss-as-7.1.1.Final/ejb3/src/main/java/org/jboss/as/ejb3/subsystem/EJB3SubsystemXMLAttribute.java

#
Java | 117 lines | 64 code | 24 blank | 29 comment | 4 complexity | cb4f550fd46d02af1a0756c642afe4dd MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. /*
  2. * JBoss, Home of Professional Open Source.
  3. * Copyright 2011, Red Hat, Inc., and individual contributors
  4. * as indicated by the @author tags. See the copyright.txt file in the
  5. * distribution for a full listing of individual contributors.
  6. *
  7. * This is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation; either version 2.1 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This software is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this software; if not, write to the Free
  19. * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  21. */
  22. package org.jboss.as.ejb3.subsystem;
  23. import java.util.HashMap;
  24. import java.util.Map;
  25. /**
  26. * @author Jaikiran Pai
  27. */
  28. public enum EJB3SubsystemXMLAttribute {
  29. UNKNOWN(null),
  30. ALIASES("aliases"),
  31. BEAN_CACHE("bean-cache"),
  32. CACHE_CONTAINER("cache-container"),
  33. CACHE_REF("cache-ref"),
  34. CLIENT_MAPPINGS_CACHE("client-mappings-cache"),
  35. CLUSTERED_CACHE_REF("clustered-cache-ref"),
  36. CONNECTOR_REF("connector-ref"),
  37. CORE_THREADS("core-threads"),
  38. DEFAULT_ACCESS_TIMEOUT("default-access-timeout"),
  39. ENABLED("enabled"),
  40. ENABLE_BY_DEFAULT("enable-by-default"),
  41. GROUPS_PATH("groups-path"),
  42. IDLE_TIMEOUT("idle-timeout"),
  43. IDLE_TIMEOUT_UNIT("idle-timeout-unit"),
  44. INSTANCE_ACQUISITION_TIMEOUT("instance-acquisition-timeout"),
  45. INSTANCE_ACQUISITION_TIMEOUT_UNIT("instance-acquisition-timeout-unit"),
  46. KEEPALIVE_TIME("keepalive-time"),
  47. MAX_POOL_SIZE("max-pool-size"),
  48. MAX_SIZE("max-size"),
  49. MAX_THREADS("max-threads"),
  50. NAME("name"),
  51. PASS_BY_VALUE("pass-by-value"),
  52. PASSIVATE_EVENTS_ON_REPLICATE("passivate-events-on-replicate"),
  53. PASSIVATION_STORE_REF("passivation-store-ref"),
  54. PATH("path"),
  55. POOL_NAME("pool-name"),
  56. RELATIVE_TO("relative-to"),
  57. RESOURCE_ADAPTER_NAME("resource-adapter-name"),
  58. SESSIONS_PATH("sessions-path"),
  59. SUBDIRECTORY_COUNT("subdirectory-count"),
  60. THREAD_POOL_NAME("thread-pool-name"),
  61. USE_QUALIFIED_NAME("use-qualified-name"),
  62. ;
  63. private final String name;
  64. EJB3SubsystemXMLAttribute(final String name) {
  65. this.name = name;
  66. }
  67. /**
  68. * Get the local name of this attribute.
  69. *
  70. * @return the local name
  71. */
  72. public String getLocalName() {
  73. return name;
  74. }
  75. private static final Map<String, EJB3SubsystemXMLAttribute> MAP;
  76. static {
  77. final Map<String, EJB3SubsystemXMLAttribute> map = new HashMap<String, EJB3SubsystemXMLAttribute>();
  78. for (EJB3SubsystemXMLAttribute element : values()) {
  79. final String name = element.getLocalName();
  80. if (name != null)
  81. map.put(name, element);
  82. }
  83. MAP = map;
  84. }
  85. public static EJB3SubsystemXMLAttribute forName(String localName) {
  86. final EJB3SubsystemXMLAttribute element = MAP.get(localName);
  87. return element == null ? UNKNOWN : element;
  88. }
  89. @Override
  90. public String toString() {
  91. return getLocalName();
  92. }
  93. }