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 voiddisconnected()voidexceptionOccurred(Throwable t)CryptorgetCryptor()DQPWorkContextgetWorkContext()voidonConnection(SSLEngine sslEngine)voidreceivedMessage(Object msg)voidsend(Message message, Serializable messageKey)Send a message to this particular client using the asynch message key.voidshutdown()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:ClientInstanceSend a message to this particular client using the asynch message key.- Specified by:
sendin interfaceClientInstance- Parameters:
message- The message to sendmessageKey- The key sent with the asynch query
-
getCryptor
public Cryptor getCryptor()
- Specified by:
getCryptorin interfaceClientInstance- Returns:
- Returns the cryptor.
-
exceptionOccurred
public void exceptionOccurred(Throwable t)
- Specified by:
exceptionOccurredin interfaceChannelListener
-
onConnection
public void onConnection(SSLEngine sslEngine) throws CommunicationException
- Specified by:
onConnectionin interfaceChannelListener- Throws:
CommunicationException
-
disconnected
public void disconnected()
- Specified by:
disconnectedin interfaceChannelListener
-
receivedMessage
public void receivedMessage(Object msg) throws CommunicationException
- Specified by:
receivedMessagein interfaceChannelListener- Throws:
CommunicationException
-
shutdown
public void shutdown() throws CommunicationExceptionDescription copied from interface:ClientInstanceShutdown the server's connection to the client.- Specified by:
shutdownin interfaceClientInstance- Throws:
CommunicationException- If an error occurs during the shutdown
-
getWorkContext
public DQPWorkContext getWorkContext()
- Specified by:
getWorkContextin interfaceClientInstance
-
-