Package com.sun.jts.jtsxa
Class OTSResourceImpl
- java.lang.Object
-
- org.omg.PortableServer.Servant
-
- com.sun.jts.codegen.jtsxa.OTSResourcePOA
-
- com.sun.jts.jtsxa.OTSResourceImpl
-
- All Implemented Interfaces:
OTSResource,OTSResourceOperations,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
Constructors Constructor Description OTSResourceImpl(Xid xid, XAResource xaRes, TransactionState tranState)Construct an XAResource object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.omg.CORBA.Request_create_request(org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result)org.omg.CORBA.Request_create_request(org.omg.CORBA.Context ctx, 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(String repository_id)boolean_is_equivalent(org.omg.CORBA.Object that)boolean_non_existent()void_release()org.omg.CORBA.Request_request(String operation)org.omg.CORBA.Object_set_policy_override(org.omg.CORBA.Policy[] policies, org.omg.CORBA.SetOverrideType set_add)voidcommit()Commit a transaction.voidcommit_one_phase()Commit a transaction, using one-phase optimization.voidforget()The resource manager can forget all knowledge of the transaction.OTSResourcegetCORBAObjReference()Returns the CORBA Object which represents this object.org.omg.CosTransactions.otid_tgetGlobalTID()Return the global transaction identifier.org.omg.CosTransactions.Voteprepare()Prepare a transaction.voidrollback()Rollback a transaction.StringtoString()-
Methods inherited from class com.sun.jts.codegen.jtsxa.OTSResourcePOA
_all_interfaces, _invoke, _this, _this
-
-
-
-
Constructor Detail
-
OTSResourceImpl
public OTSResourceImpl(Xid xid, XAResource xaRes, TransactionState tranState)
Construct an XAResource object.- Parameters:
xid- the global transaction identifierxaRes- 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.SystemExceptionCommit a transaction.- Specified by:
commitin interfaceorg.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.SystemExceptionCommit a transaction, using one-phase optimization.- Specified by:
commit_one_phasein interfaceorg.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:
forgetin interfaceorg.omg.CosTransactions.ResourceOperations
-
prepare
public org.omg.CosTransactions.Vote prepare() throws org.omg.CosTransactions.HeuristicHazard, org.omg.CosTransactions.HeuristicMixedPrepare a transaction.This is the first phase of the two-phase commit protocol.
- Specified by:
preparein interfaceorg.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.SystemExceptionRollback a transaction.- Specified by:
rollbackin interfaceorg.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:
getGlobalTIDin interfaceOTSResourceOperations- 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.
-
_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:
_duplicatein interfaceorg.omg.CORBA.Object
-
_release
public void _release()
- Specified by:
_releasein interfaceorg.omg.CORBA.Object
-
_is_a
public boolean _is_a(String repository_id)
- Specified by:
_is_ain interfaceorg.omg.CORBA.Object- Overrides:
_is_ain classorg.omg.PortableServer.Servant
-
_is_equivalent
public boolean _is_equivalent(org.omg.CORBA.Object that)
- Specified by:
_is_equivalentin interfaceorg.omg.CORBA.Object
-
_non_existent
public boolean _non_existent()
- Specified by:
_non_existentin interfaceorg.omg.CORBA.Object- Overrides:
_non_existentin classorg.omg.PortableServer.Servant
-
_hash
public int _hash(int maximum)
- Specified by:
_hashin interfaceorg.omg.CORBA.Object
-
_request
public org.omg.CORBA.Request _request(String operation)
- Specified by:
_requestin interfaceorg.omg.CORBA.Object
-
_create_request
public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, String operation, org.omg.CORBA.NVList arg_list, org.omg.CORBA.NamedValue result)- Specified by:
_create_requestin interfaceorg.omg.CORBA.Object
-
_create_request
public org.omg.CORBA.Request _create_request(org.omg.CORBA.Context ctx, 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_requestin interfaceorg.omg.CORBA.Object
-
_get_interface_def
public org.omg.CORBA.Object _get_interface_def()
- Specified by:
_get_interface_defin interfaceorg.omg.CORBA.Object- Overrides:
_get_interface_defin classorg.omg.PortableServer.Servant
-
_get_policy
public org.omg.CORBA.Policy _get_policy(int policy_type)
- Specified by:
_get_policyin interfaceorg.omg.CORBA.Object
-
_get_domain_managers
public org.omg.CORBA.DomainManager[] _get_domain_managers()
- Specified by:
_get_domain_managersin interfaceorg.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_overridein interfaceorg.omg.CORBA.Object
-
-