org.jboss.narayana.blacktie.jatmibroker.xatmi
Class Connection

java.lang.Object
  extended by org.jboss.narayana.blacktie.jatmibroker.xatmi.Connection

public class Connection
extends Object

This is the connection to remote BlackTie services. It must be created using the ConnectionFactory.

See Also:
ConnectionFactory.getConnection()

Field Summary
static int TPCONV
           
static int TPEBADDESC
           
static int TPEBLOCK
           
static int TPEEVENT
           
static int TPEINVAL
           
static int TPEITYPE
           
static int TPELIMIT
           
static int TPEMATCH
           
static int TPENOENT
           
static int TPEOS
           
static int TPEOTYPE
           
static int TPEPROTO
           
static int TPESVCERR
           
static int TPESVCFAIL
           
static int TPESYSTEM
           
static int TPETIME
           
static int TPETRAN
           
static long TPEV_DISCONIMM
           
static long TPEV_SENDONLY
           
static long TPEV_SVCERR
           
static long TPEV_SVCFAIL
           
static long TPEV_SVCSUCC
           
static short TPFAIL
           
static int TPGETANY
           
static int TPGOTSIG
           
static int TPNOBLOCK
           
static int TPNOCHANGE
           
static int TPNOREPLY
           
static int TPNOTIME
           
static int TPNOTRAN
           
static int TPRECVONLY
           
static int TPSENDONLY
           
static int TPSIGRSTRT
           
static short TPSUCCESS
           
static int TPTRAN
           
static int XATMI_SERVICE_NAME_LENGTH
           
 
Method Summary
 void close()
          Close any resources associated with this connection
 int tpacall(String svc, Buffer toSend, int flags)
          Asynchronous call
 Buffer tpalloc(String type, String subtype, int len)
          Allocate a new buffer
 Response tpcall(String svc, Buffer buffer, int flags)
          Synchronous call.
 int tpcancel(int cd)
          Cancel the outstanding asynchronous call.
 Session tpconnect(String svc, Buffer toSend, int flags)
          Handle the initiation of a conversation with the server.
 Response tpgetrply(int cd, int flags)
          Get the reply for an asynchronous call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TPNOBLOCK

public static final int TPNOBLOCK
See Also:
Constant Field Values

TPSIGRSTRT

public static final int TPSIGRSTRT
See Also:
Constant Field Values

TPNOREPLY

public static final int TPNOREPLY
See Also:
Constant Field Values

TPNOTRAN

public static final int TPNOTRAN
See Also:
Constant Field Values

TPTRAN

public static final int TPTRAN
See Also:
Constant Field Values

TPNOTIME

public static final int TPNOTIME
See Also:
Constant Field Values

TPGETANY

public static final int TPGETANY
See Also:
Constant Field Values

TPNOCHANGE

public static final int TPNOCHANGE
See Also:
Constant Field Values

TPCONV

public static final int TPCONV
See Also:
Constant Field Values

TPSENDONLY

public static final int TPSENDONLY
See Also:
Constant Field Values

TPRECVONLY

public static final int TPRECVONLY
See Also:
Constant Field Values

TPEBADDESC

public static final int TPEBADDESC
See Also:
Constant Field Values

TPEBLOCK

public static final int TPEBLOCK
See Also:
Constant Field Values

TPEINVAL

public static final int TPEINVAL
See Also:
Constant Field Values

TPELIMIT

public static final int TPELIMIT
See Also:
Constant Field Values

TPENOENT

public static final int TPENOENT
See Also:
Constant Field Values

TPEOS

public static final int TPEOS
See Also:
Constant Field Values

TPEPROTO

public static final int TPEPROTO
See Also:
Constant Field Values

TPESVCERR

public static final int TPESVCERR
See Also:
Constant Field Values

TPESVCFAIL

public static final int TPESVCFAIL
See Also:
Constant Field Values

TPESYSTEM

public static final int TPESYSTEM
See Also:
Constant Field Values

TPETIME

public static final int TPETIME
See Also:
Constant Field Values

TPETRAN

public static final int TPETRAN
See Also:
Constant Field Values

TPGOTSIG

public static final int TPGOTSIG
See Also:
Constant Field Values

TPEITYPE

public static final int TPEITYPE
See Also:
Constant Field Values

TPEOTYPE

public static final int TPEOTYPE
See Also:
Constant Field Values

TPEEVENT

public static final int TPEEVENT
See Also:
Constant Field Values

TPEMATCH

public static final int TPEMATCH
See Also:
Constant Field Values

TPFAIL

public static final short TPFAIL
See Also:
Constant Field Values

TPSUCCESS

public static final short TPSUCCESS
See Also:
Constant Field Values

TPEV_DISCONIMM

public static final long TPEV_DISCONIMM
See Also:
Constant Field Values

TPEV_SVCERR

public static final long TPEV_SVCERR
See Also:
Constant Field Values

TPEV_SVCFAIL

public static final long TPEV_SVCFAIL
See Also:
Constant Field Values

TPEV_SVCSUCC

public static final long TPEV_SVCSUCC
See Also:
Constant Field Values

TPEV_SENDONLY

public static final long TPEV_SENDONLY
See Also:
Constant Field Values

XATMI_SERVICE_NAME_LENGTH

public static final int XATMI_SERVICE_NAME_LENGTH
See Also:
Constant Field Values
Method Detail

tpalloc

public Buffer tpalloc(String type,
                      String subtype,
                      int len)
               throws ConnectionException
Allocate a new buffer

Parameters:
type - The type of the buffer
subtype - The subtype of the buffer
Returns:
The new buffer
Throws:
ConnectionException - If the buffer was unknown or invalid.

tpcall

public Response tpcall(String svc,
                       Buffer buffer,
                       int flags)
                throws ConnectionException
Synchronous call.

Parameters:
svc - The name of the service to call
buffer - The inbound data
len - The length of the data
flags - The flags to use
Returns:
The returned buffer
Throws:
ConnectionException - If the service cannot be contacted.

tpacall

public int tpacall(String svc,
                   Buffer toSend,
                   int flags)
            throws ConnectionException
Asynchronous call

Parameters:
svc - The name of the service to call
toSend - The inbound data
len - The length of the data
flags - The flags to use
Returns:
The connection descriptor
Throws:
ConnectionException - If the service cannot be contacted.

tpcancel

public int tpcancel(int cd)
             throws ConnectionException
Cancel the outstanding asynchronous call.

Parameters:
cd - The connection descriptor
Throws:
ConnectionException - If the client cannot be cleaned up.

tpgetrply

public Response tpgetrply(int cd,
                          int flags)
                   throws ConnectionException
Get the reply for an asynchronous call.

Parameters:
cd - The connection descriptor to use
flags - The flags to use
Returns:
The response from the server
Throws:
ConnectionException - If the service cannot be contacted.

tpconnect

public Session tpconnect(String svc,
                         Buffer toSend,
                         int flags)
                  throws ConnectionException
Handle the initiation of a conversation with the server.

Parameters:
svc - The name of the service
toSend - The outbound buffer
len - The length of the data
flags - The flags to use
Returns:
The connection descriptor
Throws:
ConnectionException - If the service cannot be contacted.

close

public void close()
           throws ConnectionException
Close any resources associated with this connection

Throws:
ConnectionException - If an open session cannot be cancelled or disconnected.


Copyright © 2011. All Rights Reserved.