Package org.teiid.transport
Class SocketClientInstance
- java.lang.Object
-
- org.teiid.transport.SocketClientInstance
-
- All Implemented Interfaces:
ChannelListener
,ClientInstance
public class SocketClientInstance extends Object implements ChannelListener, ClientInstance
Sockets implementation of the communication framework class representing the server's view of a client connection. Implements the server-side of the sockets messaging protocol. The client side of the protocol is implemented in SocketServerInstance. Users of this class are expected to provide a WorkerPool for processing incoming messages. Users must also call read(). Users also provide a ServerListener implementation. The ServerListener is the application level object processing the application level messages.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.teiid.transport.ChannelListener
ChannelListener.ChannelListenerFactory
-
-
Constructor Summary
Constructors Constructor Description SocketClientInstance(ObjectChannel objectSocket, ClientServiceRegistryImpl csr, boolean isClientEncryptionEnabled)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disconnected()
void
exceptionOccurred(Throwable t)
Cryptor
getCryptor()
DQPWorkContext
getWorkContext()
void
onConnection(SSLEngine sslEngine)
void
receivedMessage(Object msg)
void
send(Message message, Serializable messageKey)
Send a message to this particular client using the asynch message key.void
shutdown()
Shutdown the server's connection to the client.
-
-
-
Constructor Detail
-
SocketClientInstance
public SocketClientInstance(ObjectChannel objectSocket, ClientServiceRegistryImpl csr, boolean isClientEncryptionEnabled)
-
-
Method Detail
-
send
public void send(Message message, Serializable messageKey)
Description copied from interface:ClientInstance
Send a message to this particular client using the asynch message key.- Specified by:
send
in interfaceClientInstance
- Parameters:
message
- The message to sendmessageKey
- The key sent with the asynch query
-
getCryptor
public Cryptor getCryptor()
- Specified by:
getCryptor
in interfaceClientInstance
- Returns:
- Returns the cryptor.
-
exceptionOccurred
public void exceptionOccurred(Throwable t)
- Specified by:
exceptionOccurred
in interfaceChannelListener
-
onConnection
public void onConnection(SSLEngine sslEngine) throws CommunicationException
- Specified by:
onConnection
in interfaceChannelListener
- Throws:
CommunicationException
-
disconnected
public void disconnected()
- Specified by:
disconnected
in interfaceChannelListener
-
receivedMessage
public void receivedMessage(Object msg) throws CommunicationException
- Specified by:
receivedMessage
in interfaceChannelListener
- Throws:
CommunicationException
-
shutdown
public void shutdown() throws CommunicationException
Description copied from interface:ClientInstance
Shutdown the server's connection to the client.- Specified by:
shutdown
in interfaceClientInstance
- Throws:
CommunicationException
- If an error occurs during the shutdown
-
getWorkContext
public DQPWorkContext getWorkContext()
- Specified by:
getWorkContext
in interfaceClientInstance
-
-