Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2010, Red Hat, Inc., and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 
 package org.jboss.as.connector.subsystems.resourceadapters;
 
 import static org.jboss.as.connector.pool.Constants.BACKGROUNDVALIDATION;
 import static org.jboss.as.connector.pool.Constants.BACKGROUNDVALIDATIONMILLIS;
 import static org.jboss.as.connector.pool.Constants.BLOCKING_TIMEOUT_WAIT_MILLIS;
 import static org.jboss.as.connector.pool.Constants.IDLETIMEOUTMINUTES;
 import static org.jboss.as.connector.pool.Constants.MAX_POOL_SIZE;
 import static org.jboss.as.connector.pool.Constants.MIN_POOL_SIZE;
 import static org.jboss.as.connector.pool.Constants.POOL_FLUSH_STRATEGY;
 import static org.jboss.as.connector.pool.Constants.POOL_PREFILL;
 import static org.jboss.as.connector.pool.Constants.POOL_USE_STRICT_MIN;
 import static org.jboss.as.connector.pool.Constants.USE_FAST_FAIL;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.ADMIN_OBJECTS_NAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.ALLOCATION_RETRY;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.ALLOCATION_RETRY_WAIT_MILLIS;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.APPLICATION;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.ARCHIVE;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.BEANVALIDATIONGROUPS;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.BOOTSTRAPCONTEXT;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.CLASS_NAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.CONFIG_PROPERTIES;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.CONFIG_PROPERTY_VALUE;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.CONNECTIONDEFINITIONS_NAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.ENABLED;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.INTERLEAVING;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.JNDINAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.NOTXSEPARATEPOOL;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.NO_RECOVERY;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.PAD_XID;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RECOVERLUGIN_CLASSNAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RECOVERLUGIN_PROPERTIES;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RECOVERY_PASSWORD;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RECOVERY_SECURITY_DOMAIN;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RECOVERY_USERNAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.RESOURCEADAPTER_NAME;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.SAME_RM_OVERRIDE;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.SECURITY_DOMAIN;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.SECURITY_DOMAIN_AND_APPLICATION;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.TRANSACTIONSUPPORT;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.USETRYLOCK;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.USE_CCM;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.USE_JAVA_CONTEXT;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.WRAP_XA_RESOURCE;
 import static org.jboss.as.connector.subsystems.resourceadapters.Constants.XA_RESOURCE_TIMEOUT;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ATTRIBUTES;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CHILDREN;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HEAD_COMMENT_ALLOWED;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NAMESPACE;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.NILLABLE;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_NAME;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REPLY_PROPERTIES;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUEST_PROPERTIES;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUIRED;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TAIL_COMMENT_ALLOWED;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.TYPE;
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.VALUE_TYPE;
 
 

