/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
//----------------------------------------------------------------------------
//
// Module: Terminator.java
//
// Description: Transaction Terminator object implementation.
//
// Product: com.sun.jts.CosTransactions
//
// Author: Simon Holdsworth
//
// Date: March, 1997
//
// Copyright (c): 1995-1997 IBM Corp.
//
// The source code for this program is not published or otherwise divested
// of its trade secrets, irrespective of what has been deposited with the
// U.S. Copyright Office.
//
// This software contains confidential and proprietary information of
// IBM Corp.
//----------------------------------------------------------------------------
/**
* The TerminatorImpl interface is our implementation of the
* standard Terminator
* interface. It provides operations to complete a transaction, either
* requesting commitment, or demanding rollback. The TerminatorImpl in this
* design should be a pseudo-object, as we do not want its reference to be
* passed to other processes, and we always want it to be created locally.
*
* @version 0.01
*
* @author Simon Holdsworth, IBM Corporation
*
* @see
*/
//----------------------------------------------------------------------------
// CHANGE HISTORY
//
// Version By Change Description
// 0.01 SAJH Initial implementation.
//----------------------------------------------------------------------------
// this is needed to cleanup properly on completion and to avoid leaks.
/*
Logger to log transaction messages
*/
/**
* Default TerminatorImpl constructor.
*
* @param
*
* @return
*
* @see
*/
TerminatorImpl() {}
/**
* Creates and initialises a new TerminatorImpl, given the Coordinator
* object for the transaction, and a flag to indicate whether the
* TerminatorImpl represents a subtransaction.
*
* @param coordinator The Coordinator for the transaction.
* @param subtran A flag indicating whether the transaction is a child.
*
* @return
*
* @see
*/
// Initialise the instance variables.
}
/**
* sets the control object that points to this terminator.
*
* @param control the control object this terminator belongs to.
*/
/* This method has been newly added (Ram J) */
}
/**
* Cleans up the state of the object.
*
* @param
*
* @return
*
* @see
*/
/*
synchronized public void finalize() {
if (coordTerm != null) {
coordTerm.finalize();
coordTerm = null;
}
}
*/
/**
* This implements the checked behaviour for threads calling
* the terminator object's completion methods directly.
*/
private void PreCompletionCheck()
throws TRANSACTION_ROLLEDBACK, INVALID_TRANSACTION {
/* This method has been newly added (Ram J) */
// This line assigns the value to the status
// check if the transaction is active, else throw exception
new TRANSACTION_ROLLEDBACK(0,
throw exc;
}
throw exc;
}
// check if there is no outstanding requests, else throw exception
// CHECK(Ram J) should a check for active thread associations
// be done here as well ??
if (control.isOutgoing()) {
throw exc;
}
}
/**
* Requests that the transaction controlled by the Terminator object be
* committed.
* The commit is passed on the the CoordinatorTerm object. If the heuristic
* report flag is set, any heuristic exception raised by the
* root Coordinator is returned to the caller,
* otherwise any heuristic exception is discarded.
*
* This operation is part of the OMG interface and must not return
* any exceptions other than those defined in the OMG interface.
*
* @param reportHeuristics Indicates whether heuristic exceptions
* should be passed to the caller.
*
* @return
*
* @exception HeuristicHazard Heuristic action may have been taken by a
* participant in the transaction.
* @exception HeuristicMixed Heuristic action has been
* taken by a participant in the transaction so part
* of the transaction has been rolled back.
* @exception SystemException The operation failed.
*
* @see
*/
// for checked transaction behaviour (Ram J)
// Try to commit the transaction. If the client does not want a
// heuristic report, then the transaction can be completed promptly.
// If the client does not want heuristic reporting, and an
// exception was raised, and it is a Heuristic exception, forget it.
// Any other exception that is raised is returned to the client.
try {
} catch (HeuristicMixed exc) {
if (reportHeuristics) {
throw exc;
}
} catch (HeuristicHazard exc) {
if (reportHeuristics) {
throw exc;
}
} catch (TRANSACTION_ROLLEDBACK exc) {
throw exc;
} catch(LogicErrorException exc) {
throw ex2;
}
}
/**
* Demands that the transaction represented by the Terminator object
* be rolled back.
* No heuristics are reported by this operation so if the root Coordinator
* raises a heuristic exception, it is cleared before the operation
* returns to the caller.
*
* This operation is part of the OMG interface and must not return
* any exceptions other than those defined in the OMG interface.
*
* @param
*
* @return
*
* @exception SystemException The operation failed.
*
* @see
*/
// for checked transaction behaviour (Ram J)
// Roll the transaction back.
// If a Heuristic exception was raised, forget it.
// Any other exception that is raised is returned to the client.
try {
} catch (HeuristicMixed exc) {
} catch (HeuristicHazard exc) {
} catch (TRANSACTION_ROLLEDBACK exc) {
throw exc;
} catch (LogicErrorException exc) {
throw ex2;
}
}
/**
* Returns the CORBA Object which represents this object.
*
* @param
*
* @return The CORBA object.
*
* @see
*/
}
try {
poa.activate_object(this);
thisRef =
//thisRef = (Terminator) this;
} catch(ServantAlreadyActive saexc) {
"jts.create_terminator_object_error");
} catch(ServantNotActive snexc) {
"jts.create_terminator_object_error");
"jts.create_terminator_object_error");
}
}
return thisRef;
}
/**
* Destroys the TerminatorImpl object.
*
* @param
*
* @return
*
* @see
*/
synchronized final void destroy() {
try {
}
}
//finalize();
}
/*
* These methods are there to satisy the compiler. At some point
* when we move towards a tie based model, the org.omg.Corba.Object
* interface method implementation below shall be discarded.
*/
}
public void _release() {
}
}
}
public boolean _non_existent() {
}
}
}
NamedValue result) {
}
}
}
}
}
}
}