com.sun.jts.CosTransactions
Class ControlImpl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by com.sun.jts.codegen.otsidl.JControlPOA
          extended by com.sun.jts.CosTransactions.ControlImpl
All Implemented Interfaces:
JControlOperations, java.io.Serializable, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CosTransactions.Control, org.omg.CosTransactions.ControlOperations

public class ControlImpl
extends JControlPOA
implements org.omg.CosTransactions.Control

The ControlImpl interface is our implementation of the standard Control interface. It provides operations to set and subsequently obtain the Terminator and Coordinator objects from the given context. Our implementation also provides a method to obtain the corresponding transaction identifiers, and stacking methods.

Version:
0.01
Author:
Simon Holdsworth, IBM Corporation
See Also:
, Serialized Form

Field Summary
protected  int association
           
protected  org.omg.CosTransactions.PropagationContext cachedContext
           
protected  com.sun.jts.CosTransactions.CoordinatorImpl coord
           
protected  org.omg.CosTransactions.Coordinator coordRef
           
protected  GlobalTID globalTID
           
protected  boolean inSuspended
           
protected  java.lang.Long localTID
           
protected  int outgoing
           
protected  boolean representsRemote
           
protected  ControlImpl stacked
           
protected  boolean temporary
           
protected  com.sun.jts.CosTransactions.TerminatorImpl term
           
protected  org.omg.CosTransactions.Terminator termRef
           
protected  org.omg.CosTransactions.Status tranState
           
 
Method Summary
 org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, java.lang.String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result)
           
 org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, java.lang.String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result, org.omg.CORBA.ExceptionList exceptions, org.omg.CORBA.ContextList contexts)
           
 org.omg.CORBA.Object _duplicate()
           
 org.omg.CORBA.DomainManager[] _get_domain_managers()
           
 org.omg.CORBA.Object _get_interface_def()
           
 org.omg.CORBA.Policy _get_policy(int policy_type)
           
 int _hash(int maximum)
           
 boolean _is_a(java.lang.String repository_id)
           
 boolean _is_equivalent(org.omg.CORBA.Object that)
           
 boolean _non_existent()
           
 void _release()
           
 org.omg.CORBA.Request _request(java.lang.String operation)
           
 org.omg.CORBA.Object _set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)
           
 void doFinalize()
          Cleans up the state of the object.
 boolean equals(java.lang.Object o)
          Added to prevent null delegate problem.
 org.omg.CosTransactions.Coordinator get_coordinator()
          Returns the Coordinator for the transaction.
 org.omg.CosTransactions.Coordinator get_localCoordinator()
          Returns the Coordinator for the transaction.
 org.omg.CosTransactions.Terminator get_localTerminator()
           
 org.omg.CosTransactions.Terminator get_terminator()
          Returns the Terminator object for the transaction.
 GlobalTID getGlobalTID()
          Returns the identifier that globally represents the transaction
 org.omg.CosTransactions.otid_t getGlobalTID(org.omg.CosTransactions.StatusHolder status)
          Returns the identifier that globally represents the transaction, and a value that indicates the state of the transaction.
 long getLocalTID(org.omg.CosTransactions.StatusHolder status)
          Returns the identifier that locally represents the transaction, and a value that indicates the state of the transaction.
 org.omg.CosTransactions.Status getTranState()
          Returns the state of the transaction as the Control object knows it.
 int hashCode()
          Added because this class overrides equals() method.
static ControlImpl servant(JControl control)
          Returns the ControlImpl which serves the given object.
 void setTranState(org.omg.CosTransactions.Status newState)
          Sets the state of the transaction as the Control object knows it.
 
Methods inherited from class com.sun.jts.codegen.otsidl.JControlPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

temporary

protected boolean temporary

inSuspended

protected boolean inSuspended

tranState

protected org.omg.CosTransactions.Status tranState

coord

protected com.sun.jts.CosTransactions.CoordinatorImpl coord

coordRef

protected org.omg.CosTransactions.Coordinator coordRef

term

protected com.sun.jts.CosTransactions.TerminatorImpl term

termRef

protected org.omg.CosTransactions.Terminator termRef

stacked

protected ControlImpl stacked

globalTID

protected GlobalTID globalTID

localTID

protected java.lang.Long localTID

representsRemote

protected boolean representsRemote

cachedContext

protected org.omg.CosTransactions.PropagationContext cachedContext

outgoing

protected int outgoing

association

protected int association
Method Detail

doFinalize

public void doFinalize()
Cleans up the state of the object.

Parameters:
-
See Also:

getGlobalTID

public GlobalTID getGlobalTID()
Returns the identifier that globally represents the transaction

Parameters:
-
Returns:
The global identifier.
See Also:

getGlobalTID

public org.omg.CosTransactions.otid_t getGlobalTID(org.omg.CosTransactions.StatusHolder status)
                                            throws org.omg.CORBA.SystemException
Returns the identifier that globally represents the transaction, and a value that indicates the state of the transaction.

Specified by:
getGlobalTID in interface JControlOperations
Parameters:
status - An object to hold the status value, or null.
Returns:
The global identifier.
Throws:
org.omg.CORBA.SystemException - An error occurred. The minor code indicates the reason for the exception.
See Also:

getLocalTID

public long getLocalTID(org.omg.CosTransactions.StatusHolder status)
                 throws org.omg.CORBA.SystemException
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.

