public class TcpRequestChannel extends Object implements RequestChannel
TcpConnection
links a Joram client and a Joram platform
with a TCP socket.
Requests and replies travel through the socket after serialization.
Modifier and Type | Field and Description |
---|---|
private Identity |
identity |
private static Logger |
logger |
private ReliableTcpClient |
tcpClient |
Constructor and Description |
---|
TcpRequestChannel(FactoryParameters params,
Identity identity)
Creates a
TcpConnection instance. |
TcpRequestChannel(FactoryParameters params,
Identity identity,
String reliableClass)
Creates a
TcpConnection instance. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the TCP connection.
|
void |
closing() |
void |
connect() |
Identity |
getIdentity() |
AbstractJmsReply |
receive() |
void |
send(AbstractJmsRequest request)
Sending a JMS request through the TCP connection.
|
void |
setTimer(Timer timer) |
String |
toString() |
private static Logger logger
private ReliableTcpClient tcpClient
private Identity identity
public TcpRequestChannel(FactoryParameters params, Identity identity) throws JMSException
TcpConnection
instance.params
- Factory parameters.identity
- JMSSecurityException
- If the user identification is incorrect.IllegalStateException
- If the server is not reachable.JMSException
public TcpRequestChannel(FactoryParameters params, Identity identity, String reliableClass) throws JMSException
TcpConnection
instance.params
- Factory parameters.identity
- reliableClass
- reliable class name.JMSSecurityException
- If the user identification is incorrect.IllegalStateException
- If the server is not reachable.JMSException
public void setTimer(Timer timer)
setTimer
in interface RequestChannel
public void connect() throws Exception
connect
in interface RequestChannel
Exception
public void send(AbstractJmsRequest request) throws Exception
send
in interface RequestChannel
IllegalStateException
- If the connection is broken.Exception
public AbstractJmsReply receive() throws Exception
receive
in interface RequestChannel
Exception
public void close()
close
in interface RequestChannel
public void closing()
closing
in interface RequestChannel
public Identity getIdentity()
getIdentity
in interface RequestChannel
Copyright © 2022 ScalAgent D.T.. All rights reserved.