public class LocalChannelRegistry extends java.lang.Object implements ChannelRegistry, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
ChannelRegistry
for in-process use. For inbound and
outbound, creates a DirectChannel
and bridges the passed
MessageChannel
to the channel which is registered in the given application
context. If that channel does not yet exist, it will be created. For tap, it adds a
WireTap
for an inbound channel whose name matches the one provided. If no such
inbound channel exists at the time of the method invocation, it will throw an
Exception. Otherwise the provided channel instance will receive messages from the wire
tap on that inbound channel.Constructor and Description |
---|
LocalChannelRegistry() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.integration.core.SubscribableChannel from,
org.springframework.integration.MessageChannel to,
java.lang.String bridgeName) |
protected org.springframework.integration.handler.BridgeHandler |
bridge(org.springframework.integration.core.SubscribableChannel from,
org.springframework.integration.MessageChannel to,
java.lang.String bridgeName,
java.lang.String tapModule) |
void |
cleanAll(java.lang.String name)
Remove all subscriptions to inter-module channels for this module
and stop any active components that use those channels.
|
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> |
createSharedChannel(java.lang.String name,
java.lang.Class<T> requiredType) |
void |
inbound(java.lang.String name,
org.springframework.integration.MessageChannel channel)
Looks up or creates a DirectChannel with the given name and creates a bridge from
that channel to the provided channel instance.
|
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> |
lookupOrCreateSharedChannel(java.lang.String name,
java.lang.Class<T> requiredType) |
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> |
lookupSharedChannel(java.lang.String name,
java.lang.Class<T> requiredType) |
void |
outbound(java.lang.String name,
org.springframework.integration.MessageChannel channel)
Looks up or creates a DirectChannel with the given name and creates a bridge to
that channel from the provided channel instance.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
tap(java.lang.String tapModule,
java.lang.String name,
org.springframework.integration.MessageChannel channel)
Looks up a wiretap for the inbound channel with the given name and creates a
bridge from that wiretap's output channel to the provided channel instance.
|
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
public void inbound(java.lang.String name, org.springframework.integration.MessageChannel channel)
inbound
in interface ChannelRegistry
name
- the logical identity of the message sourcechannel
- the channel bound as a consumerpublic void outbound(java.lang.String name, org.springframework.integration.MessageChannel channel)
outbound
in interface ChannelRegistry
name
- the logical identity of the message targetchannel
- the channel bound as a producerpublic void tap(java.lang.String tapModule, java.lang.String name, org.springframework.integration.MessageChannel channel)
tap
in interface ChannelRegistry
tapModule
- the name of the tap modulename
- the registered namechannel
- the channel that will receive messages from the tappublic void cleanAll(java.lang.String name)
ChannelRegistry
cleanAll
in interface ChannelRegistry
name
- the module nameprotected <T extends org.springframework.integration.channel.AbstractMessageChannel> T lookupOrCreateSharedChannel(java.lang.String name, java.lang.Class<T> requiredType)
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> T lookupSharedChannel(java.lang.String name, java.lang.Class<T> requiredType)
protected <T extends org.springframework.integration.channel.AbstractMessageChannel> T createSharedChannel(java.lang.String name, java.lang.Class<T> requiredType)
protected org.springframework.integration.handler.BridgeHandler bridge(org.springframework.integration.core.SubscribableChannel from, org.springframework.integration.MessageChannel to, java.lang.String bridgeName)
protected org.springframework.integration.handler.BridgeHandler bridge(org.springframework.integration.core.SubscribableChannel from, org.springframework.integration.MessageChannel to, java.lang.String bridgeName, java.lang.String tapModule)