クラス UnicastReceivingChannelAdapter

実装済みのインターフェース一覧:
RunnableSE, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, MessageProducer, IntegrationPattern, CommonSocketOptions, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent, SchedulingAwareRunnable
既知の直属サブクラス
MulticastReceivingChannelAdapter

public class UnicastReceivingChannelAdapter extends AbstractInternetProtocolReceivingChannelAdapter
受信 UDP パケットを受信するチャネルアダプター。オプションで、すべてのデータが受信されたことを検証するために使用される 4 バイト長のフィールドをパケットの前に付けることができます。パケットには、確認応答を送信する必要があることを示す情報も含まれる場合があります。
導入:
2.0
作成者:
Gary Russell, Artem Bilan, Christian Tzolov, Glenn Renfro
  • フィールドの詳細

    • lock

      protected final LockSE lock
  • コンストラクターの詳細

    • UnicastReceivingChannelAdapter

      public UnicastReceivingChannelAdapter(int port)
      指定されたポートをリッスンする UnicastReceivingChannelAdapter を構築します。
      パラメーター:
      port - ポート。
    • UnicastReceivingChannelAdapter

      public UnicastReceivingChannelAdapter(int port, boolean lengthCheck)
      指定されたポートでパケットをリッスンする UnicastReceivingChannelAdapter を構築します。lengthCheck オプションの設定を有効にします。このオプションでは、受信パケットの前に長さが付加されます。
      パラメーター:
      port - ポート。
      lengthCheck - true の場合、lengthCheck オプションが有効になります。
  • 方法の詳細

    • setLengthCheck

      public void setLengthCheck(boolean lengthCheck)
      パラメーター:
      lengthCheck - true の場合、受信パケットには 4 バイトのバイナリ長ヘッダーが含まれることが期待されます。
      導入:
      5.0
    • setSocketCustomizer

      public void setSocketCustomizer(SocketCustomizer socketCustomizer)
      作成後にソケットをさらに構成するようにカスタマイザーを設定します。
      パラメーター:
      socketCustomizer - カスタマイザー。
      導入:
      5.3.3
    • setTrustedAckAddresses

      public void setTrustedAckAddresses(StringSE... trustedAckAddresses)
      Set patterns for trusted acknowledgment addresses. Only packets whose IpHeaders.ACK_ADDRESS header matches one of these patterns will trigger an acknowledgment. Patterns support * wildcards via PatternMatchUtils.simpleMatch(String, String) . The address format is host:port, matching the format set by UnicastSendingMessageHandler. By default, no patterns are set. Setting trustedAckAddresses implies acknowledgments will be sent. Packets from non-matching addresses will not receive an acknowledgment, and a MessagingException is thrown.
      パラメーター:
      trustedAckAddresses - the patterns to trust.
      導入:
      5.5.22
    • isLongLived

      public boolean isLongLived()
    • getPort

      public int getPort()
      オーバーライド:
      クラス AbstractInternetProtocolReceivingChannelAdaptergetPort 
      戻り値:
      このレシーバーがリッスンしているポート。
    • onInit

      protected void onInit()
      クラスからコピーされた説明: IntegrationObjectSupport
      サブクラスは、初期化ロジック用にこれを実装できます。
      オーバーライド:
      クラス MessageProducerSupportonInit 
    • run

      public void run()
    • sendAck

      protected void sendAck(Message<byte[]> message)
    • asyncSendMessage

      protected boolean asyncSendMessage(DatagramPacketSE packet)
    • doSend

      protected void doSend(DatagramPacketSE packet)
    • receive

      protected DatagramPacketSE receive() throws IOExceptionSE
      例外:
      IOExceptionSE
    • setSocket

      public void setSocket(DatagramSocketSE socket)
      パラメーター:
      socket - 設定するソケット
    • getTheSocket

      protected @Nullable DatagramSocketSE getTheSocket()
    • getSocket

      public DatagramSocketSE getSocket()
    • setSocketAttributes

      protected void setSocketAttributes(DatagramSocketSE socket) throws SocketExceptionSE
      タイムアウトと受信バッファサイズを設定し、ソケットカスタマイザを呼び出します。
      パラメーター:
      socket - ソケット。
      例外:
      SocketExceptionSE - ソケット例外。
    • setSoSendBufferSize

      public void setSoSendBufferSize(int soSendBufferSize)
      パラメーター:
      soSendBufferSize - 送信バッファサイズ。
      関連事項:
    • setLookupHost

      public void setLookupHost(boolean lookupHost)
    • getComponentType

      public StringSE getComponentType()
      次で指定:
      インターフェース NamedComponent 内の getComponentType 
      オーバーライド:
      クラス MessageProducerSupportgetComponentType 
    • doStop

      protected void doStop()
      クラスからコピーされた説明: MessageProducerSupport
      デフォルトでは何もしません。サブクラスは、ライフサイクル管理の動作が必要な場合、これをオーバーライドできます。
      オーバーライド:
      クラス AbstractInternetProtocolReceivingChannelAdapterdoStop