com.sun.jts.jtsxa
Class OTSResourceImpl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by com.sun.jts.codegen.jtsxa.OTSResourcePOA
          extended by com.sun.jts.jtsxa.OTSResourceImpl
All Implemented Interfaces:
OTSResource, OTSResourceOperations, java.io.Serializable, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.InvokeHandler, org.omg.CosTransactions.Resource, org.omg.CosTransactions.ResourceOperations

public class OTSResourceImpl
extends OTSResourcePOA
implements OTSResource

See Also:
Serialized Form

Constructor Summary
OTSResourceImpl(Xid xid, XAResource xaRes, TransactionState tranState)
          Construct an XAResource object.
 
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()
          Ensure that the Native XA interface is initialized.
 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 commit_one_phase()
          Commit a transaction, using one-phase optimization.
 void commit()
          Commit a transaction.
 void forget()
          The resource manager can forget all knowledge of the transaction.
 OTSResource getCORBAObjReference()
          Returns the CORBA Object which represents this object.
 org.omg.CosTransactions.otid_t getGlobalTID()
          Return the global transaction identifier.
 org.omg.CosTransactions.Vote prepare()
          Prepare a transaction.
 void rollback()
          Rollback a transaction.
 java.lang.String toString()
           
 
Methods inherited from class com.sun.jts.codegen.jtsxa.OTSResourcePOA
_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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OTSResourceImpl

public OTSResourceImpl(Xid xid,
                       XAResource xaRes,
                       TransactionState tranState)
Construct an XAResource object.

Parameters:
xid - the global transaction identifier
xaRes - the XAServer object associated with the resource manager
Method Detail

commit

public void commit()
            throws org.omg.CosTransactions.NotPrepared,
                   org.omg.CosTransactions.HeuristicRollback,
                   org.omg.CosTransactions.HeuristicHazard,
                   org.omg.CosTransactions.HeuristicMixed,
                   org.omg.CORBA.SystemException
Commit a transaction.

Specified by:
commit in interface org.omg.CosTransactions.ResourceOperations
Throws:
org.omg.CosTransactions.NotPrepared - the resource manager has not been called for prepare.
org.omg.CosTransactions.HeuristicRollback - a heuristic decision has been made, and the resource rolledback.
org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.
org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager.

commit_one_phase

public void commit_one_phase()
                      throws org.omg.CosTransactions.HeuristicHazard,
                             org.omg.CORBA.SystemException
Commit a transaction, using one-phase optimization.

Specified by:
commit_one_phase in interface org.omg.CosTransactions.ResourceOperations
Throws:
org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager.

forget

public void forget()
The resource manager can forget all knowledge of the transaction.

Specified by:
forget in interface org.omg.CosTransactions.ResourceOperations

prepare

public org.omg.CosTransactions.Vote prepare()
                                     throws org.omg.CosTransactions.HeuristicHazard,
                                            org.omg.CosTransactions.HeuristicMixed
Prepare a transaction.

This is the first phase of the two-phase commit protocol.

Specified by:
prepare in interface org.omg.CosTransactions.ResourceOperations
Throws:
org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.

rollback

public void rollback()
              throws org.omg.CosTransactions.HeuristicCommit,
                     org.omg.CosTransactions.HeuristicMixed,
                     org.omg.CosTransactions.HeuristicHazard,
                     org.omg.CORBA.SystemException
Rollback a transaction.

Specified by:
rollback in interface org.omg.CosTransactions.ResourceOperations
Throws:
org.omg.CosTransactions.HeuristicCommit - a heuristic decision has been made, and the resource committed.
org.omg.CosTransactions.HeuristicHazard - a heuristic decision has been made, but the disposition of the resource is unknown.
org.omg.CosTransactions.HeuristicMixed - a heuristic decision has been made, some updates have been commited and others rolled back.
org.omg.CORBA.SystemException - an unindentified error has been reported by the resource manager

getGlobalTID

public org.omg.CosTransactions.otid_t getGlobalTID()
Return the global transaction identifier.

Specified by:
getGlobalTID in interface OTSResourceOperations
Returns:
the global transaction identifier as defined by org.omg.CosTransactions.otid_t

getCORBAObjReference

public OTSResource getCORBAObjReference()
Returns the CORBA Object which represents this object.

Returns:
The CORBA object.

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

_duplicate

public org.omg.CORBA.Object _duplicate()
Ensure that the Native XA interface is initialized. Invoke the nativeXA initializer to ensure that this resource has had any necessary initialization performed on this thread. This will be necessary in the server environment where we have not been invoked via a transactional flow, and we may very well be executing on a new thread. The resource manager may have specific requirements, but it should not matter if initialization is performed twice. We also call down to the native interface informing that the transaction is about to complete. This permits any database specific action to be performed.prior to the actual xa operations marking completion. private void ensureInitialized() { // COMMENT(Ram J) - we do not support native xa drivers. if (this.xaRes instanceof NativeXAResourceImpl) { NativeXAResourceImpl xaResImpl = (NativeXAResourceImpl) xaRes; xaResImpl.nativeXA.initialize(xaResImpl, xaResImpl.xaswitch, xaResImpl.open, xaResImpl.close, xaResImpl.getRMID(), false); xaResImpl.nativeXA.aboutToComplete(xaResImpl, (XID) xid); } }

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.