FileDocCategorySizeDatePackage
TransactionService.javaAPI DocJava SE 5 API3019Fri Aug 26 14:54:36 BST 2005com.sun.corba.se.spi.costransactions

TransactionService

public interface TransactionService
The TransactionService interface must be implemented by all Java Transaction Services. It provides a procedure for initialization of a JTS in association with an ORB. TransactionService is not intended to be visible to the application programmer; it is only an interface between the ORB and the JTS. During initialization, the application programmer must provide the ORB with a JTS implementation through the property "com.sun.corba.se.spi.costransactions.TransactionServiceClass". The ORB then instantiates the JTS and calls identify_ORB() on it. The following is an example of the initialization steps required in the application code:

// Create a properties object. The properties may also be given as
// command line arguments, applet parameters, etc.
Properties p = new Properties();
p.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.impl.orb.ORBImpl"); p.put("com.sun.corba.se.spi.costransactions.ORBJTSClass", "com.xyz.SomeTransactionService"); // This property is given to the JTS in the Properties parameter in identify_ORB(). p.put("com.xyz.CosTransactions.SomeProperty", "SomeValue");

// Get an ORB object. During initialization, the JTS is also
// instantiated, and the JTS registers its callbacks with the ORB.
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(null, p);

// Get the Current instance from the ORB
org.omg.CosTransactions.Current current = (Current)orb.resolve_initial_references("TransactionCurrent");

current.begin();
...
current.commit(...);

Note: The package name for TransactionService and the property may change.

Fields Summary
Constructors Summary
Methods Summary
public org.omg.CosTransactions.Currentget_current()
get_current() is called by the ORB during initialization to obtain the transaction-service's implementation of the Current pseudo-object. Current is available to the application programmer thru orb.resolve_initial_references("TransactionCurrent").

public voididentify_ORB(org.omg.CORBA.ORB orb, org.omg.CORBA.TSIdentification tsi, java.util.Properties props)
identify_ORB is called by the ORB during initialization to provide the JTS implementation with an instance of the ORB object, and a TSIdentification object. The ORB instance is necessary so that client JTS implementations running in applets do not have to store static data which may cause security flaws. The TSIdentification object is used by the JTS to register its Sender and Receiver callbacks. The Properties object allows the application to pass information to the JTS implementation.