bea.jolt
Class JoltRemoteService

java.lang.Object
  |
  +--bea.jolt.JoltServiceBase
        |
        +--bea.jolt.JoltRemoteService
Direct Known Subclasses:
JoltService

public class JoltRemoteService
extends JoltServiceBase

JoltRemoteService provides an implementation of Tuxedo synchronous Request/Reply communication model. Jolt treats each Tuxedo service as a remote service object, and each service has its input and output parameters. Typically, the user sets the input parameters through the various setXXX and addXXX methods, and then invokes the call() method. Upon successful completion, the user retrieves the result through the various getXXX methods.

Jolt maps the following Java data types to Tuxedo data types:

Java Data TypeTuxedo data type
bytechar
shortshort
intlong
floatfloat
doubledouble
Stringstring
byte[]carray


Constructor Summary
JoltRemoteService(java.lang.String name)
          This constructor gets a Tuxedo service, which is represented as an object.
JoltRemoteService(java.lang.String name, bea.jolt.Session s)
          This constructor gets a Tuxedo service, which is represented as an object.
 
Method Summary
 void acall()
          Sends an asynchronous invocation.
static boolean anyReplyWaiting()
          Determines whether there is a reply waiting.
 void call()
          Invokes the synchronized request/reply using an implicit transaction model.
 void call(bea.jolt.Transaction trans)
          Invokes the synchronized request/reply without a transaction.
 void clear()
          Clears the input and output parameters, and the priority.
 void done()
          Done with this service object and performs some clean up.
static JoltRemoteService getAnyReply()
          Returns any remote service that has a reply available.
 int getApplicationCode()
          Gets the return code from the application.
 java.lang.String getName()
          Gets the name of this service.
 void getrply()
          Gets an asynchronous reply.
 boolean hasReply()
          Determines whether an asynchronous reply is waiting.
 void setNoTimeOut(boolean noTimeOut)
          Sets no timeout for the request.
 void setRequestPriority(int priority)
          Sets the absolute priority for the request.
 java.lang.String toString()
          Gets the class name with the service name.
 
Methods inherited from class bea.jolt.JoltServiceBase
addByte, addBytes, addDouble, addFloat, addInt, addShort, addString, delete, deleteItem, getByteDef, getByteItemDef, getBytesDef, getBytesItemDef, getDoubleDef, getDoubleItemDef, getFloatDef, getFloatItemDef, getIntDef, getIntItemDef, getObufIntItemDef, getObufOccurrenceCount, getObufStringItemDef, getOccurrenceCount, getShortDef, getShortItemDef, getStringDef, getStringItemDef, setByte, setByteItem, setBytes, setBytesItem, setDouble, setDoubleItem, setFloat, setFloatItem, setInt, setIntItem, setShort, setShortItem, setString, setStringItem
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JoltRemoteService

public JoltRemoteService(java.lang.String name)
                  throws ServiceException
This constructor gets a Tuxedo service, which is represented as an object.
Parameters:
name - The service name.
Throws:
ServiceException - No such service.

JoltRemoteService

public JoltRemoteService(java.lang.String name,
                         bea.jolt.Session s)
                  throws ServiceException
This constructor gets a Tuxedo service, which is represented as an object.
Parameters:
name - The service name.
s - Must be null.
Throws:
ServiceException - Invalid session or no such service.
Method Detail

done

public void done()
Done with this service object and performs some clean up. This object is no longer valid.

getName

public java.lang.String getName()
Gets the name of this service.
Returns:
The name of this service.

getApplicationCode

public int getApplicationCode()
Gets the return code from the application. This it is equivalent to the tpurcode in ATMI or the second parameter of tpreturn(3) in ATMI.
Returns:
The application return code.

call

public void call()
          throws ServiceException,
                 TransactionException,
                 ApplicationException
Invokes the synchronized request/reply using an implicit transaction model. The transaction must be started by using the CORBA OTS interface. User should use set/add methods to set the input parameters prior to this method. Upon successful completion, user can use getXXX methods to retrieve the results.
Throws:
ServiceException - Service error or system error occurred.
TransactionException - Transaction time-out occurred.
ApplicationException - Application error.
See Also:
call(Transaction)

acall

public void acall()
           throws ServiceException,
                  TransactionException,
                  ApplicationException
Sends an asynchronous invocation.

getrply

public void getrply()
             throws ServiceException,
                    TransactionException,
                    ApplicationException
Gets an asynchronous reply.

hasReply

public boolean hasReply()
                 throws ServiceException
Determines whether an asynchronous reply is waiting.

anyReplyWaiting

public static boolean anyReplyWaiting()
Determines whether there is a reply waiting.

getAnyReply

public static JoltRemoteService getAnyReply()
Returns any remote service that has a reply available. Blocks until at least one reply is available. Return null if no request is active.

call

public void call(bea.jolt.Transaction trans)
          throws ServiceException,
                 ApplicationException
Invokes the synchronized request/reply without a transaction. User should use setXXX/addXXX methods to set the input parameters prior to this method. Upon successful completion, user can use getXXX methods to retrieve the results.
Parameters:
trans - Must be null.
Throws:
ServiceException - Tuxedo system level error has occurred.
ApplicationException - Application level error has occurred.
See Also:
clear()

setRequestPriority

public void setRequestPriority(int priority)
Sets the absolute priority for the request. This priority remains until it is reset.
Parameters:
priority - A priority value between 1 and 100, inclusive.

setNoTimeOut

public void setNoTimeOut(boolean noTimeOut)
Sets no timeout for the request.
Parameters:
notimeout - Specify true for no timeout, or false for a timeout.

toString

public java.lang.String toString()
Gets the class name with the service name.
Returns:
The class and service name.
Overrides:
toString in class java.lang.Object

clear

public void clear()
Clears the input and output parameters, and the priority.