クラス AbstractPollableChannel

実装されているすべてのインターフェース:
AwareBeanFactoryAwareBeanNameAwareDisposableBeanInitializingBeanApplicationContextAwareExecutorChannelInterceptorAwareComponentSourceAwareExpressionCapableIntegrationPatternNamedComponentIntegrationManagementTrackableComponentMessageChannelPollableChannelInterceptableChannel
既知の直属サブクラス
QueueChannel

public abstract class AbstractPollableChannel extends AbstractMessageChannel implements PollableChannel, ExecutorChannelInterceptorAware
すべてのポーリング可能なチャネルの基本クラス。
作成者:
Mark Fisher, Artem Bilan, Gary Russell, Artem Bilan, Trung Pham
  • コンストラクターの詳細

    • AbstractPollableChannel

      public AbstractPollableChannel()
  • メソッドの詳細

    • getIntegrationPatternType

      public IntegrationPatternType getIntegrationPatternType()
      インターフェースからコピーされた説明: IntegrationPattern
      このコンポーネントが実装するパターン型を返します。
      次で指定:
      インターフェース IntegrationPatterngetIntegrationPatternType 
      オーバーライド:
      クラス AbstractMessageChannelgetIntegrationPatternType 
      戻り値:
      このコンポーネントが実装する IntegrationPatternType
    • receive

      public @Nullable Message<?> receive()
      このチャネルから最初に利用可能なメッセージを受信します。チャネルにメッセージが含まれていない場合、このメソッドはブロックします。
      次で指定:
      インターフェース PollableChannelreceive 
      戻り値:
      最初に使用可能なメッセージ、または受信スレッドが中断された場合は null
    • receive

      public @Nullable Message<?> receive(long timeout)
      このチャネルから最初に利用可能なメッセージを受信します。チャネルにメッセージが含まれていない場合、このメソッドは、割り当てられたタイムアウトが経過するまでブロックします。指定されたタイムアウトが 0 の場合、メソッドはすぐに戻ります。ゼロ未満の場合、無期限にブロックされます(receive() を参照)。
      次で指定:
      インターフェース PollableChannelreceive 
      パラメーター:
      timeout - ミリ秒単位のタイムアウト
      戻り値:
      最初に使用可能なメッセージ、または割り当てられた時間内に使用可能なメッセージがない場合、または受信スレッドが中断された場合は null
    • setInterceptors

      public void setInterceptors(ListSE<ChannelInterceptor> interceptors)
      クラスからコピーされた説明: AbstractMessageChannel
      チャネルインターセプターのリストを設定します。これにより、既存のインターセプターがすべてクリアされます。
      次で指定:
      インターフェース InterceptableChannelsetInterceptors 
      オーバーライド:
      クラス AbstractMessageChannelsetInterceptors 
      パラメーター:
      interceptors - インターセプターのリスト。
    • addInterceptor

      public void addInterceptor(ChannelInterceptor interceptor)
      クラスからコピーされた説明: AbstractMessageChannel
      リストの最後にチャネルインターセプターを追加します。
      次で指定:
      インターフェース InterceptableChanneladdInterceptor 
      オーバーライド:
      クラス AbstractMessageChanneladdInterceptor 
      パラメーター:
      interceptor - インターセプター。
    • addInterceptor

      public void addInterceptor(int index, ChannelInterceptor interceptor)
      クラスからコピーされた説明: AbstractMessageChannel
      リストの指定されたインデックスにチャネルインターセプターを追加します。
      次で指定:
      インターフェース InterceptableChanneladdInterceptor 
      オーバーライド:
      クラス AbstractMessageChanneladdInterceptor 
      パラメーター:
      index - インターセプターを追加するためのインデックス。
      interceptor - インターセプター。
    • removeInterceptor

      public boolean removeInterceptor(ChannelInterceptor interceptor)
      次で指定:
      インターフェース InterceptableChannelremoveInterceptor 
      オーバーライド:
      クラス AbstractMessageChannelremoveInterceptor 
    • removeInterceptor

      public ChannelInterceptor removeInterceptor(int index)
      次で指定:
      インターフェース InterceptableChannelremoveInterceptor 
      オーバーライド:
      クラス AbstractMessageChannelremoveInterceptor 
    • hasExecutorInterceptors

      public boolean hasExecutorInterceptors()
      次で指定:
      インターフェース ExecutorChannelInterceptorAwarehasExecutorInterceptors 
    • doReceive

      protected abstract @Nullable Message<?> doReceive(long timeout)
      サブクラスはこのメソッドを実装する必要があります。負でないタイムアウトは、チャネルが空の場合に待機する時間を示します(値が 0 の場合、成功の有無にかかわらずすぐに戻る必要があります)。負のタイムアウト値は、メッセージが使用可能になるか、ブロッキングスレッドが中断されるまでメソッドがブロックされることを示します。
      パラメーター:
      timeout - タイムアウト。
      戻り値:
      メッセージ、または null。