Below is the current servicemix.xml that I have working for a simple example. Everything functions properly, but I'd like to extract the various activationSpec components from the servicemix.xml file and create something like a service assembly (I might be using the wrong terminology here) so that I can hot deploy these components to the JBI container. I can't tell from any of the examples a good way that I might achieve this. It seems like all I have to do is create a .zip file that contains all of my configuration files, and another jbi.xml file that defines my components, but none of the examples illustrate how to do this with something like the ChainedComponent or XsltComponent. Any help would be greatly appreciated.
 
 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
    xmlns:spring="http://xbean.org/schemas/spring/1.0"
    xmlns:sm="http://servicemix.org/config/1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xbean.org/schemas/spring/1.0 /opt/apps/servicemix/current/conf/spring-beans.xsd http://servicemix.org/config/1.0 /opt/apps/servicemix/current/conf/servicemix.xsd"
    xmlns:foo="http://servicemix.org/demo/">
    
  <!-- the JBI container --> 
  <sm:container
      spring:id="jbi"
      name="bus_2"
      useMBeanServer="true"
      createMBeanServer="true"
      monitorInstallationDirectory="false"
      dumpStats="true"
      statsInterval="10"
      flowName="jms?jmsURL=reliable:(tcp://uscobrmfa-ad-98:61616,tcp://uscobrmfa-ad-99:61616)"
      transactionManager="#transactionManager"
      rmiPort="5099">
     

    <sm:activationSpecs>
      <!-- Create a http server binding on port 8914  and have it forward to the foo:chain -->
      <sm:activationSpec componentName="httpReceiver"
          service="foo:httpReceiver"
          endpoint="httpReceiver"
          destinationService="foo:chain">
        <sm:component>
          <bean xmlns="http://xbean.org/schemas/spring/1.0"
              class="org.servicemix.components.http.HttpConnector">
            <property name="host" value="10.128.1.211"/>
            <property name="port" value="8914"/>
            <property name="defaultInOut" value="true"/>
          </bean>
        </sm:component>
      </sm:activationSpec>

      <!-- Lets create a message router -->
      <sm:activationSpec componentName="chain" service="foo:chain">
        <sm:component>
          <bean xmlns="" class="org.servicemix.components.util.ChainedComponent">
            <property name="services">
              <list>
                <bean class="javax.xml.namespace.QName">
                  <constructor-arg value="http://servicemix.org/demo/" />
                  <constructor-arg value="soapExtractor" />
                </bean>

                <bean class="javax.xml.namespace.QName">
                  <constructor-arg value="http://servicemix.org/demo/" />
                  <constructor-arg value="getPerson" />
                </bean>
                
                <bean class="javax.xml.namespace.QName">
                  <constructor-arg value="http://servicemix.org/demo/" />
                  <constructor-arg value="soapExtractor" />
                </bean>
                
                <bean class="javax.xml.namespace.QName">
                  <constructor-arg value="http://servicemix.org/demo/" />
                  <constructor-arg value="soapInjector" />
                </bean>
                
              </list>
            </property>
          </bean>
        </sm:component>
      </sm:activationSpec>

      <!-- Provide a service to strip SOAP headers -->
      <sm:activationSpec componentName="soapExtractor"
          service="foo:soapExtractor">
        <sm:component>
          <bean xmlns="http://xbean.org/schemas/spring/1.0"
              class="org.servicemix.components.xslt.XsltComponent">
            <property name="xsltResource" value="SoapExtractor.xsl"/>
          </bean>
        </sm:component>
      </sm:activationSpec>

      <!-- Provide a service to add SOAP headers -->
      <sm:activationSpec componentName="soapInjector"
          service="foo:soapInjector">
        <sm:component>
          <bean xmlns="http://xbean.org/schemas/spring/1.0"
              class="org.servicemix.components.xslt.XsltComponent">
            <property name="xsltResource" value="SoapInjector.xsl"/>
          </bean>
        </sm:component>
      </sm:activationSpec>
      
        <!-- This just invokes a SOAP web service -->
      <sm:activationSpec componentName="getPerson"
          service="foo:getPerson"
          endpoint="getPerson">
        <sm:component>
          <bean xmlns="http://xbean.org/schemas/spring/1.0"
              class="org.servicemix.components.saaj.SaajBinding">
            <property name="soapEndpoint">
              <bean class="javax.xml.messaging.URLEndpoint">
                <constructor-arg value="http://10.128.1.211:8080/systinet/server/CexpObjectTest/CexpObjectTest/"/>
              </bean>
            </property>
          </bean>
        </sm:component>
      </sm:activationSpec>
    </sm:activationSpecs>
  </sm:container>

  <bean id="transactionContextManager" class="org.jencks.factory.TransactionContextManagerFactoryBean"/>

  <bean id="transactionManager" class="org.jencks.factory.GeronimoTransactionManagerFactoryBean" />

</beans>

Reply via email to