Package com.adaptris.core.lifecycle
Class BlockingChannelLifecycleStrategy
- java.lang.Object
-
- com.adaptris.core.DefaultChannelLifecycleStrategy
-
- com.adaptris.core.lifecycle.BlockingChannelLifecycleStrategy
-
- All Implemented Interfaces:
ChannelLifecycleStrategy
public class BlockingChannelLifecycleStrategy extends DefaultChannelLifecycleStrategy
Blocking strategy for starting channels.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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.DefaultChannelLifecycleStrategy
log
-
-
Constructor Summary
Constructors Constructor Description BlockingChannelLifecycleStrategy()
BlockingChannelLifecycleStrategy(TimeInterval t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Constructor Detail
-
BlockingChannelLifecycleStrategy
public BlockingChannelLifecycleStrategy()
-
BlockingChannelLifecycleStrategy
public BlockingChannelLifecycleStrategy(TimeInterval t)
-
-
Method Detail
-
init
public void init(java.util.List<Channel> channels) throws CoreException
Description copied from interface:ChannelLifecycleStrategy
Initialise a list of channels.- Specified by:
init
in interfaceChannelLifecycleStrategy
- Overrides:
init
in classDefaultChannelLifecycleStrategy
- Parameters:
channels
- a list of channels that require initialising.- Throws:
CoreException
- wrapping any underlying exception.- See Also:
ChannelLifecycleStrategy.init(java.util.List)
-
start
public void start(java.util.List<Channel> channels) throws CoreException
Description copied from interface:ChannelLifecycleStrategy
Start a list of channels.- Specified by:
start
in interfaceChannelLifecycleStrategy
- Overrides:
start
in classDefaultChannelLifecycleStrategy
- Parameters:
channels
- a list of channels that have already been initialised.- Throws:
CoreException
- wrapping any underlying exception.- See Also:
ChannelLifecycleStrategy.start(java.util.List)
-
stop
public void stop(java.util.List<Channel> channels)
Description copied from interface:ChannelLifecycleStrategy
Stop a list of channels.- Specified by:
stop
in interfaceChannelLifecycleStrategy
- Overrides:
stop
in classDefaultChannelLifecycleStrategy
- Parameters:
channels
- a list of channels that have previously been started.- See Also:
ChannelLifecycleStrategy.stop(java.util.List)
-
close
public void close(java.util.List<Channel> channels)
Description copied from interface:ChannelLifecycleStrategy
Close a list of channels.- Specified by:
close
in interfaceChannelLifecycleStrategy
- Overrides:
close
in classDefaultChannelLifecycleStrategy
- Parameters:
channels
- a list of channels.- See Also:
ChannelLifecycleStrategy.close(java.util.List)
-
getTimeout
public TimeInterval getTimeout()
-
setTimeout
public void setTimeout(TimeInterval timeout)
Set the timeout for a channel operation.- Parameters:
timeout
- the timeout.
-
-