Class ControlImple
java.lang.Object
org.omg.PortableServer.Servant
com.arjuna.ArjunaOTS.ActionControlPOA
com.arjuna.ats.internal.jts.orbspecific.ControlImple
- All Implemented Interfaces:
ActionControlOperations
,org.omg.CORBA.portable.InvokeHandler
,ControlOperations
- Direct Known Subclasses:
ServerControl
An implementation of CosTransactions::Control
- Since:
- JTS 1.0.
- Version:
- $Id: ControlImple.java 2342 2006-03-30 13:06:17Z $
- Author:
- Mark Little (mark@arjuna.com)
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected ActionControl
protected Control
protected Coordinator
protected Terminator
protected Uid
protected ArjunaTransactionImple
protected ArjunaTransactionPOATie
static Hashtable
-
Constructor Summary
ModifierConstructorDescriptionprotected
Protected constructor for inheritance.ControlImple
(Control parentCon, ArjunaTransactionImple parentTran) Create a new instance with the specified parent.protected
ControlImple
(Coordinator coordinator, Terminator terminator) This is used for implicit context propagation, and for Current.resume on remote transactions.protected
ControlImple
(Coordinator coordinator, Terminator terminator, Uid uid) protected
ControlImple
(Coordinator coordinator, Terminator terminator, Control parentControl, Uid uid) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Transaction needs to call these methods to enable garbage collection to occur.protected void
protected void
canDestroy
(boolean force) Generally we do not want to destroy the transaction if it is doing some work, or other threads are still registered with it.protected final void
void
destroy()
destroy should only be called for remote Control objects.protected final void
duplicateTransactionHandle
(Coordinator coord, Terminator term) boolean
void
finalize()
get_uid()
Used for garbage collection so we can keep a list of controls and delete local ones.final Control
In the case that the transaction is terminated by the reaper then it will also be tidied up.final ArjunaTransactionImple
protected boolean
void
set_coordinator
(Coordinator coordinator) void
set_terminator
(Terminator terminator) protected final void
tidyup()
No need to protect with mutex since only called from destroy (and destructor), which is protected with a mutex.toString()
Methods inherited from class com.arjuna.ArjunaOTS.ActionControlPOA
_all_interfaces, _invoke, _this, _this
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
-
Field Details
-
allControls
-
_theTerminator
-
_theCoordinator
-
_parentControl
-
_transactionHandle
-
_theUid
-
_myControl
-
_transactionImpl
-
_destroyed
protected boolean _destroyed
-
-
Constructor Details
-
ControlImple
Create a new instance with the specified parent. -
ControlImple
This is used for implicit context propagation, and for Current.resume on remote transactions. In both cases we need to create a local control given a remove coordinator and terminator, but we can't create a transaction handle. -
ControlImple
-
ControlImple
protected ControlImple(Coordinator coordinator, Terminator terminator, Control parentControl, Uid uid) -
ControlImple
protected ControlImple()Protected constructor for inheritance. The derived classes are responsible for setting everything up, including adding the control to the list of controls and assigning the Uid variable.
-
-
Method Details
-
finalize
-
get_uid
Used for garbage collection so we can keep a list of controls and delete local ones. -
getImplHandle
- Returns:
- the transaction implementation.
-
getControl
- Returns:
- the CORBA Control object.
-
get_terminator
- Throws:
org.omg.CORBA.SystemException
Unavailable
-
get_coordinator
- Throws:
org.omg.CORBA.SystemException
Unavailable
-
set_terminator
- Throws:
org.omg.CORBA.SystemException
Unavailable
-
set_coordinator
public void set_coordinator(Coordinator coordinator) throws org.omg.CORBA.SystemException, Unavailable - Throws:
org.omg.CORBA.SystemException
Unavailable
-
getParentControl
- Throws:
Unavailable
org.omg.CORBA.SystemException
-
destroy
public void destroy() throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemExceptiondestroy should only be called for remote Control objects. Destroy them locally by calling DESTROY_IMPL. Since we assume that a factory will either be remote or local, we can destroy this object and rely upon the ORB to return an exception to subsequent clients which indicates they no longer have a valid reference.- Throws:
ActiveTransaction
ActiveThreads
BadControl
Destroyed
org.omg.CORBA.SystemException
-
getParentImple
-
toString
-
equals
-
getFinalStatus
In the case that the transaction is terminated by the reaper then it will also be tidied up. This means that the internal handle to the real transaction instance will be nulled out. In that case we cache the status just before removing the handle and this method can be used to obtain it.- Returns:
- the final termination status of the transaction.
- Throws:
IllegalStateException
- thrown if the transaction is still available.
-
canDestroy
protected void canDestroy() throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemException- Throws:
ActiveTransaction
ActiveThreads
BadControl
Destroyed
org.omg.CORBA.SystemException
-
canDestroy
protected void canDestroy(boolean force) throws ActiveTransaction, ActiveThreads, BadControl, Destroyed, org.omg.CORBA.SystemException Generally we do not want to destroy the transaction if it is doing some work, or other threads are still registered with it. However, for some situations (e.g., the transaction reaper) we must terminate the transaction regardless.- Throws:
ActiveTransaction
ActiveThreads
BadControl
Destroyed
org.omg.CORBA.SystemException
-
createTransactionHandle
protected final void createTransactionHandle() -
duplicateTransactionHandle
-
addControl
protected boolean addControl()Transaction needs to call these methods to enable garbage collection to occur. Note, we assume that one ContorlImple per transaction is maintained per address space, so that overwriting a previously added ControlImple for the same tx is not possible. -
removeControl
protected boolean removeControl() -
tidyup
protected final void tidyup()No need to protect with mutex since only called from destroy (and destructor), which is protected with a mutex. Do not call directly without synchronizing.
-