Runtime components : Core components : CHA : Tasks : Configuring CHA
  
Configuring CHA
In btt.xml, there is a configuration block for CHA, which is used for the basic settings of CHA.
Compared with previous version of the toolkit, the following items are added:
"initializer" indicates the initialization class of CHA
"extFile" indicates the external file of contexts
"context" indicates the implementation class of context
"isPersistenceEnabled" indicates whether CHA needs persistence support
Following is an example:
<kColl id="cha">
<kColl id="classTable">
<!-- indicates the implementation class of context-->
<field id="context" value="com.ibm.btt.base.LocalContextImpl"/>
</kColl>
<!-- indicates the initialization class of CHA-->
<field id="initializer" value="com.ibm.btt.base.init.ContextInitializer"/>

<!-- indicates the external file of CHA-->
<field id="extFile" value="dsectxt.xml"/>

<!-- indicates the JNDI looking up properties of CHA-->
<field id="ejbInitialContextFactory" value="com.ibm.websphere.naming.WsnInitialContextFactory"/>
<field id="EJBProviderURL" value="iiop://localhost:2809"/>

<!-- indicates the home interface of CHAEJB-->
<field id="CHASessionLocalHome" value="java:comp/env/ejb/CHASession"/>
<field id="CHAInstanceLocalHome" value="java:comp/env/ejb/CHAInstance"/>
<field id="CHAControlLocalHome" value="java:comp/env/ejb/CHAControl"/>
<field id="CHASessionHome" value="ejb/com/ibm/btt/cha/ejb/CHASessionHome"/>
<field id="CHAInstanceHome" value="ejb/com/ibm/btt/cha/ejb/CHAInstanceHome"/>

<!-- indicates the initialized context tree of CHA-->
<field id="initTailContextName" value="branchServer"/>

<!-- indicates whether to cleanup the context instance from the DB tables-->
<field id="cleanupCHAServer" value="true"/>

<!-- indicates whether to use local interface when invoke CHAEJB-->
<field id="isLocalCall" value="true"/>

<!-- indicates whether the remote CHA supports persistence-->
<field id="isPersistenceEnabled" value="false"/>
</kColl>
Contexts need to be predefined externally before runtime. When you create context instances, the information will be read from the external files and convert to context objects one by one. The context definition is placed in the external "extFile" dsectxt.xml. Following is an example of the dsectxt.xml:
<?xml version="1.0"?>
<dsectxt.xml>
<!-- context branchServer -->
<context id="branchServer" parent="nil" type="server" level="root">
<refKColl refId="branchData"/>
</context>

<!-- context sessionCtx -->>
<context id="sessionCtx" parent="branchServer" type="op">
<refKColl refId="sessionData"/>
</context>

<!-- context subBranchServer -->
<context id="subBranchServer" type="branch" parent="sessionCtx" level="normal">
<refKColl refId="clientWorkstation"/>
</context>
</dsectxt.xml>
See also
Tasks