Methods Summary |
---|
public Request | _create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result)
throw no_implement;
|
public Request | _create_request(Context ctx, java.lang.String operation, NVList arg_list, NamedValue result, ExceptionList exceptions, ContextList contexts)
throw no_implement;
|
public org.omg.CORBA.Object | _duplicate()
throw no_implement;
|
public org.omg.CORBA.DomainManager[] | _get_domain_managers()
throw no_implement;
|
public org.omg.CORBA.Object | _get_interface_def()
throw no_implement;
|
public org.omg.CORBA.Policy | _get_policy(int policy_type)
throw no_implement;
|
public int | _hash(int maximum)
throw no_implement;
|
public boolean | _is_a(java.lang.String repository_id)
throw no_implement;
|
public boolean | _is_equivalent(org.omg.CORBA.Object that)
throw no_implement;
|
public boolean | _non_existent()
throw no_implement;
|
public void | _release()
throw no_implement;
|
public Request | _request(java.lang.String operation)
throw no_implement;
|
public org.omg.CORBA.Object | _set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)
throw no_implement;
|
synchronized boolean | decrementAssociation()Decrement the thread association count.
boolean result = (association > 0);
if( result ) association--;
return result;
|
synchronized boolean | decrementOutgoing()Decrement the incomplete asynchronous request counter.
boolean result = (outgoing > 0);
if( result ) outgoing--;
return result;
|
final synchronized void | destroy()Destroys the ControlImpl object.
// GDH: We have no desire to destroy an underlying remote control object, instead we
// release it. We will finalise the local control wrapper below
if ( thisRef != null && Configuration.getProxyChecker().isProxy(thisRef)) {
thisRef._release();
} else {
if( poa != null &&
thisRef != null )
try {
poa.deactivate_object(poa.reference_to_id(thisRef));
thisRef = null;
} catch( Exception exc ) {
_logger.log(Level.WARNING,"jts.object_destroy_error","Control");
}
}
doFinalize();
|
public synchronized void | doFinalize()Cleans up the state of the object.
// Ensure that this object does not appear in the suspended set.
if( inSuspended )
CurrentTransaction.removeSuspended(this);
inSuspended = false;
// If there is a Terminator reference, destroy the Terminator.
if( term != null ) term.destroy();
// Remove the reference from the map.
/* TN - do not nullify the references yet
thisRef = null;
coord = null;
coordRef = null;
term = null;
termRef = null;
stacked = null;
globalTID = null;
localTID = null;
*/
|
void | dump()Dumps the state of the object.
|
public boolean | equals(java.lang.Object o)Added to prevent null delegate problem.
return this == o;
|
public GlobalTID | getGlobalTID()Returns the identifier that globally represents the transaction
return globalTID;
|
public synchronized otid_t | getGlobalTID(StatusHolder status)Returns the identifier that globally represents the transaction, and a
value that indicates the state of the transaction.
otid_t result = null;
// Return the transaction state.
if( status != null )
status.value = tranState;
// If the object is asked for its OMGtid and has none, raise an exception.
if( globalTID == null ) {
INTERNAL exc = new INTERNAL(MinorCode.NoGlobalTID,
CompletionStatus.COMPLETED_NO);
throw exc;
}
else
result = globalTID.realTID;
return result;
|
public synchronized long | getLocalTID(StatusHolder status)Returns the identifier that locally represents the transaction, and a value
that indicates the state of the transaction.
If the transaction represented by the Control object has been completed,
the identifier is still returned if possible.
long result = 0;
// Return the transaction state.
if( status != null )
status.value = tranState;
// If the internal id has not been defined, raise an exception.
if( localTID == null ) {
INTERNAL exc = new INTERNAL(MinorCode.NoGlobalTID,
CompletionStatus.COMPLETED_NO);
throw exc;
} else {
result = localTID.longValue();
}
return result;
|
synchronized PropagationContext | getTXContext()Returns the transaction context for the Coordinator.
PropagationContext result = null;
// If the ControlImpl represents a remote transaction, then use the cached
// context, or get one from the Coordinator if there is no cached context.
if( representsRemote ) {
if( cachedContext == null )
try {
cachedContext = coordRef.get_txcontext();
} catch( OBJECT_NOT_EXIST exc ) {
TRANSACTION_ROLLEDBACK ex2 = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO);
throw ex2;
}
result = cachedContext;
}
// For local transactions, get the context from the Coordinator.
else
result = coord.get_txcontext();
return result;
|
public synchronized Status | getTranState()Returns the state of the transaction as the Control object knows it.
Status result = tranState;
return result;
|
public synchronized Coordinator | get_coordinator()Returns the Coordinator for the transaction.
If the transaction has been completed, an appropriate exception is raised.
This operation is part of the OMG interface and must not return
any exceptions other than those defined in the OMG interface.
Coordinator result = coordRef;
// If the transaction has been completed, then raise an exception.
// Raise either TRANSACTION_ROLLEDBACK or INVALID_TRANSACTION depending on
// whether the transaction has aborted.
if( tranState == Status.StatusCommitted ) {
INVALID_TRANSACTION exc = new INVALID_TRANSACTION(MinorCode.Completed,
CompletionStatus.COMPLETED_NO);
throw exc;
}
if( tranState == Status.StatusRolledBack ) {
TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO);
throw exc;
}
// If there is no Coordinator reference, but a local Coordinator, then get its
// reference and remember it.
if( coordRef == null && coord != null ) {
coordRef = coord.object();
result = coordRef;
}
// If there is no reference available, throw the Unavailable exception.
if( result == null ) {
Unavailable exc = new Unavailable();
throw exc;
}
return result;
|
public synchronized Coordinator | get_localCoordinator()Returns the Coordinator for the transaction.
If the transaction has been completed, an appropriate exception is raised.
This operation is part of the OMG interface and must not return
any exceptions other than those defined in the OMG interface.
Coordinator result = (Coordinator) coord;
// If the transaction has been completed, then raise an exception.
// Raise either TRANSACTION_ROLLEDBACK or INVALID_TRANSACTION depending on
// whether the transaction has aborted.
if( tranState == Status.StatusCommitted ) {
INVALID_TRANSACTION exc = new INVALID_TRANSACTION(MinorCode.Completed,
CompletionStatus.COMPLETED_NO);
throw exc;
}
if( tranState == Status.StatusRolledBack ) {
TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO);
throw exc;
}
// If there is no reference available, throw the Unavailable exception.
if( result == null ) {
Unavailable exc = new Unavailable();
throw exc;
}
return result;
|
public synchronized java.lang.Terminator | get_localTerminator()
Terminator result = (Terminator) term;
// If the transaction has been completed, then raise an exception.
// Raise either TRANSACTION_ROLLEDBACK or INVALID_TRANSACTION depending on
// whether the transaction has aborted.
if( tranState == Status.StatusCommitted ) {
INVALID_TRANSACTION exc = new INVALID_TRANSACTION(MinorCode.Completed,
CompletionStatus.COMPLETED_NO);
throw exc;
}
if( tranState == Status.StatusRolledBack ) {
TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO);
throw exc;
}
// If there is no reference available, throw the Unavailable exception.
if (result == null) {
Unavailable exc = new Unavailable();
throw exc;
}
return result;
|
public synchronized java.lang.Terminator | get_terminator()Returns the Terminator object for the transaction.
We raise the Unavailable exception when there is no Terminator.
If the transaction has been completed, an appropriate exception is raised.
This operation is part of the OMG interface and must not return any
exceptions other than those defined in the OMG interface.
Terminator result = termRef;
// If the transaction has been completed, then raise an exception.
// Raise either TRANSACTION_ROLLEDBACK or INVALID_TRANSACTION depending on
// whether the transaction has aborted.
if( tranState == Status.StatusCommitted ) {
INVALID_TRANSACTION exc = new INVALID_TRANSACTION(MinorCode.Completed,
CompletionStatus.COMPLETED_NO);
throw exc;
}
if( tranState == Status.StatusRolledBack ) {
TRANSACTION_ROLLEDBACK exc = new TRANSACTION_ROLLEDBACK(0,CompletionStatus.COMPLETED_NO);
throw exc;
}
// If there is no Terminator reference, but a local Terminator, then get its
// reference and remember it.
if( termRef == null && term != null ) {
termRef = term.object();
result = termRef;
}
// If there is no reference available, throw the Unavailable exception.
if( result == null ) {
Unavailable exc = new Unavailable();
throw exc;
}
return result;
|
synchronized void | incrementAssociation()Increment the thread association count.
association++;
|
synchronized void | incrementOutgoing()Increment the incomplete asynchronous request counter.
outgoing++;
|
synchronized boolean | isAssociated()This operation returns a value which indicates that this ControlImpl instance
is associated with one or more threads.
boolean result = (association != 0);
return result;
|
synchronized boolean | isOutgoing()This operation returns a value indicating that asynchonrous requests issued
within the context of the current ControlImpl instance have not yet
completed.
boolean result = (outgoing != 0);
return result;
|
synchronized int | numAssociated()This operation returns the number of thread associations
int result = association;
return result;
|
final synchronized Control | object()Returns the CORBA Object which represents this object.
if( thisRef == null ) {
if( poa == null )
poa = Configuration.getPOA("transient"/*#Frozen*/);
try {
poa.activate_object(this);
thisRef = ControlHelper.narrow(poa.servant_to_reference(this));
} catch( ServantAlreadyActive sexc ) {
_logger.log(Level.SEVERE,"jts.create_control_object_error",sexc);
String msg = LogFormatter.getLocalizedMessage(_logger,
"jts.create_control_object_error");
throw new org.omg.CORBA.INTERNAL(msg);
} catch( ServantNotActive snexc ) {
_logger.log(Level.SEVERE,"jts.create_control_object_error",snexc);
String msg = LogFormatter.getLocalizedMessage(_logger,
"jts.create_control_object_error");
throw new org.omg.CORBA.INTERNAL(msg);
} catch( Exception exc ) {
_logger.log(Level.SEVERE,"jts.create_control_object_error",exc);
String msg = LogFormatter.getLocalizedMessage(_logger,
"jts.create_control_object_error");
throw new org.omg.CORBA.INTERNAL(msg);
}
}
return thisRef;
|
synchronized com.sun.jts.CosTransactions.ControlImpl | popAborted()Locates the first stacked ancestor which has not aborted. If there is no
such ancestor the operation returns null.
// Start with this object's stacked Control.
ControlImpl result = stacked;
boolean validTID = false;
StatusHolder outStatus = new StatusHolder();
while( result != null && !validTID ) {
// Get the local transaction identifier for the stacked Control object,
// and ask the RecoveryManager if it represents a valid transaction.
Long localTID = null;
try {
localTID = new Long(result.getLocalTID(outStatus)); }
catch( Throwable exc ) {}
validTID = RecoveryManager.validLocalTID(localTID);
// If the transaction identifier is not valid, then the transaction must have
// rolled back, so discard it and get its stacked Control object, if any.
if( !validTID ) {
// Get the stacked Control object from the one that represents a rolled
// back transaction, and try to resume that one instead.
ControlImpl stacked = result.popControl(outStatus);
result.destroy();
// Discard the rolled-back Control object and continue until a valid one, or
// no stacked Control is found.
result = stacked;
}
}
return result;
|
synchronized com.sun.jts.CosTransactions.ControlImpl | popControl(StatusHolder status)Returns a reference to the stacked ControlImpl if there is one, otherwise
returns a NULL reference.
A value is returned that indicates the state of the transaction.
If the transaction represented by the Control object has been completed,
the reference is still returned if possible.
The stacked Control object is removed from the stack.
ControlImpl result = null;
// Return the transaction state.
if( status != null )
status.value = tranState;
// Get the value of the stacked Control object.
// Remove the stacked Control object (if any).
result = stacked;
stacked = null;
return result;
|
synchronized void | pushControl(com.sun.jts.CosTransactions.ControlImpl control, StatusHolder status)Stacks the given ControlImpl on the target of the operation, so that it can
later be restored, and returns a value that indicates the state of the
transaction.
If there is already a stacked ControlImpl object, the operation throws an
exception. If the transaction has already completed, no stacking is done.
if( tranState == Status.StatusActive ) {
// If a Control object is already stacked on this one, raise an exception.
if( stacked != null ) {
INTERNAL exc = new INTERNAL(MinorCode.AlreadyStacked,
CompletionStatus.COMPLETED_NO);
throw exc;
}
// Make the stacked Control object the given one.
else
stacked = control;
}
// Return the transaction state.
if( status != null )
status.value = tranState;
|
synchronized boolean | representsRemoteControl()Determines whether the ControlImpl object represents a remote Control object
or a local one.
boolean result = representsRemote;
return result;
|
public static final synchronized com.sun.jts.CosTransactions.ControlImpl | servant(JControl control)Returns the ControlImpl which serves the given object.
ControlImpl result = null;
// GDH we will not be able to obtain the
// servant from our local POA for a proxy control object.
// so return null
if ( control != null && Configuration.getProxyChecker().isProxy(control)) {
return result;
}
if( control instanceof ControlImpl ) {
result = (ControlImpl)control;
} else if( poa != null )
try {
result = (ControlImpl)poa.reference_to_servant(control);
if( result.thisRef == null )
result.thisRef = control;
} catch( Exception exc ) {
_logger.log(Level.WARNING,"jts.cannot_locate_servant","Control");
}
return result;
|
public synchronized void | setTranState(Status newState)Sets the state of the transaction as the Control object knows it.
No checking is done to verify the state change is valid.
tranState = newState;
|