Novell exteNd Messaging Platform 5.2

com.sssw.jbroker.api.transaction
Interface TransactionService

All Known Implementing Classes:
TransactionService

public interface TransactionService

JBroker provides an API for specifying the Transaction Service to use. A Transaction Service is required to implement the following interface. You can set the Transaction Service in the ORB, using

  1. set the fully qualified class name of the TransactionService implementation as the value of the transaction.service.class property in the transactions.properties file under the lib directory. When the ORB initializes, it creates an instance of the given class and then calls initialize method on it passing it the ORB, a ThreadContext object, and all the properties from the transactions.properties file.
  2. programmatically create a TransactionService instance, get the TSIdentification initial object from the ORB, and then set the TransactionService using the identify method on it. The initialize method will get called on the TransactionService instance with the ORB, a ThreadContext object, and null for properties.


Method Summary
 void initialize(ORB orb, ThreadContext threadContext, Properties props)
          Initialize the Transaction Service.
 void receivedReply(int requestId, InputStream contextIS, Exception ex)
          A reply has been received.
 void receivedRequest(int requestId, InputStream contextIS)
          A request has been received.
 void sendingReply(int requestId, OutputStream contextIS)
          A reply is about to be sent.
 void sendingRequest(int requestId, OutputStream contextOS)
          A request is about to be sent.
 

Method Detail

initialize

public void initialize(ORB orb,
                       ThreadContext threadContext,
                       Properties props)
Initialize the Transaction Service. This method is called by the TSIdentification implementation when the transaction service is identified.

Parameters:
orb - the ORB instance
threadContext - provides fast access to thread level stacking of transaction contexts
props - if the Transaction Service is initialized by specifying a txService.class property in the transactions.properties file, then all the properties in the file are passed. Otherwise it is null.

sendingRequest

public void sendingRequest(int requestId,
                           OutputStream contextOS)
A request is about to be sent. The Transaction Service should write the transaction context using the provided OutputStream. The method is only called for objects that inherit from org.omg.CosTransactions.TransactionalObject. For local invocations (invocation that do not switch thread), this method is not called, since the transaction context is already set in the Thread.


receivedReply

public void receivedReply(int requestId,
                          InputStream contextIS,
                          Exception ex)
A reply has been received. The PropagationContext from the server is available in the given InputStream. The exception if not null specifies the exception that occurred. This method is only called if the received reply has a transaction context.


receivedRequest

public void receivedRequest(int requestId,
                            InputStream contextIS)
A request has been received. The PropagationContext defining the transaction can be read from the given InputStream. This method is only called if the received request has a transaction context.


sendingReply

public void sendingReply(int requestId,
                         OutputStream contextIS)
A reply is about to be sent. The Transaction Service should write the transaction context using the provided OutputStream. This method is only called if the received request had a transaction context.


Novell exteNd Messaging Platform 5.2

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2004 Novell, Inc. All Rights Reserved.