tyrex.corba
Class Current

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended bytyrex.corba.Current
All Implemented Interfaces:
org.omg.CosTransactions.Current, org.omg.CORBA.Current, org.omg.CORBA.CurrentOperations, org.omg.CosTransactions.CurrentOperations, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.Object, java.io.Serializable

public class Current
extends org.omg.CORBA.LocalObject
implements org.omg.CosTransactions.Current

This is the current interface implementation. This code is extracted from the OpenORB OTS source code.

Version:
$Revision: 1.9 $ $Date: 2004/04/21 03:52:27 $
Author:
Jerome Daniel <daniel@intalio.com>
See Also:
Serialized Form

Constructor Summary
Current(org.omg.CosTransactions.TransactionFactory factory, org.omg.PortableInterceptor.ORBInitInfo info, int t_slot)
          Constructor
 
Method Summary
 void begin()
          A new transaction is created.
 void commit(boolean report_heuristics)
          If there is no transaction associated with the client thread, the NoTransaction exception is raised.
 org.omg.CosTransactions.TransactionFactory factory()
          Returns the transaction factory
 void fatal(java.lang.String from, java.lang.String msg)
          Displays a trace and throw a INTERNAL exception...
 org.omg.CosTransactions.Control get_control()
          If the client thread is not associated with a transaction, a null object reference is returned.
 java.lang.String get_coordinator_ior()
          This operation is used to return the Coordinator ior
 org.omg.CosTransactions.Status get_status()
          If there is no transaction associated with the client thread, the StatusNoTransaction value is returned.
 java.lang.String get_transaction_name()
          If there is no transaction associated with the client thread, an empty string is returned.
 org.omg.CosTransactions.PropagationContext getPropagationContext()
          This operation is used to return the propagation context
 void pop_txcontext()
          This operation restores a previously saved propagation context.
 void print(java.lang.String from, java.lang.String msg)
          Displays a trace
 void push_txcontext(org.omg.CosTransactions.PropagationContext pctx)
          This operation is used to push a propagation context in a stack.
 void resume(org.omg.CosTransactions.Control which)
          If the parameter is a null object reference, the client thread becomes associated with no transaction.
 void rollback_only()
          If there is no transaction associated with the client thread, the NoTransaction exception is raised.
 void rollback()
          If there is no transaction associated with the client thread, the NoTransaction exception is raised.
 void set_timeout(int seconds)
          This operation modifies a state variable associated with the target object that affects the time-out period associated with top-level transactions created by subsequent invocations of the begin operation.
 org.omg.CosTransactions.Control suspend()
          If the client thread is not associated with a transaction, a null object reference is returned.
 
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Constructor Detail

Current

public Current(org.omg.CosTransactions.TransactionFactory factory,
               org.omg.PortableInterceptor.ORBInitInfo info,
               int t_slot)
Constructor

Method Detail

begin

public void begin()
           throws org.omg.CosTransactions.SubtransactionsUnavailable
A new transaction is created. The transaction context of the client thread is modified so that the thread is associated with the new transaction. If the client thread is currently associated with a transaction, the new transaction is a subtransaction of that transaction. Otherwise, the new transaction is a top-level transaction.

Specified by:
begin in interface org.omg.CosTransactions.CurrentOperations
Throws:
SubtransactionsUnavailable - The SubtransactionsUnavailable exception is raised if the client thread already has an associated transaction and the Transaction Service implementation does not support nested transactions.

commit

public void commit(boolean report_heuristics)
            throws org.omg.CosTransactions.NoTransaction,
                   org.omg.CosTransactions.HeuristicMixed,
                   org.omg.CosTransactions.HeuristicHazard
If there is no transaction associated with the client thread, the NoTransaction exception is raised. If the client thread does not have permission to commit the transaction, the standard exception NO_PERMISSION is raised. (The commit operation may be restricted to the transaction originator in some implementations.) Otherwise, the transaction associated with the client thread is completed. The effect of this request is equivalent to performing the commit operation on the corresponding Terminator object. The client thread transaction context is modified as follows: If the transaction was begun by a thread (invoking begin) in the same execution environment, then the threads transaction context is restored to its state prior to the begin request. Otherwise, the threads transaction context is set to null.

Specified by:
commit in interface org.omg.CosTransactions.CurrentOperations
Throws:
org.omg.CosTransactions.NoTransaction
org.omg.CosTransactions.HeuristicMixed
org.omg.CosTransactions.HeuristicHazard

rollback

public void rollback()
              throws org.omg.CosTransactions.NoTransaction
If there is no transaction associated with the client thread, the NoTransaction exception is raised. If the client thread does not have permission to rollback the transaction, the standard exception NO_PERMISSION is raised. (The rollback operation may be restricted to the transaction originator in some implementations; however, the rollback_only operation, described below, is available to all transaction participants.) Otherwise, the transaction associated with the client thread is rolled back. The effect of this request is equivalent to performing the rollback operation on the corresponding Terminator object. The client thread transaction context is modified as follows: If the transaction was begun by a thread (invoking begin) in the same execution environment, then the thread?s transaction context is restored to its state prior to the begin request. Otherwise, the thread?s transaction context is set to null.

