Class TcpRequestChannel
- java.lang.Object
-
- org.objectweb.joram.client.jms.tcp.TcpRequestChannel
-
- All Implemented Interfaces:
RequestChannel
public class TcpRequestChannel extends Object implements RequestChannel
ATcpConnectionlinks a Joram client and a Joram platform with a TCP socket.Requests and replies travel through the socket after serialization.
-
-
Field Summary
Fields Modifier and Type Field Description private org.objectweb.joram.shared.security.Identityidentityprivate static org.objectweb.util.monolog.api.Loggerloggerprivate ReliableTcpClienttcpClient
-
Constructor Summary
Constructors Constructor Description TcpRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity)Creates aTcpConnectioninstance.TcpRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity, String reliableClass)Creates aTcpConnectioninstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the TCP connection.voidclosing()voidconnect()org.objectweb.joram.shared.security.IdentitygetIdentity()org.objectweb.joram.shared.client.AbstractJmsReplyreceive()voidsend(org.objectweb.joram.shared.client.AbstractJmsRequest request)Sending a JMS request through the TCP connection.voidsetTimer(Timer timer)StringtoString()
-
-
-
Field Detail
-
logger
private static org.objectweb.util.monolog.api.Logger logger
-
tcpClient
private ReliableTcpClient tcpClient
-
identity
private org.objectweb.joram.shared.security.Identity identity
-
-
Constructor Detail
-
TcpRequestChannel
public TcpRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity) throws JMSException
Creates aTcpConnectioninstance.- Parameters:
params- Factory parameters.identity-- Throws:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not reachable.JMSException
-
TcpRequestChannel
public TcpRequestChannel(FactoryParameters params, org.objectweb.joram.shared.security.Identity identity, String reliableClass) throws JMSException
Creates aTcpConnectioninstance.- Parameters:
params- Factory parameters.identity-reliableClass- reliable class name.- Throws:
JMSSecurityException- If the user identification is incorrect.IllegalStateException- If the server is not reachable.JMSException
-
-
Method Detail
-
setTimer
public void setTimer(Timer timer)
- Specified by:
setTimerin interfaceRequestChannel
-
connect
public void connect() throws Exception- Specified by:
connectin interfaceRequestChannel- Throws:
Exception
-
send
public void send(org.objectweb.joram.shared.client.AbstractJmsRequest request) throws ExceptionSending a JMS request through the TCP connection.- Specified by:
sendin interfaceRequestChannel- Throws:
IllegalStateException- If the connection is broken.Exception
-
receive
public org.objectweb.joram.shared.client.AbstractJmsReply receive() throws Exception- Specified by:
receivein interfaceRequestChannel- Throws:
Exception
-
close
public void close()
Closes the TCP connection.- Specified by:
closein interfaceRequestChannel
-
closing
public void closing()
- Specified by:
closingin interfaceRequestChannel
-
getIdentity
public org.objectweb.joram.shared.security.Identity getIdentity()
- Specified by:
getIdentityin interfaceRequestChannel
-
-