org.jboss.blacktie.jatmibroker.jab.factory
Class JABConnection

java.lang.Object
  extended by org.jboss.blacktie.jatmibroker.jab.factory.JABConnection

public class JABConnection
extends Object

The JAB connection abstraction allows invocations to services to several services to be multiplexed over the same connection. It also provides a factory method to begin transactions.

See Also:
JABConnectionFactory

Method Summary
 Transaction beginTransaction(int timeout)
          Begin a new transaction.
 JABResponse call(String serviceName, JABBuffer toSend, Transaction transaction, String bufferType, String bufferSubType)
          Invoke the service specified by the first parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

beginTransaction

public Transaction beginTransaction(int timeout)
                             throws TransactionException
Begin a new transaction. This transaction reference can then be used in calls to "call" and completed via the options on the JABTransaction class itself.

Parameters:
timeout - Specify a timeout for the transaction
Returns:
The transaction object
Throws:
JABException - In case the transaction cannot be created
TransactionException

call

public JABResponse call(String serviceName,
                        JABBuffer toSend,
                        Transaction transaction,
                        String bufferType,
                        String bufferSubType)
                 throws TransactionException,
                        JABException
Invoke the service specified by the first parameter. The buffer to send is provided as the second parameter. If the service should be invoked within the scope of a transaction, the last parameter should also be provided. This can be obtained via the beginTransaction method.

Parameters:
serviceName - The name of the service
toSend - The buffer to use
transaction - The transaction to use, may be null
Returns:
The buffer returned from the remote service
Throws:
TransactionException - In case the transaction cannot be handled
JABException - In case the service cannot be contacted


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.