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)
void
commit()
Commit a transaction.void
commit_one_phase()
Commit a transaction, using one-phase optimization.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.String
toString()
-
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.SystemException
Commit a transaction.- Specified by:
commit
in 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.SystemException
Commit a transaction, using one-phase optimization.- Specified by:
commit_one_phase
in 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:
forget
in interfaceorg.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 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.SystemException
Rollback a transaction.- Specified by:
rollback
in 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:
getGlobalTID
in 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:
_duplicate
in interfaceorg.omg.CORBA.Object
-
_release
public void _release()
- Specified by:
_release
in interfaceorg.omg.CORBA.Object
-
_is_a
public boolean _is_a(String repository_id)
- Specified by:
_is_a
in interfaceorg.omg.CORBA.Object
- Overrides:
_is_a
in classorg.omg.PortableServer.Servant
-
_is_equivalent
public boolean _is_equivalent(org.omg.CORBA.Object that)
- Specified by:
_is_equivalent
in interfaceorg.omg.CORBA.Object
-
_non_existent
public boolean _non_existent()
- Specified by:
_non_existent
in interfaceorg.omg.CORBA.Object
- Overrides:
_non_existent
in classorg.omg.PortableServer.Servant
-
_hash
public int _hash(int maximum)
- Specified by:
_hash
in interfaceorg.omg.CORBA.Object
-
_request
public org.omg.CORBA.Request _request(String operation)
- Specified by:
_request
in 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_request
in 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_request
in interfaceorg.omg.CORBA.Object
-
_get_interface_def
public org.omg.CORBA.Object _get_interface_def()
- Specified by:
_get_interface_def
in interfaceorg.omg.CORBA.Object
- Overrides:
_get_interface_def
in classorg.omg.PortableServer.Servant
-
_get_policy
public org.omg.CORBA.Policy _get_policy(int policy_type)
- Specified by:
_get_policy
in interfaceorg.omg.CORBA.Object
-
_get_domain_managers
public org.omg.CORBA.DomainManager[] _get_domain_managers()
- Specified by:
_get_domain_managers
in 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_override
in interfaceorg.omg.CORBA.Object
-
-