|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.channel.AbstractMessageChannel
public abstract class AbstractMessageChannel
Base class for MessageChannel implementations providing common
properties such as the channel name and DispatcherPolicy. Also
provides the common functionality for sending and receiving
Messages including the invocation of any
ChannelInterceptors.
| Nested Class Summary | |
|---|---|
private class |
AbstractMessageChannel.ChannelInterceptorList
A convenience wrapper class for the list of ChannelInterceptors. |
| Field Summary | |
|---|---|
private AbstractMessageChannel.ChannelInterceptorList |
interceptors
|
private org.apache.commons.logging.Log |
logger
|
private java.lang.String |
name
|
| Constructor Summary | |
|---|---|
AbstractMessageChannel()
|
|
| Method Summary | |
|---|---|
void |
addInterceptor(ChannelInterceptor interceptor)
Add a channel interceptor to the end of the list. |
protected abstract Message<?> |
doReceive(long timeout)
Subclasses must implement this method. |
protected abstract boolean |
doSend(Message<?> message,
long timeout)
Subclasses must implement this method. |
java.lang.String |
getName()
Return the name of this channel. |
Message<?> |
receive()
Receive the first available message from this channel. |
Message<?> |
receive(long timeout)
Receive the first available message from 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 |
setBeanName(java.lang.String beanName)
Set the name of this channel to its bean name. |
void |
setInterceptors(java.util.List<ChannelInterceptor> interceptors)
Set the list of channel interceptors. |
void |
setName(java.lang.String name)
Set the name of this channel. |
java.lang.String |
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.channel.MessageChannel |
|---|
clear, purge |
| Field Detail |
|---|
private final org.apache.commons.logging.Log logger
private volatile java.lang.String name
private final AbstractMessageChannel.ChannelInterceptorList interceptors
| Constructor Detail |
|---|
public AbstractMessageChannel()
| Method Detail |
|---|
public void setName(java.lang.String name)
setName in interface MessageChannelpublic java.lang.String getName()
getName in interface MessageChannelpublic void setBeanName(java.lang.String beanName)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic void setInterceptors(java.util.List<ChannelInterceptor> interceptors)
public void addInterceptor(ChannelInterceptor interceptor)
public final boolean send(Message<?> message)
send in interface BlockingTargetsend in interface MessageTargetmessage - 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 BlockingTargetmessage - 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 final Message<?> receive()
receive in interface BlockingSourcereceive in interface MessageSourcenull if the
receiving thread is interrupted.public final Message<?> receive(long timeout)
receive()).
receive in interface BlockingSourcetimeout - the timeout in milliseconds
null if no message
is available within the allotted time or the receiving thread is
interrupted.public java.lang.String toString()
toString in class java.lang.Object
protected abstract boolean doSend(Message<?> message,
long timeout)
protected abstract Message<?> doReceive(long timeout)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||