Library Link To Toggle Frames Print Feedback

Celtix Spring Container Definition File

Overview

The Celtix Spring container is configured in the spring_container.xml file located in the following directory of your Celtix installation:

InstallDir/containers/spring_container/etc

spring_container.xml

The contents of the Celtix Spring container configuration file are shown in Example 1.2, “spring_container.xml” :

Example 1.2. spring_container.xml

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
   <!-- Bean definition for Container -->

1   <bean id="container" class="com.iona.cxf.container.ContainerBean">
       <property name="containerRepository" value="C:\Celtix/containers/spring_container/repository"
/>
   </bean>

2   <!-- Scanner bean allows for applications to be dropped into repository
for deployment -->

   <bean id="scanner" class="com.iona.cxf.container.RepositoryScannerBean">
       <property name="container">
          <ref bean="container" />
       </property>
       <property name="scanInterval" value="1000" />
   </bean>

3   <!-- Web Service Container Management -->

   <bean id="ContainerAdminApplication" class="com.iona.cxf.container.ApplicationBean">
       <property name="services">
           <list>
               <ref bean="ContainerService" />
           </list>
       </property>
   </bean>

   <bean id="ContainerService" class="com.iona.cxf.container.ServiceBean">
       <property name="serviceImpl">
           <ref bean="ContainerServiceImpl" />
       </property>
       <property name="wsdlLocation" value="wsdl/container.wsdl" />
       <property name="endpoints">
           <list>
               <ref bean="ContainerServicePort" />
           </list>
       </property>
   </bean>

   <bean id="ContainerServicePort" class="com.iona.cxf.container.EndpointBean">
       <property name="portName" value="ContainerServicePort"
/>
       <property name="address" value="http://localhost:2222/AdminContext/AdminPort"
/>
   </bean>

   <bean id="ContainerServiceImpl" class="com.iona.cxf.container.admin.ContainerAdminServiceImpl">
       <property name="container">
           <ref bean="container" />
       </property>
   </bean>

4    <!--  JMX Container Management  -->

   <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
       <property name="locateExistingServerIfPossible" value="true"
/>
   </bean>

   <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
       <property name="beans">
           <map>
               <entry key="bean:name=SpringContainer" value-ref="container"/>
               <entry key="connector:name=rmi" value-ref="serverConnector"/>
           </map>
       </property>

       <property name="server" ref="mbeanServer"/>
       <property name="assembler" ref="assembler" />
   </bean>

   <bean id="assembler" class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
       <property name="interfaceMappings">
           <props>
               <prop key="bean:name=SpringContainer">
         com.iona.cxf.container.managed.JMXContainer</prop>
           </props>
       </property>
   </bean>

   <bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean"
 depends-on="registry" >
       <property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/server"/>
   </bean>

   <bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean">
       <property name="port" value="1099"/>
   </bean>

</beans>

The code shown in Example 1.2, “spring_container.xml” can be explained as follows:

  1. Defines a bean that encapsulates the logic for the Celtix Spring container. This bean handles the logic for deploying user applications that are copied to the specified container repository location. The default container repository location is: InstallDir/containers/spring_container/repository. You can change the repository location by changing the value of the containerRepository property.

  2. Defines a scanner bean that scans the Spring container repository for applications that are deployed while the container is running. The scanInterval property sets the time interval at which the repository is scanned. It is set in milliseconds.

  3. Defines an application that creates a Web service interface that you can use to manage the Spring container. For more detail on the beans—ContainerAdminApplication, ContainerService, ContainerServicePort, and ContainerServiceImpl—that make up the application, please refer to the Javadoc located in InstallDir/docs/api/spring_container directory of your Celtix installation.

  4. Defines Spring beans that allow you to use a JMX console to manage the Spring container.

    For more information, please refer to the JMX chapter of the Spring 2.0.x reference document available at:

    http://static.springframework.org/spring/docs/2.0.x/reference/jmx.html