public class BlockingChannelLifecycleStrategy extends DefaultChannelLifecycleStrategy
Functionally it is equivalent to DefaultChannelLifecycleStrategy; however each channel operation is performed in its own Thread which is named after the Channel's unique id. It may be of use for logging purposes when attempting to start (or stop) many channels.
In the adapter configuration file this class is aliased as blocking-channel-lifecycle-strategy which is the preferred alternative to the fully qualified classname when building your configuration.
log
Constructor and Description |
---|
BlockingChannelLifecycleStrategy() |
BlockingChannelLifecycleStrategy(TimeInterval t) |
Modifier and Type | Method and Description |
---|---|
void |
close(java.util.List<Channel> channels)
Close a list of channels.
|
TimeInterval |
getTimeout() |
void |
init(java.util.List<Channel> channels)
Initialise a list of channels.
|
void |
setTimeout(TimeInterval timeout)
Set the timeout for a channel operation.
|
void |
start(java.util.List<Channel> channels)
Start a list of channels.
|
void |
stop(java.util.List<Channel> channels)
Stop a list of channels.
|
public BlockingChannelLifecycleStrategy()
public BlockingChannelLifecycleStrategy(TimeInterval t)
public void init(java.util.List<Channel> channels) throws CoreException
ChannelLifecycleStrategy
init
in interface ChannelLifecycleStrategy
init
in class DefaultChannelLifecycleStrategy
channels
- a list of channels that require initialising.CoreException
- wrapping any underlying exception.ChannelLifecycleStrategy.init(java.util.List)
public void start(java.util.List<Channel> channels) throws CoreException
ChannelLifecycleStrategy
start
in interface ChannelLifecycleStrategy
start
in class DefaultChannelLifecycleStrategy
channels
- a list of channels that have already been initialised.CoreException
- wrapping any underlying exception.ChannelLifecycleStrategy.start(java.util.List)
public void stop(java.util.List<Channel> channels)
ChannelLifecycleStrategy
stop
in interface ChannelLifecycleStrategy
stop
in class DefaultChannelLifecycleStrategy
channels
- a list of channels that have previously been started.ChannelLifecycleStrategy.stop(java.util.List)
public void close(java.util.List<Channel> channels)
ChannelLifecycleStrategy
close
in interface ChannelLifecycleStrategy
close
in class DefaultChannelLifecycleStrategy
channels
- a list of channels.ChannelLifecycleStrategy.close(java.util.List)
public TimeInterval getTimeout()
public void setTimeout(TimeInterval timeout)
timeout
- the timeout.