public interface ChainManagerHost
Modifier and Type | Method and Description |
---|---|
void |
addChannelLifecycleListener(ChannelLifecycleListener listener,
java.lang.String channelPrefix)
Register a listener to get a callback when interested channel is created/destroyed.
|
Chain |
createChain(java.lang.String chainInstanceIdSuffix,
ChainDefinition dynamicChainDefinition,
java.util.Map<java.lang.String,java.lang.String> substitutions,
java.lang.String defaultChannelTowardsHost,
java.util.List<java.lang.String> subscribeChannels)
Create a new instance of a dynamic chain.
|
Chain createChain(java.lang.String chainInstanceIdSuffix, ChainDefinition dynamicChainDefinition, java.util.Map<java.lang.String,java.lang.String> substitutions, java.lang.String defaultChannelTowardsHost, java.util.List<java.lang.String> subscribeChannels) throws java.lang.Exception
Will not return until chain creation has completed and therefore may block.
Messages will not be sent or received until start() has been called on the returned chain. You may not call createChain from a manager or chain whose shutdown() methods have returned (will throw an exception). Managers may call createChain and destroy from multiple threads simultaneously.
Typical usage is to use Chain.getTransport()
to initialize any transport-specific configuration on the
newly created instance, and then call Chain.start()
.
chainInstanceIdSuffix
- A string identifier which will be suffixed onto "managerName-" to uniquely
identify the new chain instance.
Caution: A small amount of memory is allocated for each unique chain instance identifier. This memory is not freed
when the chain is destroyed. Therefore, if you are creating many chains, consider reusing old chain instance identifiers.
If you create more than 1000 unique identifiers, a warning is written to the correlator log file to notify you of this. You
cannot have two active chains with the same chain instance identifier, so only reuse identifiers which are no longer in use.dynamicChainDefinition
- The definition of the chain to create. This should usually be one of the chain
definitions passed to the manager in the ChainManagerConstructorParameters
, usually using the
AbstractChainManager.getChainDefinition()
or AbstractChainManager.getChainDefinition(String)
helper
methods. Not null.substitutions
- Map of key/value pairs to be replaced in the chain definition using @{KEY} tags.
null is treated the same as an empty map.defaultChannelTowardsHost
- Default channel to use for sending a message towards the host if no channel is
specified on the message; use null or empty string for no default. It is an error to specify non-empty defaultChannelTowardsHost
value if defaultChannel is also specified for the host plug-in.subscribeChannels
- The set of channels that the chain should be subscribed to (for messages from the host to the transport).
null is treated the same as an empty list.
Note that any value specified for this in the host configuration is ignored when this method is used to create a chain.java.lang.Exception
- if the chain definition is invalid, or if any of the plug-in constructors on the chain to be
created throw an exception.void addChannelLifecycleListener(ChannelLifecycleListener listener, java.lang.String channelPrefix)
Calling this method from a manager whose shutdown() method has returned will throw an exception. This method is thread safe and may be called from multiple threads simultaneously.
The call to addChannelLifecycleListener is blocked until listener is immediately notified of all the channels already created matching the channelPrefix in the same thread which calls addChannelLifecycleListener.
listener
- The listener which will get the notification when a channel starting with the channelPrefix is created or destroyed.
It is an error to pass null.channelPrefix
- The channel prefix for which listener should get callback.
Specify an empty string to get notifications for all channels.
It is an error to pass null.AbstractChainManager
Submit a bug or feature
Copyright (c) 2013-2018 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.