...
Implementing an Executor Bus Processor Factory
The processor bus factory returns instances of a processor for use by the executor bus. The executor bus will create a processor when the bus is created. In an AepEngine this will be when an engine is activated.
Code Block | ||
---|---|---|
| ||
/** * Factory for creating EmailGatewayProcessors */ public class EmailGatewayProcessorFactory extends AbstractExecutorBusProcessorFactory { private static volatile EmailGatewayProcessor emailGatewayProcessor; /* (non-Javadoc) * @see com.neeve.sma.spi.executor.AbstractExecutorBusProcessorFactory#createExecutorBusProcessor(com.neeve.sma.MessageBusBinding) */ @Override public ExecutorBusProcessor createExecutorBusProcessor(MessageBusBinding binding) { return emailGatewayProcessornew EmailGatewayProcessor(); } /** * Registers the tibco send processor. * * @param tibcoSendProcessor The tibco send processor. */ public static void register(SolaceToRvBridge tibcoSendProcessor) { PumaExecutorBusProcessorProvider.tibcoSendProcessor = tibcoSendProcessor; } }} |
Tip | ||
---|---|---|
| ||
If the class implementing ExecutorBusProcessor is a class created through a DI framework or if it needs access to other objects in your application and thus needs to be wired up before bus configurattion, consider registering the instance of your process as either a static variable in the bus processor factory. If you have multiple processor instances you can store them in a static map and use the bus binding descriptor to determine which instance to return. Some binding configuration that is useful in this regard includes:
|
Example: Creating an E-mail Alert Gateway
...