Novell exteNd Messaging Platform 5.2

com.sssw.jts.api
Class TransactionService

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended bycom.sssw.jbroker.orb.LocalityConstrainedObject
          extended bycom.sssw.jts.api.TransactionService
All Implemented Interfaces:
Object, TransactionService

public class TransactionService
extends com.sssw.jbroker.orb.LocalityConstrainedObject
implements TransactionService

The jBrokerTM TransactionService. Provides both OTS TransactionServices and JTA TransactionManagent implementations.


Field Summary
static boolean _dbgex
           
static boolean _debug
           
static boolean _dump
           
static String[] ALL_PROPS
           
static String[] PERSISTENT_PROPS
           
static String PROPERTY_DEBUG_MODES
          (String) Debug modes (default="").
static String PROPERTY_LOG_DIRECTORY
          (String) Directory name for TransactionManager Log files.
static String PROPERTY_LOG_FILEMAXSIZE
          (int) Maximum size of each Log file in kilo bytes.
static String PROPERTY_LOG_FILEPREALLOC
          (boolean) Preallocate Log files when creating.
static String PROPERTY_LOG_FLUSH_DONE
          (boolean) Flush log after every write (default=false).
static String PROPERTY_LOG_TYPE
          (String) Logging mechanism type oneof: File, NativeFile, Database.
static String PROPERTY_RECOVERY_RESOURCE_RETRY_MINS
          (int) Resource recovery retry time limit in minutes (default=15).
static String PROPERTY_RECOVERY_WORKER_THREADS
          (int) Number of Recovery worker threads (default=3).
static String PROPERTY_TRANSACTION_SERVICE_ID
          (String) Transaction Service ID.
static String PROPERTY_TRANSACTION_TIMEOUT
          (int) Default transaction timeout in seconds (default=60).
 
Constructor Summary
TransactionService()
           
 
Method Summary
 Enumeration getRecoveryTransactions()
          Get an enumeration of transactions that are pending recovery.
 Current getTransactionCurrent()
          Get the OTS Current object.
 TransactionFactory getTransactionFactory()
          Get the OTS TransactionFactory object.
 TransactionManager getTransactionManager()
          Get the JTA TransactionManager object.
 UserTransaction getUserTransaction()
          Get the JTA UserTransaction object.
 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 recover(XAResourceHandleMapper mapper, boolean coldstart, RecoveryListener asynchCallback)
          Start Transaction Manager recovery.
 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.
 
Methods inherited from class com.sssw.jbroker.orb.LocalityConstrainedObject
_get_delegate, _ids, equals, hashCode, toString
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_debug

public static boolean _debug

_dbgex

public static boolean _dbgex

_dump

public static boolean _dump

PROPERTY_TRANSACTION_SERVICE_ID

public static final String PROPERTY_TRANSACTION_SERVICE_ID
(String) Transaction Service ID.

See Also:
Constant Field Values

PROPERTY_TRANSACTION_TIMEOUT

public static final String PROPERTY_TRANSACTION_TIMEOUT
(int) Default transaction timeout in seconds (default=60).

See Also:
Constant Field Values

PROPERTY_LOG_DIRECTORY

public static final String PROPERTY_LOG_DIRECTORY
(String) Directory name for TransactionManager Log files. (default=.).

See Also:
Constant Field Values

PROPERTY_LOG_TYPE

public static final String PROPERTY_LOG_TYPE
(String) Logging mechanism type oneof: File, NativeFile, Database. (default: SimpeFile).

See Also:
Constant Field Values

PROPERTY_LOG_FILEMAXSIZE

public static final String PROPERTY_LOG_FILEMAXSIZE
(int) Maximum size of each Log file in kilo bytes. (default=4096 Kb).

See Also:
Constant Field Values

PROPERTY_LOG_FILEPREALLOC

public static final String PROPERTY_LOG_FILEPREALLOC
(boolean) Preallocate Log files when creating. (default=true).

See Also:
Constant Field Values

PROPERTY_LOG_FLUSH_DONE

public static final String PROPERTY_LOG_FLUSH_DONE
(boolean) Flush log after every write (default=false). The commit-done records are not critical and do not need to be flushed. Setting this to tru will force them to be flushed

See Also:
Constant Field Values

PROPERTY_RECOVERY_WORKER_THREADS

public static final String PROPERTY_RECOVERY_WORKER_THREADS
(int) Number of Recovery worker threads (default=3).

See Also:
Constant Field Values

PROPERTY_RECOVERY_RESOURCE_RETRY_MINS

public static final String PROPERTY_RECOVERY_RESOURCE_RETRY_MINS
(int) Resource recovery retry time limit in minutes (default=15).

See Also:
Constant Field Values

PROPERTY_DEBUG_MODES

public static final String PROPERTY_DEBUG_MODES
(String) Debug modes (default="").

See Also:
Constant Field Values

ALL_PROPS

public static final String[] ALL_PROPS

PERSISTENT_PROPS

public static final String[] PERSISTENT_PROPS
Constructor Detail

TransactionService

public TransactionService()
Method Detail

initialize

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

Specified by:
initialize in interface TransactionService
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)
Description copied from interface: TransactionService
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.

Specified by:
sendingRequest in interface TransactionService

receivedReply

public void receivedReply(int requestId,
                          InputStream contextIS,
                          Exception ex)
Description copied from interface: TransactionService
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.

Specified by:
receivedReply in interface TransactionService

receivedRequest

public void receivedRequest(int requestId,
                            InputStream contextIS)
Description copied from interface: TransactionService
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.

Specified by:
receivedRequest in interface TransactionService

sendingReply

public void sendingReply(int requestId,
                         OutputStream contextIS)
Description copied from interface: TransactionService
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.

Specified by:
sendingReply in interface TransactionService

getTransactionManager

public TransactionManager getTransactionManager()
Get the JTA TransactionManager object.

Returns:
JTA TransactionManager object.

getUserTransaction

public UserTransaction getUserTransaction()
Get the JTA UserTransaction object.

Returns:
JTA UserTransaction object.

getTransactionFactory

public TransactionFactory getTransactionFactory()
Get the OTS TransactionFactory object.

Returns:
OTS TransactionFactory object.

getTransactionCurrent

public Current getTransactionCurrent()
Get the OTS Current object.

Returns:
OTS Current object.

recover

public void recover(XAResourceHandleMapper mapper,
                    boolean coldstart,
                    RecoveryListener asynchCallback)
             throws com.sssw.jts.util.LogException
Start Transaction Manager recovery. The transaction services can be used after this call returns to initiate new transactions.

Parameters:
mapper - the handle to XAResource mapping callback
coldstart - if true log files are deleted without any transaction recovey, otherwise, all non-completed transactions in the log are recovered.
asynchCallback - if null recovery is synchronous. Otherwise, recovery is done asynchronous and the asynchCallback.recoveryCompleted() method is called when the recovery has completed.
Throws:
com.sssw.jts.util.LogException - thrown when an error occurs accesing the log file.

getRecoveryTransactions

public Enumeration getRecoveryTransactions()
Get an enumeration of transactions that are pending recovery. These are usually Distributed Transactions that have registered resources from other processes that could not be reached for one reason or other, or Subordinate Transactions that are part of a Distributed Transaction that is being controled in another process.

Returns:
Enumeration of com.sssw.jts.api.admin.RecoveryTransaction objects.

Novell exteNd Messaging Platform 5.2

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