Specified by:
rollback in interface org.omg.CosTransactions.CurrentOperations
Throws:
org.omg.CosTransactions.NoTransaction

rollback_only

public void rollback_only()
                   throws org.omg.CosTransactions.NoTransaction
If there is no transaction associated with the client thread, the NoTransaction exception is raised. Otherwise, the transaction associated with the client thread is modified so that the only possible outcome is to rollback the transaction. The effect of this request is equivalent to performing the rollback_only operation on the corresponding Coordinator object.

Specified by:
rollback_only in interface org.omg.CosTransactions.CurrentOperations
Throws:
org.omg.CosTransactions.NoTransaction

get_status

public org.omg.CosTransactions.Status get_status()
If there is no transaction associated with the client thread, the StatusNoTransaction value is returned. Otherwise, this operation returns the status of the transaction associated with the client thread. The effect of this request is equivalent to performing the get_status operation on the corresponding Coordinator object.

Specified by:
get_status in interface org.omg.CosTransactions.CurrentOperations

get_transaction_name

public java.lang.String get_transaction_name()
If there is no transaction associated with the client thread, an empty string is returned. Otherwise, this operation returns a printable string describing the transaction. The returned string is intended to support debugging. The effect of this request is equivalent to performing the get_transaction_name operation on the corresponding Coordinator object.

Specified by:
get_transaction_name in interface org.omg.CosTransactions.CurrentOperations

set_timeout

public void set_timeout(int seconds)
This operation modifies a state variable associated with the target object that affects the time-out period associated with top-level transactions created by subsequent invocations of the begin operation. If the parameter has a nonzero value n, then top-level transactions created by subsequent invocations of begin will be subject to being rolled back if they do not complete before n seconds after their creation. If the parameter is zero, then no application specified time-out is established.

Specified by:
set_timeout in interface org.omg.CosTransactions.CurrentOperations

get_control

public org.omg.CosTransactions.Control get_control()
If the client thread is not associated with a transaction, a null object reference is returned. Otherwise, a Control object is returned that represents the transaction context currently associated with the client thread. This object can be given to the resume operation to reestablish this context in the same thread or a different thread. The scope within which this object is valid is implementation dependent; at a minimum, it must be usable by the client thread. This operation is not dependent on the state of the transaction; in particular, it does not raise the TRANSACTION_ROLLEDBACK exception.

Specified by:
get_control in interface org.omg.CosTransactions.CurrentOperations

suspend

public org.omg.CosTransactions.Control suspend()
If the client thread is not associated with a transaction, a null object reference is returned. Otherwise, an object is returned that represents the transaction context currently associated with the client thread. This object can be given to the resume operation to reestablish this context in the same thread or a different thread. The scope within which this object is valid is implementation dependent; at a minimum, it must be usable by the client thread. In addition, the client thread becomes associated with no transaction. This operation is not dependent on the state of the transaction; in particular, it does not raise the TRANSACTION_ROLLEDBACK exception.

Specified by:
suspend in interface org.omg.CosTransactions.CurrentOperations

resume

public void resume(org.omg.CosTransactions.Control which)
            throws org.omg.CosTransactions.InvalidControl
If the parameter is a null object reference, the client thread becomes associated with no transaction. Otherwise, if the parameter is valid in the current execution environment, the client thread becomes associated with that transaction (in place of any previous transaction). Otherwise, the InvalidControl exception is raised. This operation is not dependent on the state of the transaction; in particular, it does not raise the TRANSACTION_ROLLEDBACK exception.

Specified by:
resume in interface org.omg.CosTransactions.CurrentOperations
Throws:
org.omg.CosTransactions.InvalidControl

get_coordinator_ior

public java.lang.String get_coordinator_ior()
                                     throws org.omg.CORBA.MARSHAL
This operation is used to return the Coordinator ior

Throws:
org.omg.CORBA.MARSHAL

getPropagationContext

public org.omg.CosTransactions.PropagationContext getPropagationContext()
                                                                 throws org.omg.CORBA.MARSHAL
This operation is used to return the propagation context

Throws:
org.omg.CORBA.MARSHAL

push_txcontext

public void push_txcontext(org.omg.CosTransactions.PropagationContext pctx)
This operation is used to push a propagation context in a stack. When a sub transaction begins, the parent propagation context must be stored in a stack.


pop_txcontext

public void pop_txcontext()
This operation restores a previously saved propagation context. For example, when a sub transaction is completed, the parent propagation context is restored.


print

public void print(java.lang.String from,
                  java.lang.String msg)
Displays a trace


fatal

public void fatal(java.lang.String from,
                  java.lang.String msg)
Displays a trace and throw a INTERNAL exception...


factory

public org.omg.CosTransactions.TransactionFactory factory()
Returns the transaction factory



Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.