public abstract class AbstractMessageChannel extends ObjectSE implements MessageChannel, InterceptableChannel, BeanNameAware
MessageChannel
実装の抽象基本クラス。修飾子と型 | クラスと説明 |
---|---|
protected class | AbstractMessageChannel.ChannelInterceptorChain 構成されたチャネルインターセプターの呼び出しを支援します。 |
修飾子と型 | フィールドと説明 |
---|---|
protected Log | logger |
INDEFINITE_TIMEOUT
コンストラクターと説明 |
---|
AbstractMessageChannel() |
修飾子と型 | メソッドと説明 |
---|---|
void | addInterceptor(ChannelInterceptor interceptor) リストの最後にチャネルインターセプターを追加します。 |
void | addInterceptor(int index, ChannelInterceptor interceptor) 指定したインデックスにチャネルインターセプターを追加します。 |
StringSE | getBeanName() このメッセージチャネルの Bean 名を返します。 |
ListSE<ChannelInterceptor> | getInterceptors() 設定されたインターセプターのリストを返します。 |
Log | getLogger() 現在設定されているロガーを返します。 |
boolean | removeInterceptor(ChannelInterceptor interceptor) 指定されたインターセプターを削除します。 |
ChannelInterceptor | removeInterceptor(int index) 指定されたインデックスにあるインターセプターを削除します。 |
boolean | send(Message<?> message) Message をこのチャネルに送信します。 |
boolean | send(Message<?> message, long timeout) メッセージを送信し、メッセージが受け入れられるか、指定されたタイムアウト期間が経過するまでブロックします。 |
protected abstract boolean | sendInternal(Message<?> message, long timeout) |
void | setBeanName(StringSE name) メッセージチャネルは、主にロギング目的で Bean 名を使用します。 |
void | setInterceptors(ListSE<ChannelInterceptor> interceptors) 既存のインターセプターをクリアするチャネルインターセプターのリストを設定します。 |
void | setLogger(Log logger) クラス名に基づいたロガーよりも使用する代替ロガーを設定します。 |
StringSE | toString() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
protected Log logger
public void setLogger(Log logger)
logger
- 使用するロガー public Log getLogger()
public void setBeanName(StringSE name)
BeanNameAware
の setBeanName
name
- ファクトリ内の Bean の名前。この名前は、ファクトリで使用される実際の Bean 名であり、最初に指定した名前とは異なる場合があります。特に内部 Bean 名の場合、実際の Bean 名は "#..." サフィックスを追加することで一意になります。必要に応じて、BeanFactoryUtils.originalBeanName(String)
メソッドを使用して、元の Bean 名(サフィックスなし)を抽出します。public StringSE getBeanName()
public void setInterceptors(ListSE<ChannelInterceptor> interceptors)
InterceptableChannel
InterceptableChannel
の setInterceptors
public void addInterceptor(ChannelInterceptor interceptor)
InterceptableChannel
InterceptableChannel
の addInterceptor
public void addInterceptor(int index, ChannelInterceptor interceptor)
InterceptableChannel
InterceptableChannel
の addInterceptor
public ListSE<ChannelInterceptor> getInterceptors()
InterceptableChannel
InterceptableChannel
の getInterceptors
public boolean removeInterceptor(ChannelInterceptor interceptor)
InterceptableChannel
InterceptableChannel
の removeInterceptor
public ChannelInterceptor removeInterceptor(int index)
InterceptableChannel
InterceptableChannel
の removeInterceptor
public final boolean send(Message<?> message)
MessageChannel
Message
を送信します。メッセージが正常に送信されると、メソッドは true
を返します。致命的でない理由でメッセージを送信できない場合、メソッドは false
を返します。このメソッドは、回復不可能なエラーが発生した場合に RuntimeException をスローすることもあります。 このメソッドは、実装によっては無期限にブロックされる場合があります。最大待機時間を提供するには、MessageChannel.send(Message, long)
を使用します。
MessageChannel
の send
message
- 送信するメッセージ public final boolean send(Message<?> message, long timeout)
MessageChannel
MessageChannel
の send
message
- 送信するメッセージ timeout
- ミリ秒単位のタイムアウトまたは MessageChannel.INDEFINITE_TIMEOUT
true
、送信の割り込みのタイムアウトが含まれていない場合は false
protected abstract boolean sendInternal(Message<?> message, long timeout)
public StringSE toString()
ObjectSE
の toStringSE