|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (13)
View Page History* Splitter
h1. Component Extension
The component can be extended by any contributor to provide the support of new EIP pattern.
To add a new pattern, provide a Java class implementing the interface {{Pattern}} :
{code}
/**
* The pattern interface
*
* @author Adrien Louis
* @author Christophe Hamerling
* @author Frederic Gardes
*/
public interface Pattern {
/**
* Initialize the pattern
*
*/
void init();
/**
* Process the Pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
*/
boolean processPattern(Exchange exchange, ExchangeContext context);
/**
* Process an exchange for an asynchronous pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
* @param asyncContext
* The EIP asynchronous context
* @param expired
* true if the asynchronous exchange is expired, false else
*/
boolean processAsyncPattern(Exchange exchange, ExchangeContext context,
EIPAsyncContext asyncContext, boolean expired);
/**
* Get the pattern name.
*
* @return The name
*/
String getName();
}
{code}
\\
Use the {{ExchangeContext}} to interact with the container, during your pattern processing :
{code}
/**
* The exchange context.
*
* @author Adrien Louis
* @author Frederic Gardes
*/
public interface ExchangeContext {
/**
* Get the logger
*
* @return the logger
*/
public Logger getLogger();
/**
* get the Consumes for an endpoint
*
* @param endpoint
* The endpoint
* @return The Consumes of the endpoint
*/
public List<Consumes> getSUConsumes(ServiceEndpoint endpoint);
/**
* Send synchronously an exchange. The response will be provided into the
* same exchange
*
* @param exchange
* The exchange to send
* @return true if the exchange was sent, false else (reached timeout,
* technical error,...)
* @throws MessagingException
*/
public boolean sendSync(final Exchange exchange) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as an
* asynchronous exchange
*
* @param exchange
* The exchange to send
* @param asyncContext
* The asynchronous context, provided on the response
* @throws MessagingException
*/
public void sendAsync(final Exchange exchange, AsyncContext asyncContext) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as a
* synchronous exchange
*
* @param exchange
* The exchange to send
* @throws MessagingException
*/
public void send(final Exchange exchange) throws MessagingException;
/**
* Create an exchange from a Consumes
*
* @param consumes
* The Consumes used as JBI Consumer of the exchange
* @return The exchange created
* @throws MessagingException
* @throws PEtALSCDKException
*/
public Exchange createConsumeExchange(Consumes consumes) throws MessagingException, PEtALSCDKException;
/**
* Get the extensions
*
* @return The extensions
*/
public ConfigurationExtensions getExtensions();
}
{code}
\\
Extends the JBI.xml file of the component to reference your new pattern.
h1. Component Configuration
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi version="1.0"
xmlns="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:eip="http://petals.ow2.org/components/eip/version-2">
<component type="service-engine" component-class-loader-delegation="parent-first">
<identification>
<name>petals-se-eip</name>
<description>EIP Service engine</description>
</identification>
<component-class-name>org.ow2.petals.se.eip.EIPComponent</component-class-name>
<component-class-path>
<path-element />
</component-class-path>
<bootstrap-class-name>org.ow2.petals.component.framework.DefaultBootstrap</bootstrap-class-name>
<bootstrap-class-path>
<path-element></path-element>
</bootstrap-class-path>
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status>NOTHING_IGNORED</petalsCDK:ignored-status>
<petalsCDK:notifications>false</petalsCDK:notifications>
<petalsCDK:jbi-listener-class-name>
org.ow2.petals.se.eip.listener.JBIListener
</petalsCDK:jbilistener-class-name>
<petalsCDK:properties-file />
<!-- Declaring the supported patterns -->
<eip:aggregator>org.ow2.petals.se.eip.patterns.Aggregator</eip:aggregator>
<eip:router>org.ow2.petals.se.eip.patterns.Router</eip:router>
<eip:dynamic-router>org.ow2.petals.se.eip.patterns.DynamicRouter</eip:dynamic-router>
<eip:dispatcher>org.ow2.petals.se.eip.patterns.Dispatcher</eip:dispatcher>
<eip:routing-slip>org.ow2.petals.se.eip.patterns.RoutingSlip</eip:routing-slip>
<eip:bridge>org.ow2.petals.se.eip.patterns.Bridge</eip:bridge>
<eip:wire-tap>org.ow2.petals.se.eip.patterns.WireTap</eip:wire-tap>
<eip:scatter-gather>org.ow2.petals.se.eip.patterns.ScatterGather</eip:scatter-gather>
<eip:splitter>org.ow2.petals.se.eip.patterns.Splitter</eip:splitter>
</component>
</jbi>
{code}
{include:0 CDK Component Configuration Table 2.1}
\\
{center}*Configuration of the component (EIP)*{center}
{table-plus}
|| Parameter || Description || Default || Required ||
| your-pattern-name | Name of the java class implementing your pattern. The name of the pattern at runtime will be the one you give as parameter name | {center}-{center} | {center}No{center} |
{table-plus}
{include:0 CDK Component Interceptor configuration}
The component can be extended by any contributor to provide the support of new EIP pattern.
To add a new pattern, provide a Java class implementing the interface {{Pattern}} :
{code}
/**
* The pattern interface
*
* @author Adrien Louis
* @author Christophe Hamerling
* @author Frederic Gardes
*/
public interface Pattern {
/**
* Initialize the pattern
*
*/
void init();
/**
* Process the Pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
*/
boolean processPattern(Exchange exchange, ExchangeContext context);
/**
* Process an exchange for an asynchronous pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
* @param asyncContext
* The EIP asynchronous context
* @param expired
* true if the asynchronous exchange is expired, false else
*/
boolean processAsyncPattern(Exchange exchange, ExchangeContext context,
EIPAsyncContext asyncContext, boolean expired);
/**
* Get the pattern name.
*
* @return The name
*/
String getName();
}
{code}
\\
Use the {{ExchangeContext}} to interact with the container, during your pattern processing :
{code}
/**
* The exchange context.
*
* @author Adrien Louis
* @author Frederic Gardes
*/
public interface ExchangeContext {
/**
* Get the logger
*
* @return the logger
*/
public Logger getLogger();
/**
* get the Consumes for an endpoint
*
* @param endpoint
* The endpoint
* @return The Consumes of the endpoint
*/
public List<Consumes> getSUConsumes(ServiceEndpoint endpoint);
/**
* Send synchronously an exchange. The response will be provided into the
* same exchange
*
* @param exchange
* The exchange to send
* @return true if the exchange was sent, false else (reached timeout,
* technical error,...)
* @throws MessagingException
*/
public boolean sendSync(final Exchange exchange) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as an
* asynchronous exchange
*
* @param exchange
* The exchange to send
* @param asyncContext
* The asynchronous context, provided on the response
* @throws MessagingException
*/
public void sendAsync(final Exchange exchange, AsyncContext asyncContext) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as a
* synchronous exchange
*
* @param exchange
* The exchange to send
* @throws MessagingException
*/
public void send(final Exchange exchange) throws MessagingException;
/**
* Create an exchange from a Consumes
*
* @param consumes
* The Consumes used as JBI Consumer of the exchange
* @return The exchange created
* @throws MessagingException
* @throws PEtALSCDKException
*/
public Exchange createConsumeExchange(Consumes consumes) throws MessagingException, PEtALSCDKException;
/**
* Get the extensions
*
* @return The extensions
*/
public ConfigurationExtensions getExtensions();
}
{code}
\\
Extends the JBI.xml file of the component to reference your new pattern.
h1. Component Configuration
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi version="1.0"
xmlns="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:eip="http://petals.ow2.org/components/eip/version-2">
<component type="service-engine" component-class-loader-delegation="parent-first">
<identification>
<name>petals-se-eip</name>
<description>EIP Service engine</description>
</identification>
<component-class-name>org.ow2.petals.se.eip.EIPComponent</component-class-name>
<component-class-path>
<path-element />
</component-class-path>
<bootstrap-class-name>org.ow2.petals.component.framework.DefaultBootstrap</bootstrap-class-name>
<bootstrap-class-path>
<path-element></path-element>
</bootstrap-class-path>
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status>NOTHING_IGNORED</petalsCDK:ignored-status>
<petalsCDK:notifications>false</petalsCDK:notifications>
<petalsCDK:jbi-listener-class-name>
org.ow2.petals.se.eip.listener.JBIListener
</petalsCDK:jbilistener-class-name>
<petalsCDK:properties-file />
<!-- Declaring the supported patterns -->
<eip:aggregator>org.ow2.petals.se.eip.patterns.Aggregator</eip:aggregator>
<eip:router>org.ow2.petals.se.eip.patterns.Router</eip:router>
<eip:dynamic-router>org.ow2.petals.se.eip.patterns.DynamicRouter</eip:dynamic-router>
<eip:dispatcher>org.ow2.petals.se.eip.patterns.Dispatcher</eip:dispatcher>
<eip:routing-slip>org.ow2.petals.se.eip.patterns.RoutingSlip</eip:routing-slip>
<eip:bridge>org.ow2.petals.se.eip.patterns.Bridge</eip:bridge>
<eip:wire-tap>org.ow2.petals.se.eip.patterns.WireTap</eip:wire-tap>
<eip:scatter-gather>org.ow2.petals.se.eip.patterns.ScatterGather</eip:scatter-gather>
<eip:splitter>org.ow2.petals.se.eip.patterns.Splitter</eip:splitter>
</component>
</jbi>
{code}
{include:0 CDK Component Configuration Table 2.1}
\\
{center}*Configuration of the component (EIP)*{center}
{table-plus}
|| Parameter || Description || Default || Required ||
| your-pattern-name | Name of the java class implementing your pattern. The name of the pattern at runtime will be the one you give as parameter name | {center}-{center} | {center}No{center} |
{table-plus}
{include:0 CDK Component Interceptor configuration}
h1. Service Configuration
{code}
{include:0 CDK Description of provide}
0 JBI SU Consume Configuration
0 JBI SU Consume Configuration
{include:0 CDK SU Provide Configuration}
{include:0 JBI SU Consume Configuration}
{include:0 JBI SU Consume Configuration}
h2. Processing a pattern
{table-plus}
|| Parameter || Description || Default || Required by pattern ||
| eip | The name of the pattern to execute : {{aggregator}} | \- | All |
| eip | The name of the pattern to execute : {{aggregator}} | \- | All |
|| Parameter || Description || Default || Required by pattern ||
| eip | The name of the pattern to execute : {{scatter-gather}} | \- | All |
| eip | The name of the pattern to execute : {{scatter-gather}} | \- | All |
|| Parameter || Description \\ || Default \\ || Required by pattern \\ ||
| eip | The name of the pattern to execute : {{routing-slip}}. \\ | \- | all |
| eip | The name of the pattern to execute : {{routing-slip}}. \\ | \- | all |
|| Parameter || Description \\ || Default \\ || Required by pattern \\ ||
| eip | The name of the pattern to execute : {{wire-tap}} \\ | \- | All |
| eip | The name of the pattern to execute : {{wire-tap}} \\ | \- | All |
|| Parameter \\ || Description \\ || Default \\ || ||
| eip \\ | The name of the pattern to execute : {{splitter}} \\ | \- | All |
| eip \\ | The name of the pattern to execute : {{splitter}} \\ | \- | All |
|| Parameter \\ || Description \\ || Default \\ || Required by pattern \\ ||
| eip \\ | The name of the pattern to execute: {{bridge}} \\ | \- | All |
| eip \\ | The name of the pattern to execute: {{bridge}} \\ | \- | All |
|| Parameter \\ || Description \\ || Default \\ || Required by pattern \\ ||
| eip | The name of the pattern to execute : {{router}} \\ | \- | All |
| eip | The name of the pattern to execute : {{router}} \\ | \- | All |
|| Parameter || Description || Default || Required by pattern ||
| eip | The name of the pattern to execute : {{dynamic-router}} | \- | All |
| eip | The name of the pattern to execute : {{dynamic-router}} | \- | All |
|| Parameter || Description || Default || Required by pattern ||
| eip | The name of the pattern to execute : {{dispatcher}}. | \- \\ | All |
| eip | The name of the pattern to execute : {{dispatcher}}. | \- \\ | All |
{note:title=Caution}{{{}consumes}} sections cardinality is [1-n|1-n].{note}
{note:title=Caution}message exchange pattern of the incoming exchange and the consumed services is {{InOnly}}.{note}
{note:title=Caution}message exchange pattern of the incoming exchange and the consumed services is {{InOnly}}.{note}
h1. Component Extension
The component can be extended by any contributor to provide the support of new EIP pattern.
To add a new pattern, provide a Java class implementing the interface {{Pattern}} :
{code}
/**
* The pattern interface
*
* @author Adrien Louis
* @author Christophe Hamerling
* @author Frederic Gardes
*/
public interface Pattern {
/**
* Initialize the pattern
*
*/
void init();
/**
* Process the Pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
*/
boolean processPattern(Exchange exchange, ExchangeContext context);
/**
* Process an exchange for an asynchronous pattern.
*
* @param exchange
* The exchange to process
* @param context
* The context of the exchange
* @param asyncContext
* The EIP asynchronous context
* @param expired
* true if the asynchronous exchange is expired, false else
*/
boolean processAsyncPattern(Exchange exchange, ExchangeContext context,
EIPAsyncContext asyncContext, boolean expired);
/**
* Get the pattern name.
*
* @return The name
*/
String getName();
}
{code}
\\
Use the {{ExchangeContext}} to interact with the container, during your pattern processing :
{code}
/**
* The exchange context.
*
* @author Adrien Louis
* @author Frederic Gardes
*/
public interface ExchangeContext {
/**
* Get the logger
*
* @return the logger
*/
public Logger getLogger();
/**
* get the Consumes for an endpoint
*
* @param endpoint
* The endpoint
* @return The Consumes of the endpoint
*/
public List<Consumes> getSUConsumes(ServiceEndpoint endpoint);
/**
* Send synchronously an exchange. The response will be provided into the
* same exchange
*
* @param exchange
* The exchange to send
* @return true if the exchange was sent, false else (reached timeout,
* technical error,...)
* @throws MessagingException
*/
public boolean sendSync(final Exchange exchange) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as an
* asynchronous exchange
*
* @param exchange
* The exchange to send
* @param asyncContext
* The asynchronous context, provided on the response
* @throws MessagingException
*/
public void sendAsync(final Exchange exchange, AsyncContext asyncContext) throws MessagingException;
/**
* Send asynchronously an exchange. The response will be provided as a
* synchronous exchange
*
* @param exchange
* The exchange to send
* @throws MessagingException
*/
public void send(final Exchange exchange) throws MessagingException;
/**
* Create an exchange from a Consumes
*
* @param consumes
* The Consumes used as JBI Consumer of the exchange
* @return The exchange created
* @throws MessagingException
* @throws PEtALSCDKException
*/
public Exchange createConsumeExchange(Consumes consumes) throws MessagingException, PEtALSCDKException;
/**
* Get the extensions
*
* @return The extensions
*/
public ConfigurationExtensions getExtensions();
}
{code}
\\
Extends the JBI.xml file of the component to reference your new pattern.
h1. Component Configuration
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<jbi version="1.0"
xmlns="http://java.sun.com/xml/ns/jbi"
xmlns:petalsCDK="http://petals.ow2.org/components/extensions/version-5"
xmlns:eip="http://petals.ow2.org/components/eip/version-2">
<component type="service-engine" component-class-loader-delegation="parent-first">
<identification>
<name>petals-se-eip</name>
<description>EIP Service engine</description>
</identification>
<component-class-name>org.ow2.petals.se.eip.EIPComponent</component-class-name>
<component-class-path>
<path-element />
</component-class-path>
<bootstrap-class-name>org.ow2.petals.component.framework.DefaultBootstrap</bootstrap-class-name>
<bootstrap-class-path>
<path-element></path-element>
</bootstrap-class-path>
<petalsCDK:acceptor-pool-size>5</petalsCDK:acceptor-pool-size>
<petalsCDK:processor-pool-size>10</petalsCDK:processor-pool-size>
<petalsCDK:ignored-status>NOTHING_IGNORED</petalsCDK:ignored-status>
<petalsCDK:notifications>false</petalsCDK:notifications>
<petalsCDK:jbi-listener-class-name>
org.ow2.petals.se.eip.listener.JBIListener
</petalsCDK:jbilistener-class-name>
<petalsCDK:properties-file />
<!-- Declaring the supported patterns -->
<eip:aggregator>org.ow2.petals.se.eip.patterns.Aggregator</eip:aggregator>
<eip:router>org.ow2.petals.se.eip.patterns.Router</eip:router>
<eip:dynamic-router>org.ow2.petals.se.eip.patterns.DynamicRouter</eip:dynamic-router>
<eip:dispatcher>org.ow2.petals.se.eip.patterns.Dispatcher</eip:dispatcher>
<eip:routing-slip>org.ow2.petals.se.eip.patterns.RoutingSlip</eip:routing-slip>
<eip:bridge>org.ow2.petals.se.eip.patterns.Bridge</eip:bridge>
<eip:wire-tap>org.ow2.petals.se.eip.patterns.WireTap</eip:wire-tap>
<eip:scatter-gather>org.ow2.petals.se.eip.patterns.ScatterGather</eip:scatter-gather>
<eip:splitter>org.ow2.petals.se.eip.patterns.Splitter</eip:splitter>
</component>
</jbi>
{code}
{include:0 CDK Component Configuration Table 2.1}
\\
{center}{*}Configuration of the component (EIP)*{center}
{table-plus}
|| Parameter || Description || Default || Required ||
| your-pattern-name | Name of the java class implementing your pattern. The name of the pattern at runtime will be the one you give as parameter name | {center}\-{center} | {center}No{center} |
{table-plus}
{include:0 CDK Component Interceptor configuration}
{column}
{column:width=350px}
{column:width=350px}