|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.channel.AbstractMessageChannel
public abstract class AbstractMessageChannel
Base class for MessageChannel
implementations providing common
properties such as the channel name. Also provides the common functionality
for sending and receiving Messages
including the invocation
of any ChannelInterceptors
.
Nested Class Summary | |
---|---|
protected class |
AbstractMessageChannel.ChannelInterceptorList
A convenience wrapper class for the list of ChannelInterceptors. |
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
AbstractMessageChannel()
|
Method Summary | |
---|---|
void |
addInterceptor(ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list. |
protected abstract boolean |
doSend(Message<?> message,
long timeout)
Subclasses must implement this method. |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information. |
protected AbstractMessageChannel.ChannelInterceptorList |
getInterceptors()
Exposes the interceptor list for subclasses. |
boolean |
send(Message<?> message)
Send a message on this channel. |
boolean |
send(Message<?> message,
long timeout)
Send a message on this channel. |
void |
setConversionService(org.springframework.core.convert.ConversionService conversionService)
Specify the ConversionService to use when trying to convert to
one of this channel's supported datatypes for a Message whose payload
does not already match. |
void |
setDatatypes(java.lang.Class<?>... datatypes)
Specify the Message payload datatype(s) supported by this channel. |
void |
setInterceptors(java.util.List<ChannelInterceptor> interceptors)
Set the list of channel interceptors. |
void |
setShouldTrack(boolean shouldTrack)
|
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
---|
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.integration.context.NamedComponent |
---|
getComponentName |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public AbstractMessageChannel()
Method Detail |
---|
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
public void setShouldTrack(boolean shouldTrack)
setShouldTrack
in interface TrackableComponent
public void setDatatypes(java.lang.Class<?>... datatypes)
If this property is not set explicitly, any Message payload type will be accepted.
setConversionService(ConversionService)
public void setInterceptors(java.util.List<ChannelInterceptor> interceptors)
public void addInterceptor(ChannelInterceptor interceptor)
public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
ConversionService
to use when trying to convert to
one of this channel's supported datatypes for a Message whose payload
does not already match. If this property is not set explicitly but
the channel is managed within a context, it will attempt to locate a
bean named "integrationConversionService" defined within that context.
Finally, if that bean is not available, it will fallback to the
"conversionService" bean, if available.
setConversionService
in class IntegrationObjectSupport
protected AbstractMessageChannel.ChannelInterceptorList getInterceptors()
public final boolean send(Message<?> message)
send
in interface MessageChannel
message
- the Message to send
true
if the message is sent successfully or
false
if the sending thread is interrupted.public final boolean send(Message<?> message, long timeout)
send(Message)
).
send
in interface MessageChannel
message
- the Message to sendtimeout
- the timeout in milliseconds
true
if the message is sent successfully,
false
if the message cannot be sent within the allotted
time or the sending thread is interrupted.protected abstract boolean doSend(Message<?> message, long timeout)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |