org.jboss.narayana.blacktie.jatmibroker.xatmi.impl
Class SessionImpl

java.lang.Object
  extended by org.jboss.narayana.blacktie.jatmibroker.xatmi.impl.SessionImpl
All Implemented Interfaces:
Session

public class SessionImpl
extends Object
implements Session

A session reference may either be obtained from the tpconnect Connection invocation for a client or retrieved from the TPSVCINFO structure for a service (assuming the service was invoked within the scope of a tpconnect). It is used to send and retrieve data

See Also:
ConnectionImpl#tpconnect(String, BufferImpl, int, int), TPSVCINFO_Impl.getSession()

Method Summary
 void close()
          Close the session
 org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender getSender()
          Get the sessions sender.
 void setCreatedState(long flags)
          Set the state of the session using the flags.
 void tpdiscon()
          Close the conversation with the remote service.
 Buffer tprecv(int flags)
          Received the next response in a conversation
 int tpsend(Buffer toSend, int flags)
          Send a buffer to a remote server in a conversation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setCreatedState

public void setCreatedState(long flags)
Set the state of the session using the flags. This is so we can respond from the service easily with the ACK that the client expects in initialization of the connection.

Parameters:
flags -

close

public void close()
           throws ConnectionException
Close the session

Throws:
ConnectionException

tpsend

public int tpsend(Buffer toSend,
                  int flags)
           throws ConnectionException
Send a buffer to a remote server in a conversation

Specified by:
tpsend in interface Session
Parameters:
toSend - The outbound data
flags - The flags to use
Throws:
ConnectionException - If the message cannot be sent.

tprecv

public Buffer tprecv(int flags)
              throws ConnectionException,
                     org.jboss.narayana.blacktie.jatmibroker.core.conf.ConfigurationException
Received the next response in a conversation

Specified by:
tprecv in interface Session
Parameters:
flags - The flags to use
Returns:
The next response
Throws:
ConnectionException - If the message cannot be received or the flags are incorrect
org.jboss.narayana.blacktie.jatmibroker.core.conf.ConfigurationException

tpdiscon

public void tpdiscon()
              throws ConnectionException
Close the conversation with the remote service. This will close the session.

Specified by:
tpdiscon in interface Session
Throws:
ConnectionException

getSender

public org.jboss.narayana.blacktie.jatmibroker.core.transport.Sender getSender()
Get the sessions sender.

Returns:
The sender


Copyright © 2013. All Rights Reserved.