Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

ServiceMix LightWeight Container

Warning
Deprecated component
Deprecated component

The lightweight components are deprecated. You can use the servicemix-bean component instead to deploy your own simple components, or use the standard components.

The servicemix-lwcontainer is a JBI service engine that accepts servicemix.xml configuration files containing
lightweight components.

Take a look at the loan-broker demo or the bpel-bpe demo that ships with ServiceMix 3.x distributions.

Maven Archetype

You can use Maven servicemix-lwcontainer-service-unit archetype to create a LW container service unit:

Code Block
mvn archetype:create \
  -DarchetypeGroupId=org.apache.servicemix.tooling \
  -DarchetypeArtifactId=servicemix-lwcontainer-service-unit \
  -DarchetypeVersion=2010.01 \
  -DgroupId=your.group.id \
  -DartifactId=your.artifact.id \
  -Dversion=your-version

Deployment

Service units targeted at servicemix-lwcontainer component should contain a file named servicemix.xml that should have the following format:

Code Block
langxml
<beans xmlns:sm="http://servicemix.apache.org/config/1.0">
  <sm:serviceunit id="jbi">
    <sm:activationSpecs>
      <sm:activationSpec ...>
        <sm:component>
          <bean class="..." ...>
            ...
          </bean>
        </sm:component>
      </sm:activationSpec>
      ...
    </sm:activationSpecs>
  </sm:serviceunit>
</beans>

If you need to write your own components, you can easily embed some code using the following xml fragment at the top of the previous file:

Code Block
langxml
  <classpath>
    <location>.</location>
  </classpath>

This will add the content of the location tags (relative to the unzipped service unit) to the classpath. The previous configuration will just add the class files contained in the service unit, as if it is a plain jar.

If you want to embed jars, just use something like

Code Block
langxml
  <classpath>
    <location>lib/foo.jar</location>
  </classpath>