JBoss Community Archive (Read Only)

SwitchYard

Extensions

Extensions allow users to augment the set of component modules included in the SwitchYard distribution.  This feature can be used to:

Creating an Extension Module

In order to create an extension for SwitchYard, you must package the relevant jars and resources used by the component as an AS module.  SwitchYard modules can be found in the modules/system/layers/soa directory of your EAP installation.  Let's look at adding an extension component for a custom camel component called "MyBinding".

First we need to grab the jar for mybinding and create a module:

modules/system/layers/soa/org/example/mybinding/
   main/
      module.xml
      my-binding.jar

The module definition for our extension component looks like this:

<module xmlns="urn:jboss:module:1.0" name="org.example.mybinding">
  <resources>
    <resource-root path="my-binding.jar"/>
  </resources>
  <dependencies>
    <module name="org.apache.camel.core"/>
  </dependencies>
</module>

Registering the Extension Module

In order to make SwitchYard aware of the extension module, you need to add the module name to the list of extensions defined in the SwitchYard subsystem in standalone.xml. 

<subsystem xmlns="urn:jboss:domain:switchyard:1.0">
  <modules>
    <module identifier="org.switchyard.component.bean" implClass="org.switchyard.component.bean.deploy.BeanComponent"/>
    <module identifier="org.switchyard.component.soap" implClass="org.switchyard.component.soap.deploy.SOAPComponent">
    <!-- snip -->
  </modules>
  <extensions>
    <extension identifier="org.apache.camel.mvel"/>
    <extension identifier="org.apache.camel.ognl"/>
    <extension identifier="org.apache.camel.jaxb"/>
    <extension identifier="org.apache.camel.soap"/>
    <!-- adding mybinding -->
    <extension identifier="org.example.mybinding"/>
  </extensions>
</subsystem>

Add the extension definition will make the module visible to all SwitchYard deployments in the runtime.  

Using Extensions

How you use an extension in your application depends on the type of extension.

Camel DataFormat

Once a data format is packaged as a module and added as an extension to the SwitchYard subsystem, no further configuration is required in your application.  You can simply refer to the data format directly in your route as if it was packaged directly within your application.

Camel Gateway Components

If the extension is to be used as a gateway binding for services and/or references, then you will need to use the Camel URI binding in your application to configure the endpoint details.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 09:45:47 UTC, last content change 2013-11-06 22:04:58 UTC.