public class DefaultHeaderChannelRegistry extends IntegrationObjectSupport implements HeaderChannelRegistry, org.springframework.context.SmartLifecycle, java.lang.Runnable
BeanFactoryChannelResolver to find the channel by name
in the event that the flow serialized the message at some point.
Channels are expired after a configurable delay (60 seconds by default).
The actual average expiry time will be 1.5x the delay.logger| Constructor and Description |
|---|
DefaultHeaderChannelRegistry()
Constructs a registry with the default delay for channel expiry.
|
DefaultHeaderChannelRegistry(long reaperDelay)
Constructs a registry with the provided delay (milliseconds) for
channel expiry.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.messaging.MessageChannel |
channelNameToChannel(java.lang.String name)
Converts the channel name back to a
MessageChannel (if it is
registered). |
java.lang.Object |
channelToChannelName(java.lang.Object channel)
Converts the channel to a name (String).
|
int |
getPhase()
Deprecated.
- this class will not implement
SmartLifecycle in 4.2, just Lifecycle. |
long |
getReaperDelay() |
boolean |
isAutoStartup()
Deprecated.
- this class will not implement
SmartLifecycle in 4.2, just Lifecycle. |
boolean |
isRunning() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
run() |
void |
runReaper()
Cancel the scheduled reap task and run immediately; then reschedule.
|
void |
setAutoStartup(boolean autoStartup)
Deprecated.
- this class will not implement
SmartLifecycle in 4.2, just Lifecycle. |
void |
setPhase(int phase)
Deprecated.
- this class will not implement
SmartLifecycle in 4.2, just Lifecycle. |
void |
setReaperDelay(long reaperDelay)
Set the reaper delay.
|
void |
setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler) |
int |
size() |
void |
start() |
void |
stop() |
void |
stop(java.lang.Runnable callback) |
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getComponentType, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, toStringpublic DefaultHeaderChannelRegistry()
public DefaultHeaderChannelRegistry(long reaperDelay)
reaperDelay - the delay in milliseconds.public final void setReaperDelay(long reaperDelay)
reaperDelay - the delay in milliseconds.public final long getReaperDelay()
public void setTaskScheduler(org.springframework.scheduling.TaskScheduler taskScheduler)
setTaskScheduler in class IntegrationObjectSupport@Deprecated public int getPhase()
SmartLifecycle in 4.2, just Lifecycle.getPhase in interface org.springframework.context.Phased@Deprecated public final void setPhase(int phase)
SmartLifecycle in 4.2, just Lifecycle.@Deprecated public boolean isAutoStartup()
SmartLifecycle in 4.2, just Lifecycle.isAutoStartup in interface org.springframework.context.SmartLifecycle@Deprecated public final void setAutoStartup(boolean autoStartup)
SmartLifecycle in 4.2, just Lifecycle.public final int size()
size in interface HeaderChannelRegistryprotected void onInit()
throws java.lang.Exception
IntegrationObjectSupportonInit in class IntegrationObjectSupportjava.lang.Exception - Any exception.public void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic void stop(java.lang.Runnable callback)
stop in interface org.springframework.context.SmartLifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecyclepublic java.lang.Object channelToChannelName(java.lang.Object channel)
HeaderChannelRegistryMessageChannel, it is returned unchanged.channelToChannelName in interface HeaderChannelRegistrychannel - The channel.public org.springframework.messaging.MessageChannel channelNameToChannel(java.lang.String name)
HeaderChannelRegistryMessageChannel (if it is
registered).channelNameToChannel in interface HeaderChannelRegistryname - The name of the channel.public void runReaper()
runReaper in interface HeaderChannelRegistrypublic void run()
run in interface java.lang.Runnable