Specified by:
getLocalTID in interface JControlOperations
Parameters:
status - An object to hold the status value, or null.
Returns:
The local transaction identifier.
Throws:
org.omg.CORBA.SystemException - An error occurred. The minor code indicates the reason for the exception.
See Also:

get_terminator

public org.omg.CosTransactions.Terminator get_terminator()
                                                  throws org.omg.CosTransactions.Unavailable,
                                                         org.omg.CORBA.SystemException
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.

Specified by:
get_terminator in interface org.omg.CosTransactions.ControlOperations
Parameters:
-
Returns:
The Terminator for the transaction.
Throws:
org.omg.CosTransactions.Unavailable - The Terminator object is not available.
org.omg.CORBA.SystemException - The operation failed.
See Also:

get_localTerminator

public org.omg.CosTransactions.Terminator get_localTerminator()
                                                       throws org.omg.CosTransactions.Unavailable,
                                                              org.omg.CORBA.SystemException
Throws:
org.omg.CosTransactions.Unavailable
org.omg.CORBA.SystemException

get_coordinator

public org.omg.CosTransactions.Coordinator get_coordinator()
                                                    throws org.omg.CosTransactions.Unavailable,
                                                           org.omg.CORBA.SystemException
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.

Specified by:
get_coordinator in interface org.omg.CosTransactions.ControlOperations
Parameters:
-
Returns:
The Coordinator for the transaction.
Throws:
org.omg.CosTransactions.Unavailable - The Coordinator is not available.
org.omg.CORBA.SystemException - The operation failed.
See Also:

get_localCoordinator

public org.omg.CosTransactions.Coordinator get_localCoordinator()
                                                         throws org.omg.CosTransactions.Unavailable,
                                                                org.omg.CORBA.SystemException
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.

Parameters:
-
Returns:
The Coordinator for the transaction.
Throws:
org.omg.CosTransactions.Unavailable - The Coordinator is not available.
org.omg.CORBA.SystemException - The operation failed.
See Also:

getTranState

public org.omg.CosTransactions.Status getTranState()
Returns the state of the transaction as the Control object knows it.

Specified by:
getTranState in interface JControlOperations
Parameters:
-
Returns:
The transaction state.
See Also:

setTranState

public void setTranState(org.omg.CosTransactions.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.

Specified by:
setTranState in interface JControlOperations
Parameters:
int - The new state.
See Also:

servant

public static final ControlImpl servant(JControl control)
Returns the ControlImpl which serves the given object.

Parameters:
The - CORBA Object.
Returns:
The ControlImpl object which serves it.
See Also:

equals

public boolean equals(java.lang.Object o)
Added to prevent null delegate problem.

Overrides:
equals in class java.lang.Object
Parameters:
-
Returns:
See Also:

hashCode

public int hashCode()
Added because this class overrides equals() method.

Overrides:
hashCode in class java.lang.Object

_duplicate

public org.omg.CORBA.Object _duplicate()
Specified by:
_duplicate in interface org.omg.CORBA.Object

_release

public void _release()
Specified by:
_release in interface org.omg.CORBA.Object

_is_a

public boolean _is_a(java.lang.String repository_id)
Specified by:
_is_a in interface org.omg.CORBA.Object
Overrides:
_is_a in class org.omg.PortableServer.Servant

_is_equivalent

public boolean _is_equivalent(org.omg.CORBA.Object that)
Specified by:
_is_equivalent in interface org.omg.CORBA.Object

_non_existent

public boolean _non_existent()
Specified by:
_non_existent in interface org.omg.CORBA.Object
Overrides:
_non_existent in class org.omg.PortableServer.Servant

_hash

public int _hash(int maximum)
Specified by:
_hash in interface org.omg.CORBA.Object

_request

public org.omg.CORBA.Request _request(java.lang.String operation)
Specified by:
_request in interface org.omg.CORBA.Object

_create_request

public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx,
                                             java.lang.String operation,
                                             org.omg.CORBA.NVList arg_list,
                                             org.omg.CORBA.NamedValue result)
Specified by:
_create_request in interface org.omg.CORBA.Object

_create_request

public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx,
                                             java.lang.String operation,
                                             org.omg.CORBA.NVList arg_list,
                                             org.omg.CORBA.NamedValue result,
                                             org.omg.CORBA.ExceptionList exceptions,
                                             org.omg.CORBA.ContextList contexts)
Specified by:
_create_request in interface org.omg.CORBA.Object

_get_interface_def

public org.omg.CORBA.Object _get_interface_def()
Specified by:
_get_interface_def in interface org.omg.CORBA.Object
Overrides:
_get_interface_def in class org.omg.PortableServer.Servant

_get_policy

public org.omg.CORBA.Policy _get_policy(int policy_type)
Specified by:
_get_policy in interface org.omg.CORBA.Object

_get_domain_managers

public org.omg.CORBA.DomainManager[] _get_domain_managers()
Specified by:
_get_domain_managers in interface org.omg.CORBA.Object

_set_policy_override

public org.omg.CORBA.Object _set_policy_override(org.omg.CORBA.Policy[] policies,
                                                 org.omg.CORBA.SetOverrideType set_add)
Specified by:
_set_policy_override in interface org.omg.CORBA.Object


Copyright © 2012 GlassFish Community. All Rights Reserved.