2.4. Configuring JOnAS Services

Here is the list of possible services

registry,jmx,security,jtm,db,mail,wc,dbm,wm,resource,cmi,ha,versioning,ejb2,ejb3,jaxrpc,jaxws,web,ear,depmonitor,discovery,resourcemonitor,smartclient,wsdl-publisher

In this chapter we will describe how to configure each service in the jonas.properties file.

2.4.1. cmi service configuration

The configuration of the cmi service is available through the file $JONAS_BASE/conf/cmi-config.xml.

The CMI service can be configured in two modes:

  • server mode with a cluster view manager created locally, i.e. with a local instance of a replicated CMI registry.

  • client mode without a local cluster view manager, in this case a list of providers urls (i.e. a list of cluster view manager urls) is given for accessing to the remote CMI registries.

The server mode is simpler to configure, the client mode requires to define statically a list of providers urls. The server mode starts a Group Communication Protocol instance (e.g. JGroups) and thus increases the resources consumption compare to the client mode.

[Note] Note

The CMI configuration file may contain two parts: a server element which corresponds to the server mode configuration and a client element for the client mode configuration. If the two are present, only the server element is loaded which means that the server mode is configured.

2.4.1.1. Server mode configuration

The server element contains the following elements:

Example 2.1. Configuring the cmi service in the server mode

  
<cmi xmlns="http://org.ow2.cmi.controller.common"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:jgroups="http://org.ow2.cmi.controller.server.impl.jgroups">
    <server>
        <jndi> 1
            <protocol name="jrmp" noCmi="false" />
        </jndi>
        <viewManager  2
            class="org.ow2.cmi.controller.server.impl.jgroups.JGroupsClusterViewManager"> 3
            <jgroups:config 4
                    delayToRefresh="60000" 5
                    loadFactor="100" 6
                    confFileName="jgroups-cmi.xml" 7
                    recoTimeout="30000" 8
                    groupName="G1"> 9
                <components> 10
                 <event />
                </components>
            </jgroups:config>
        </viewManager>
    </server>
</cmi>


1

jndi element - optional. Enable to specify that a protocol must not be clustered with CMI (administration uses, ...). Here, the clustering of jrmp protocol can be disabled by setting true to the noCmi attribute.

2

viewManager element - mandatory. Defines the view manager configuration (registry replication, refresh time, ...).

3

class attribute - mandatory. Specifies the protocol implementation to use for replicating the view (CMI registry). Here the JGroups implementation is set.

4

jgroups:config element - mandatory. Define the JGroups related parameters.

5

delayToRefresh attribute - optional. Refresh period of the client view (in ms). For example, it expresses the maximum delay for taking into account a load-balancing parameter update.

6

loadFactor attribute - optional. Specifies the initial load-factor of the current node used in the weigthed round robin policy.

7

confFileName attribute - mandatory. Specifies the JGroups's stack configuration filename (found in the $JONAS_BASE/conf directory).

8

recoTimeout attribute - optional. Specifies the reconnection timeout after a shunning or an error in the group communication protocol (in ms). If the timer expires, an exception is thrown.

9

groupName attribute - mandatory. Specifies the JGroups channel name used by the CMI cluster view replication mechanism.

10

components element - mandatory. Enable the events component into CMI. This element must not be modified.

[Note] Note

Refer to the clustering guide for issues related to JGroups.

2.4.1.2. Client mode configuration

The client element contains the following elements:

Example 2.2. Configuring the cmi service in the client mode

  
<cmi xmlns="http://org.ow2.cmi.controller.common"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <client noCmi="false"> 1
    	<jndi> 2
        	<protocol name="jrmp">
            	<providerUrls> 
                	<providerUrl>rmi://localhost:1099</providerUrl>
                	<providerUrl>rmi://localhost:2001</providerUrl>
            	</providerUrls>
        	</protocol>
    	</jndi>
    </client>
</cmi>


1

noCmi attribute - optional. Enable to specify that CMI must be disabled.

2

jndi element - mandatory. Specify a list of providers URLs for a given protocol. It is not necessary to set the whole list of cluster members, a subset is enough. However for ensuring high availability, at least two providers URLs must be mentionned.