public class TcpNioConnection extends TcpConnectionSupport
SocketChannel
SE を使用および基礎とする TcpConnection。logger
コンストラクターと説明 |
---|
TcpNioConnection(SocketChannelSE socketChannel, boolean server, boolean lookupHost, ApplicationEventPublisher applicationEventPublisher, StringSE connectionFactoryName) SocketChannel の TcpNetConnection を構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
protected ByteBufferSE | allocate(int length) usingDirectBuffers フィールドに応じて、通常バッファーまたは直接バッファーを使用して、リクエストされた長さの ByteBuffer を割り当てます。 |
void | close() この接続を閉じます。 |
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream | getChannelOutputStream() |
ObjectSE | getDeserializerStateKey() |
long | getLastRead() |
long | getLastSend() |
ObjectSE | getPayload() デシリアライザーを使用して、接続の入力ストリームからメッセージペイロードを取得します。 |
int | getPort() |
SSLSessionSE | getSslSession() |
protected InputStreamSE | inputStream() たとえば、入力ストリームをラップするために、サブクラスでこれをオーバーライドできます。 |
boolean | isOpen() |
protected boolean | isUsingDirectBuffers() |
void | readPacket() 読み込むデータがあるときに、ファクトリによって呼び出されます。 |
void | run() リスナーが存在しない場合、このメソッドは終了します。 |
void | send(Message<?> message) メッセージを変換して送信します。 |
protected void | sendToPipe(ByteBufferSE rawBufferToSend) |
void | setLastRead(long lastRead) |
void | setPipeTimeout(long pipeTimeout) |
void | setTaskExecutor(ExecutorSE taskExecutor) |
void | setUsingDirectBuffers(boolean usingDirectBuffers) true の場合、接続は可能な限りダイレクトバッファーの使用を試みます。 |
void | shutdownInput() ソケットの入力ストリームをストリームの終わりに設定します。 |
void | shutdownOutput() ソケットの出力ストリームを無効にします。 |
closeConnection, enableManualListenerRegistration, getConnectionFactoryName, getConnectionId, getDeserializer, getHostAddress, getHostName, getListener, getMapper, getSender, getSenders, getSerializer, getSocketInfo, incrementAndGetConnectionSequence, isNoReadErrorOnClose, isServer, publishConnectionCloseEvent, publishConnectionExceptionEvent, publishConnectionOpenEvent, publishEvent, registerListener, registerSender, registerSenders, registerTestListener, sendExceptionToListener, setDeserializer, setMapper, setNeedsTest, setNoReadErrorOnClose, setSerializer, toString
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public TcpNioConnection(SocketChannelSE socketChannel, boolean server, boolean lookupHost, @Nullable ApplicationEventPublisher applicationEventPublisher, @Nullable StringSE connectionFactoryName)
socketChannel
- socketChannel。server
- true の場合、この接続は受信リクエストの結果として作成されました。lookupHost
- 逆ルックアップを実行する場合は true。applicationEventPublisher
- イベント発行者。connectionFactoryName
- この接続を作成する接続ファクトリの名前。public void setPipeTimeout(long pipeTimeout)
public void close()
TcpConnectionSupport
TcpConnection
の close
TcpConnectionSupport
の close
public boolean isOpen()
public void send(Message<?> message)
TcpConnection
message
- メッセージ public ObjectSE getPayload()
TcpConnection
public int getPort()
public ObjectSE getDeserializerStateKey()
Deserializer
の状態を参照するために使用できるキー。現在、これは接続に関連付けられている InputStream ですが、オブジェクトは不透明として扱われ、キーとしてのみ使用される必要があります。@Nullable public SSLSessionSE getSslSession()
SSLSession
SE。そうでない場合は nullprotected InputStreamSE inputStream()
protected ByteBufferSE allocate(int length)
length
- バッファー長。public void run()
protected void sendToPipe(ByteBufferSE rawBufferToSend) throws IOExceptionSE
public void readPacket()
public void setTaskExecutor(ExecutorSE taskExecutor)
taskExecutor
- 設定する taskExecutorpublic void setUsingDirectBuffers(boolean usingDirectBuffers)
usingDirectBuffers
- usingDirectBuffers を設定します。protected boolean isUsingDirectBuffers()
protected org.springframework.integration.ip.tcp.connection.TcpNioConnection.ChannelOutputStream getChannelOutputStream()
public long getLastRead()
public void setLastRead(long lastRead)
lastRead
- 最後の読み取りの時間。public long getLastSend()
public void shutdownInput() throws IOExceptionSE
IOExceptionSE
- IO 例外。SocketChannel.shutdownInput()
SEpublic void shutdownOutput() throws IOExceptionSE
IOExceptionSE
- IO 例外 SocketChannel.shutdownOutput()
SE