PageRenderTime 42ms CodeModel.GetById 32ms app.highlight 8ms 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 */
 22package org.jboss.as.ejb3.subsystem;
 23
 24import java.util.HashMap;
 25import java.util.Map;
 26
 27/**
 28 * @author Jaikiran Pai
 29 */
 30public enum EJB3SubsystemXMLAttribute {
 31    UNKNOWN(null),
 32
 33    ALIASES("aliases"),
 34
 35    BEAN_CACHE("bean-cache"),
 36
 37    CACHE_CONTAINER("cache-container"),
 38    CACHE_REF("cache-ref"),
 39    CLIENT_MAPPINGS_CACHE("client-mappings-cache"),
 40    CLUSTERED_CACHE_REF("clustered-cache-ref"),
 41    CONNECTOR_REF("connector-ref"),
 42    CORE_THREADS("core-threads"),
 43
 44    DEFAULT_ACCESS_TIMEOUT("default-access-timeout"),
 45
 46    ENABLED("enabled"),
 47    ENABLE_BY_DEFAULT("enable-by-default"),
 48
 49    GROUPS_PATH("groups-path"),
 50
 51    IDLE_TIMEOUT("idle-timeout"),
 52    IDLE_TIMEOUT_UNIT("idle-timeout-unit"),
 53    INSTANCE_ACQUISITION_TIMEOUT("instance-acquisition-timeout"),
 54    INSTANCE_ACQUISITION_TIMEOUT_UNIT("instance-acquisition-timeout-unit"),
 55
 56    KEEPALIVE_TIME("keepalive-time"),
 57
 58    MAX_POOL_SIZE("max-pool-size"),
 59    MAX_SIZE("max-size"),
 60    MAX_THREADS("max-threads"),
 61
 62    NAME("name"),
 63
 64    PASS_BY_VALUE("pass-by-value"),
 65    PASSIVATE_EVENTS_ON_REPLICATE("passivate-events-on-replicate"),
 66    PASSIVATION_STORE_REF("passivation-store-ref"),
 67    PATH("path"),
 68    POOL_NAME("pool-name"),
 69
 70    RELATIVE_TO("relative-to"),
 71    RESOURCE_ADAPTER_NAME("resource-adapter-name"),
 72
 73    SESSIONS_PATH("sessions-path"),
 74    SUBDIRECTORY_COUNT("subdirectory-count"),
 75
 76    THREAD_POOL_NAME("thread-pool-name"),
 77
 78    USE_QUALIFIED_NAME("use-qualified-name"),
 79    ;
 80
 81    private final String name;
 82
 83    EJB3SubsystemXMLAttribute(final String name) {
 84        this.name = name;
 85    }
 86
 87    /**
 88     * Get the local name of this attribute.
 89     *
 90     * @return the local name
 91     */
 92    public String getLocalName() {
 93        return name;
 94    }
 95
 96    private static final Map<String, EJB3SubsystemXMLAttribute> MAP;
 97
 98    static {
 99        final Map<String, EJB3SubsystemXMLAttribute> map = new HashMap<String, EJB3SubsystemXMLAttribute>();
100        for (EJB3SubsystemXMLAttribute element : values()) {
101            final String name = element.getLocalName();
102            if (name != null)
103                map.put(name, element);
104        }
105        MAP = map;
106    }
107
108    public static EJB3SubsystemXMLAttribute forName(String localName) {
109        final EJB3SubsystemXMLAttribute element = MAP.get(localName);
110        return element == null ? UNKNOWN : element;
111    }
112
113    @Override
114    public String toString() {
115        return getLocalName();
116    }
117}