|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object 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. |
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. |
protected AbstractMessageChannel.ChannelInterceptorList |
getInterceptors()
Exposes the interceptor list for subclasses. |
java.lang.String |
getName()
Return the name of this channel. |
boolean |
send(Message<?> message)
Send a message on this channel. |
boolean |
send(Message<?> message,
long timeout)
Send a message on this channel. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
|
void |
setBeanName(java.lang.String name)
Set the name of 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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractMessageChannel()
Method Detail |
---|
public void setBeanName(java.lang.String name)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public java.lang.String getName()
getName
in interface MessageChannel
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 fallback to a bean
named "conversionService" defined within that context.
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
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.public java.lang.String toString()
toString
in class java.lang.Object
protected abstract boolean doSend(Message<?> message, long timeout)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |