LibraryLink ToToggle FramesPrintFeedback

Spring Container Definition File

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

InstallDir/containers/spring_container/etc

The contents of the Spring container configuration file are shown in Example 5.2.

Example 5.2. spring_container.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:jaxws="http://cxf.apache.org/jaxws"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:container="http://schemas.iona.com/soa/container-config"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                          http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                         http://cxf.apache.org/jaxws
                            http://cxf.apache.org/schemas/jaxws.xsd
                          http://schemas.iona.com/soa/container-config
                          http://schemas.iona.com/soa/container-config.xsd">

   <!-- Bean definition for Container -->
   <container:container id="container" containerRepository="C:\iona\fuse-services-framework/containers/spring_container/repository" scanInterval="5000"/> 1

   <!-- Web Service Container Management -->
   <jaxws:endpoint id="ContainerService" 2
                   implementor="#ContainerServiceImpl"
                   address="http://localhost:2222/AdminContext/AdminPort"
                   wsdlLocation="/wsdl/container.wsdl"
                   endpointName="e:ContainerServicePort"
                   serviceName="s:ContainerService"
                   xmlns:e="http://cxf.iona.com/container/admin"
                   xmlns:s="http://cxf.iona.com/container/admin"/>

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

    <!--  JMX Container Management  -->
  <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean"> 3
    <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 XML shown in Example 5.2 does the following:

1

Defines a bean that encapsulates the logic for the 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 attribute.

The scanInterval attribute sets the time interval at which the repository is scanned. It is set in milliseconds. The default value is set to 5000 milliseconds. Removing this attribute disables scanning.

2

Defines an application that creates a Web service interface that you can use to manage the Spring container.

The ContainerServiceImpl bean contains the server implementation code and the container administration logic.

To change the port on which the Web service interface listens, change the address property.

3

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

For more information, see 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.