Class JbossConfiguration


  • class JbossConfiguration
    extends java.lang.Object
    The JBoss specific configuration, used to generate the jboss-app.xml deployment descriptor file
    Version:
    $Id: JbossConfiguration.java 1636449 2014-11-03 21:27:36Z khmarbaise $
    • Constructor Summary

      Constructors 
      Constructor Description
      JbossConfiguration​(java.lang.String version, java.lang.String securityDomain, java.lang.String unauthenticatedPrincipal, java.lang.String jmxName, java.lang.String loaderRepository, java.lang.String moduleOrder, java.util.List<java.lang.String> dataSources, java.lang.String libraryDirectory, java.lang.String loaderRepositoryConfig, java.lang.String loaderRepositoryClass, java.lang.String configParserClass)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getConfigParserClass()
      Returns the class loader's configuration parser class to include in the jboss-app.xml file.
      java.util.List<java.lang.String> getDataSources()
      Returns the list of datasources to include in the jboss-app.xml file as services.
      java.lang.String getJmxName()
      The jmx-name element allows one to specify the JMX ObjectName to use for the MBean associated with the ear module.
      java.lang.String getLibraryDirectory()
      Returns the library directory to include in the jboss-app.xml file.
      java.lang.String getLoaderRepository()
      The loader-repository specifies the name of the UnifiedLoaderRepository MBean to use for the ear to provide ear level scoping of classes deployed in the ear.
      java.lang.String getLoaderRepositoryClass()
      Returns the class loader repository class to include in the jboss-app.xml file.
      java.lang.String getLoaderRepositoryConfig()
      Returns the class loader repository configuration to include in the jboss-app.xml file.
      java.lang.String getModuleOrder()
      The module-order specifies the order in which the modules specified in the application.xml file gets loaded.
      java.lang.String getSecurityDomain()
      The security-domain element specifies the JNDI name of the security manager that implements the EJBSecurityManager and RealmMapping for the domain.
      java.lang.String getUnauthenticatedPrincipal()
      The unauthenticated-principal element specifies the name of the principal that will be returned by the EJBContext.getCallerPrincipal() method if there is no authenticated user.
      java.lang.String getVersion()
      Returns the targeted version of JBoss.
      boolean isJbossFive()
      Returns true if the targeted JBoss version is 5.
      boolean isJbossFour()
      Returns true if the targeted JBoss version is 4.
      boolean isJbossFourDotTwo()
      Returns true if the targeted JBoss version is 4.2.
      boolean isJbossFourDotTwoOrHigher()
      Returns true if the targeted JBoss version if 4.2 or higher (that is 4.2 or 5).
      boolean isJbossFourOrHigher()
      Returns true if the targeted JBoss version if 4 or higher (that is 4, 4.2 or 5).
      boolean isJbossThreeDotTwo()
      Returns true if the targeted JBoss version is 3.2.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UNAUHTHENTICTED_PRINCIPAL

        static final java.lang.String UNAUHTHENTICTED_PRINCIPAL
        See Also:
        Constant Field Values
      • LOADER_REPOSITORY_CLASS_ATTRIBUTE

        static final java.lang.String LOADER_REPOSITORY_CLASS_ATTRIBUTE
        See Also:
        Constant Field Values
      • LOADER_REPOSITORY_CONFIG

        static final java.lang.String LOADER_REPOSITORY_CONFIG
        See Also:
        Constant Field Values
      • CONFIG_PARSER_CLASS_ATTRIBUTE

        static final java.lang.String CONFIG_PARSER_CLASS_ATTRIBUTE
        See Also:
        Constant Field Values
      • version

        private final java.lang.String version
      • jbossThreeDotTwo

        private boolean jbossThreeDotTwo
      • jbossFour

        private boolean jbossFour
      • jbossFourDotTwo

        private boolean jbossFourDotTwo
      • jbossFive

        private boolean jbossFive
      • securityDomain

        private final java.lang.String securityDomain
      • unauthenticatedPrincipal

        private final java.lang.String unauthenticatedPrincipal
      • jmxName

        private final java.lang.String jmxName
      • loaderRepository

        private final java.lang.String loaderRepository
      • loaderRepositoryConfig

        private final java.lang.String loaderRepositoryConfig
      • loaderRepositoryClass

        private final java.lang.String loaderRepositoryClass
      • configParserClass

        private final java.lang.String configParserClass
      • moduleOrder

        private final java.lang.String moduleOrder
      • dataSources

        private final java.util.List<java.lang.String> dataSources
      • libraryDirectory

        private final java.lang.String libraryDirectory
    • Constructor Detail

      • JbossConfiguration

        public JbossConfiguration​(java.lang.String version,
                                  java.lang.String securityDomain,
                                  java.lang.String unauthenticatedPrincipal,
                                  java.lang.String jmxName,
                                  java.lang.String loaderRepository,
                                  java.lang.String moduleOrder,
                                  java.util.List<java.lang.String> dataSources,
                                  java.lang.String libraryDirectory,
                                  java.lang.String loaderRepositoryConfig,
                                  java.lang.String loaderRepositoryClass,
                                  java.lang.String configParserClass)
                           throws EarPluginException
        Throws:
        EarPluginException
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
        Returns the targeted version of JBoss.
        Returns:
        the jboss version
      • isJbossThreeDotTwo

        public boolean isJbossThreeDotTwo()
        Returns true if the targeted JBoss version is 3.2.
        Returns:
        if the targeted version is 3.2
      • isJbossFour

        public boolean isJbossFour()
        Returns true if the targeted JBoss version is 4.
        Returns:
        if the targeted version is 4
      • isJbossFourOrHigher

        public boolean isJbossFourOrHigher()
        Returns true if the targeted JBoss version if 4 or higher (that is 4, 4.2 or 5).
        Returns:
        true if the targeted version is 4+
      • isJbossFourDotTwo

        public boolean isJbossFourDotTwo()
        Returns true if the targeted JBoss version is 4.2.
        Returns:
        if the targeted version is 4.2
      • isJbossFourDotTwoOrHigher

        public boolean isJbossFourDotTwoOrHigher()
        Returns true if the targeted JBoss version if 4.2 or higher (that is 4.2 or 5).
        Returns:
        true if the targeted version is 4.2+
      • isJbossFive

        public boolean isJbossFive()
        Returns true if the targeted JBoss version is 5.
        Returns:
        if the targeted version is 5
      • getSecurityDomain

        public java.lang.String getSecurityDomain()
        The security-domain element specifies the JNDI name of the security manager that implements the EJBSecurityManager and RealmMapping for the domain. When specified at the jboss level it specifies the security domain for all j2ee components in the deployment unit.

        One can override the global security-domain at the container level using the security-domain element at the container-configuration level.

        Only available as from JBoss 4.

        Returns:
        the JNDI name of the security manager
      • getUnauthenticatedPrincipal

        public java.lang.String getUnauthenticatedPrincipal()
        The unauthenticated-principal element specifies the name of the principal that will be returned by the EJBContext.getCallerPrincipal() method if there is no authenticated user. This Principal has no roles or privileges to call any other beans.

        Only available as from JBoss 4.

        Returns:
        the unauthenticated principal
      • getJmxName

        public java.lang.String getJmxName()
        The jmx-name element allows one to specify the JMX ObjectName to use for the MBean associated with the ear module. This must be a unique name and valid JMX ObjectName string.
        Returns:
        the object name of the ear mbean
      • getLoaderRepository

        public java.lang.String getLoaderRepository()
        The loader-repository specifies the name of the UnifiedLoaderRepository MBean to use for the ear to provide ear level scoping of classes deployed in the ear. It is a unique JMX ObjectName string.

        Example:

        <loader-repository>jboss.test:loader=cts-cmp2v1-sar.ear</loader-repository>
        Returns:
        the object name of the ear mbean
      • getModuleOrder

        public java.lang.String getModuleOrder()
        The module-order specifies the order in which the modules specified in the application.xml file gets loaded. Allowed values are:

        strict The strict value indicates that the deployments of the modules will be done in the order that would be specified in the application.xml and jboss-app.xml file.

        implicit The implicit value indicates the deployment would follow the order which would be specified in the DeploymentSorter.

        Returns null if no module order is set.

        Only available in JBoss 4.2 and 4.3. Has no effect in JBoss 5 and is not added when mentioned version is used.

        Returns:
        the module order
      • getDataSources

        public java.util.List<java.lang.String> getDataSources()
        Returns the list of datasources to include in the jboss-app.xml file as services. Each element of the list is the relative path to the datasource file contained in the EAR archive.
        Returns:
        the list of datasources paths
      • getLibraryDirectory

        public java.lang.String getLibraryDirectory()
        Returns the library directory to include in the jboss-app.xml file. It tells JBoss where to find non-Java EE libraries included in the EAR.
        Returns:
        the library directory
      • getLoaderRepositoryConfig

        public java.lang.String getLoaderRepositoryConfig()
        Returns the class loader repository configuration to include in the jboss-app.xml file. The content of this element is handed to the class loader, thereby altering it's default behaviour.

        This element is added as a child to the loader-repository element. If the element is not present in the configuration, it will be added.

        Example: <loader-repository-config>java2ParentDelegaton=true</loader-repository-config>

        Returns:
        the class loader repository configuration
      • getLoaderRepositoryClass

        public java.lang.String getLoaderRepositoryClass()
        Returns the class loader repository class to include in the jboss-app.xml file. It tells JBoss which loader repository implementation to use.

        This element is added as an attribute to the loader-repository element, therefore it is not added if no such element configuration is present.

        Example: <loader-repository-class>org.mindbug.jboss.AlternateLoaderRepository</loader-repository-class>

        Returns:
        the class loader repository class
      • getConfigParserClass

        public java.lang.String getConfigParserClass()
        Returns the class loader's configuration parser class to include in the jboss-app.xml file. It tells JBoss how to parse the configuration given in the loader-repository-config element.

        This element is added as an attribute to the loader-repository-config element, therefore it is not added if no such element configuration is present.

        Example: <config-parser-class>org.mindbug.jboss.AlternateLoaderRepositoryConfigParser</config-parser-class>

        Returns:
        the class loader's configuration parser class