Chapter 27. Configuring a JEUS Deployment Plan

Table of Contents

27.1. Introduction
27.2. XML Schema/XML Tree
27.3. Element Reference
27.4. Example File

This chapter explains the tags of JEUS deployment plan.

XML references are configured in the following format.

  1. XML Schema/XML Tree: Summarizes all the tags of XML configuration file. Each node is defined in the following format.

    1. Tag reference enables quick search for tags. Each tag is attached with index numbers ( ex: (11) ). Tags are explained with this number in tag reference.

    2. The XML tag name defined in the XML schema is expressed in the format of <tag name>.

    3. Tags are set with cardinality defined in XML schema.

      “?” is for 0 or 1 element, “+” is for 1 or more elements, “*” is for 0 or more elements, (no symbol) is for exactly one element

    4. Several tags have "P" character, meaning that they are the tags related to performance. These tags are used to tune the setting.

  2. Element Reference: Explains XML tags in the tree.

    1. Dynamic: Allowed to change the configuration dynamically.

    2. Non-Dynamic: Not allowed to change the configuration dynamically. This is expressed only for the special case to comment out.

    3. Description: A short description for tags.

    4. Value Description: The value and type.

    5. Value Type: Data type of the value. (ex: String)

    6. Value Type Description: Description for the data type of the value.

    7. Default Value: The value to be used by default when the XML is not used.

    8. Defined Value: The default value.

    9. Example: The XML tag example.

    10. Performance Recommendation: The value recommended to improve performance.

    11. Child Elements:The tags contained in its own tag element.

(1) <jeus-deployment-plan>
Description Use this to configure the JEUS deployment plan.
Value Type jeus-deployment-planType
Child Elements

(3) descriptors

(2) < jeus-deployment-plan > <descriptors>
Description Use this to configure multiple descriptors.
Value Type descriptorsType
Child Elements

(4) descriptor

(3) < jeus-deployment-plan >< descriptors > <descriptor>
Description Use this to configure the deployment descriptor for the JEUS deployment plan and other detailed settings.
Value Type descriptorType
Child Elements

(5) uri

(6) configurations

(4) < jeus-deployment-plan >< descriptors >< descriptor > <uri>
Description Indicates the URI for the deployment descriptor.
Value Type token

(5) < jeus-deployment-plan >< descriptors >< descriptor > <configurations>
Description Use this to define multiple configurations.
Value Type configurationsType
Child Elements

(7) configuration

(6) < jeus-deployment-plan >< descriptors >< descriptor >< configurations > <configuration>
Description Configuration unit that will be applied using the JEUS plan.
Value Type configurationType
Child Elements

(8) action

(9) xpath

(10) value

(7) < jeus-deployment-plan >< descriptors >< descriptor >< configurations >< configuration > <action>
Description Action type of the configuration.
Value Type actionType
Defined Value

DELETE

REPLACE

APPEND_CHILD

INSERT_BEFORE

(8) < jeus-deployment-plan >< descriptors >< descriptor >< configurations >< configuration > <xpath>
Description XPath to the target element in the XML document where the configuration will be applied.
Value Type token

(9) < jeus-deployment-plan >< descriptors >< descriptor >< configurations >< configuration > <value>
Description Input value that is required to perform REPLACE, APPEND_CHILD, and INSERT_BEFORE actions.
Value Type token

[Example 27.1] Example File

<?xml version="1.0" encoding="UTF-8"?>
<jeus-deployment-plan xmlns="http://www.tmaxsoft.com/xml/ns/jeus">
    <descriptors>
        <!-- For standalone EJB -->
        <descriptor>
            <uri>META-INF/ejb-jar.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/ejb-jar/enterprise-beans/session/ejb-name[.='ByeBean']</xpath>
                    <value>
                        <![CDATA[<ejb-name>HiBean</ejb-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/ejb-jar/enterprise-beans/session/local-home[.='HelloHomeLocal']</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/ejb-jar/enterprise-beans/session/ejb-name[.='HiBean']/..</xpath>
                    <value>
                        <![CDATA[<transaction-type>Bean</transaction-type>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/ejb-jar/enterprise-beans/session/ejb-name[.='HelloBean']/../transaction-type</xpath>
                    <value>
                        <![CDATA[<session-type>Stateless</session-type>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>META-INF/jeus-ejb-dd.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/jeus-ejb-dd/beanlist/jeus-bean/export-name[.='ByeBean']</xpath>
                    <value>
                        <![CDATA[<export-name>HiBean</export-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/jeus-ejb-dd/beanlist/jeus-bean/local-export-name[.='HelloBeanLocal']</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/jeus-ejb-dd/beanlist/jeus-bean</xpath>
                    <value>
                        <![CDATA[<jeus-rmi>false</jeus-rmi>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/jeus-ejb-dd/beanlist/jeus-bean/ejb-name[.='HiBean']/../jeus-rmi</xpath>
                    <value>
                        <![CDATA[<thread-max>100</thread-max>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>

        <!-- For standalone web application -->
        <descriptor>
            <uri>WEB-INF/web.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/web-app/servlet-mapping/servlet-name[.='HiServlet']</xpath>
                    <value>
                        <![CDATA[<servlet-name>HelloServlet</servlet-name>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/web-app/servlet/load-on-startup</xpath>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/web-app/login-config</xpath>
                    <value>
                        <![CDATA[<auth-method>BASIC</auth-method>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/web-app/env-entry/env-entry-value[.='java.lang.Boolean']</xpath>
                    <value>
                        <![CDATA[<env-entry-type>java.lang.String</env-entry-type>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>WEB-INF/jeus-web-dd.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/jeus-web-dd/enable-jsp</xpath>
                    <value>
                        <![CDATA[<enable-jsp>true</enable-jsp>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>DELETE</action>
                    <xpath>/jeus-web-dd/max-instance-pool-size</xpath>
                </configuration>
                <configuration>
                    <action>INSERT_BEFORE</action>
                    <xpath>/jeus-web-dd/enable-jsp</xpath>
                    <value>
                        <![CDATA[<context-path>/hello</context-path>]]>
                    </value>
                </configuration>
                <configuration>
                    <action>APPEND_CHILD</action>
                    <xpath>/jeus-web-dd</xpath>
                    <value>
                        <![CDATA[<webinf-first><enabled>false</enabled></webinf-first>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>

        <!-- For EAR -->
        <descriptor>
            <uri>META-INF/application.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/application/library-directory</xpath>
                    <value>
                        <![CDATA[<library-directory>mylib</library-directory>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>ejb.jar!/META-INF/ejb-jar.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/ejb-jar/enterprise-beans/session/ejb-class</xpath>
                    <value>
                        <![CDATA[<ejb-class>HelloBean</ejb-class>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
        <descriptor>
            <uri>web.war!/WEB-INF/web.xml</uri>
            <configurations>
                <configuration>
                    <action>REPLACE</action>
                    <xpath>/web-app/servlet-mapping/servlet-name</xpath>
                    <value>
                        <![CDATA[<servlet-name>HelloServlet</servlet-name>]]>
                    </value>
                </configuration>
            </configurations>
        </descriptor>
    </descriptors>
</jeus-deployment-plan>