org.teiid.transport
Class SocketClientInstance

java.lang.Object
  extended by org.teiid.transport.SocketClientInstance
All Implemented Interfaces:
ChannelListener, ClientInstance

public class SocketClientInstance
extends java.lang.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
SocketClientInstance(ObjectChannel objectSocket, WorkerPool workerPool, ClientServiceRegistry server, boolean isClientEncryptionEnabled, SessionServiceInterface sessionService)
           
 
Method Summary
 void exceptionOccurred(java.lang.Throwable t)
           
 Cryptor getCryptor()
           
 org.teiid.dqp.internal.process.DQPWorkContext getWorkContext()
           
 void onConnection()
           
 void receivedMessage(java.lang.Object msg)
           
 void send(Message message, java.io.Serializable messageKey)
          Send a message to this particular client using the asynch message key.
 void shutdown()
          Shutdown the server's connection to the client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketClientInstance

public SocketClientInstance(ObjectChannel objectSocket,
                            WorkerPool workerPool,
                            ClientServiceRegistry server,
                            boolean isClientEncryptionEnabled,
                            SessionServiceInterface sessionService)
Method Detail

send

public void send(Message message,
                 java.io.Serializable messageKey)
Description copied from interface: ClientInstance
Send a message to this particular client using the asynch message key.

Specified by:
send in interface ClientInstance
Parameters:
message - The message to send
messageKey - The key sent with the asynch query

getCryptor

public Cryptor getCryptor()
Specified by:
getCryptor in interface ClientInstance
Returns:
Returns the cryptor.

exceptionOccurred

public void exceptionOccurred(java.lang.Throwable t)
Specified by:
exceptionOccurred in interface ChannelListener

onConnection

public void onConnection()
                  throws CommunicationException
Specified by:
onConnection in interface ChannelListener
Throws:
CommunicationException

receivedMessage

public void receivedMessage(java.lang.Object msg)
                     throws CommunicationException
Specified by:
receivedMessage in interface ChannelListener
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 interface ClientInstance
Throws:
CommunicationException - If an error occurs during the shutdown

getWorkContext

public org.teiid.dqp.internal.process.DQPWorkContext getWorkContext()
Specified by:
getWorkContext in interface ClientInstance


Copyright © 2009. All Rights Reserved.