Author(s):
@author Stefano Maestri
 
 
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            ,
            };
            ,
            };
    public static final String RESOURCE_NAME = ResourceAdaptersSubsystemProviders.class.getPackage().getName() + ".LocalDescriptions";
    static final DescriptionProvider SUBSYSTEM = new DescriptionProvider() {
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode subsystem = new ModelNode();
            subsystem.get().set(bundle.getString("resource-adapters"));
            subsystem.get().set(true);
            subsystem.get().set(true);
            subsystem.get().set(..getUriString());
            // Should this be an attribute instead
            //subsystem.get(CHILDREN, Constants.RESOURCEADAPTER_NAME, MODEL_DESCRIPTION);
            return subsystem;
        }
    };
    static final DescriptionProvider SUBSYSTEM_ADD_DESC = new DescriptionProvider() {
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("add");
            operation.get().set(bundle.getString("resource-adapters.add"));
            operation.get().setEmptyObject();
            operation.get().setEmptyObject();
            return operation;
        }
    };
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("remove");
            operation.get().set(bundle.getString("resource-adapters.remove"));
            operation.get().setEmptyObject();
            operation.get().setEmptyObject();
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode configPropertiesNode = new ModelNode();
            configPropertiesNode.get().set(true);
            configPropertiesNode.get().set(true);
            configPropertiesNode.get().set(.getName());
            .addResourceAttributeDescription(bundle"config-properties"configPropertiesNode);
            return configPropertiesNode;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode connectionDefinitionNode = new ModelNode();
            connectionDefinitionNode.get().set(true);
            connectionDefinitionNode.get().set(true);
            connectionDefinitionNode.get().set();
            for (SimpleAttributeDefinition attribute : ) {
                if (attribute == ) {
                    connectionDefinitionNode.get(.getName(), ).set(bundle.getString(.getName()));
                    connectionDefinitionNode.get(.getName(), ).set(.getType());
                    connectionDefinitionNode.get(.getName(), ).set(.);
                    connectionDefinitionNode.get(.getName(), ).set(false);
                } else {
                    attribute.addResourceAttributeDescription(bundlenullconnectionDefinitionNode);
                }
            }
            connectionDefinitionNode.get(..getName(), ).set(bundle.getString(..getName()));
            return connectionDefinitionNode;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode adminObjectNode = new ModelNode();
            adminObjectNode.get().set(true);
            adminObjectNode.get().set(true);
            adminObjectNode.get().set();
            for (SimpleAttributeDefinition attribute : ) {
                attribute.addResourceAttributeDescription(bundlenulladminObjectNode);
            }
            adminObjectNode.get(..getName(), ).set(bundle.getString(..getName()));
            return adminObjectNode;
        }
    };
     static final DescriptionProvider RESOURCEADAPTER_DESC = new DescriptionProvider() {
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode raNode = new ModelNode();
            raNode.get().set(true);
            raNode.get().set(true);
            raNode.get().set();
            raNode.get(.getName(), ).set(bundle.getString(.getName()));
            raNode.get(.getName(), ).set(.);
            raNode.get(.getName(), ).set(true);
            raNode.get(.getName(), ).set(.);
            raNode.get(.getName(), ).set(true);
            raNode.get(.getName(), ).set(bundle.getString(.getName()));
            raNode.get(.getName(), ).set(.);
            raNode.get(.getName(), ).set(false);
            raNode.get(.getName(), ).set(.);
            raNode.get(.getName(), ).set(false);
            return raNode;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set();
            operation.get().set(bundle.getString("resource-adapter.add"));
            final ModelNode adminObjectNode = new ModelNode();
            adminObjectNode.get().set();
            operation.get(.getName(), ).set(bundle.getString(.getName()));
            operation.get(.getName(), ).set(.);
            operation.get(.getName(), ).set(true);
            operation.get(.getName(), ).set(.);
            operation.get(.getName(), ).set(true);
            operation.get(.getName(), ).set(.);
            operation.get(.getName(), ).set(false);
            operation.get(.getName(), ).set(.);
            operation.get(.getName(), ).set(false);
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode op = new ModelNode();
            op.get().set(bundle.getString("config-properties.add"));
            op.get().set();
            .addOperationParameterDescription(bundle"config-properties"op);
            return op;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode op = new ModelNode();
            op.get().set(bundle.getString("connection-definition.add"));
            op.get().set();
            for (SimpleAttributeDefinition attribute : ) {
                if (attribute == ) {
                    op.get(.getName(), ).set(.getType());
                    op.get(.getName(), ).set(.);
                    op.get(.getName(), ).set(false);
                } else {
                    attribute.addOperationParameterDescription(bundlenullop);
                }
            }
            return op;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode op = new ModelNode();
            op.get().set(bundle.getString("admin-object.add"));
            op.get().set();
            for (SimpleAttributeDefinition attribute : ) {
                attribute.addOperationParameterDescription(bundlenullop);
            }
            return op;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set();
            operation.get().set(bundle.getString("resourceadapter.remove"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set();
            operation.get().set(bundle.getString("config-properties.remove"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set();
            operation.get().set(bundle.getString("connection-definition.remove"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set();
            operation.get().set(bundle.getString("admin-object.remove"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("flush-idle-connection-in-pool");
            operation.get().set(bundle.getString("resourceadapter.flush-idle-connection-in-pool"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("flush-all-connection-in-pool");
            operation.get().set(bundle.getString("resourceadapter.flush-all-connection-in-pool"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("test-connection-in-pool");
            operation.get().set(bundle.getString("resourceadapter.test-connection-in-pool"));
            return operation;
        }
    };
        @Override
        public ModelNode getModelDescription(final Locale locale) {
            final ResourceBundle bundle = getResourceBundle(locale);
            final ModelNode operation = new ModelNode();
            operation.get().set("clear-statistics");
            operation.get().set(bundle.getString("resourceadapter.clear-statistics"));
            return operation;
        }
    };
    private static ResourceBundle getResourceBundle(Locale locale) {
        if (locale == null) {
            locale = Locale.getDefault();
        }
        return ResourceBundle.getBundle(locale);
    }
New to GrepCode? Check out our FAQ X