Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors
   * as indicated by the @author tags. 
   * See the copyright.txt in the distribution for a full listing 
   * of individual contributors.
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
   * of the GNU Lesser General Public License, v. 2.1.
  * This program is distributed in the hope that it will be useful, but WITHOUT A
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
  * 
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
 /*
  * Copyright (C) 2002, 2003, 2004,
  *
  * Arjuna Technologies Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
  * UK.
  *
  * $Id: VolatileTwoPhaseCommitParticipant.java,v 1.1.2.2 2004/08/09 12:34:24 nmcl Exp $
  */
 
 package com.arjuna.mwlabs.wst.at.participants;
 
 
 
 

Author(s):
Mark Little (mark.little@arjuna.com)
Version:
$Id: VolatileTwoPhaseCommitParticipant.java,v 1.1.2.2 2004/08/09 12:34:24 nmcl Exp $
Since:
1.0.
 
 
 {
 
 	{
 		 = resource;
 	}

The transaction that the instance is enrolled with is about to commit.

Throws:
com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs. This will cause the transaction to roll back.
 
 
 	public void beforeCompletion () throws SystemException
 	{
 		try
 		{
 			if ( != null)
 			{
 				// com.arjuna.mw.wst.vote.Vote vt = _resource.prepare();
 
 				if (vt instanceof com.arjuna.wst.ReadOnly)
 					 = true;
 				else
 				{
 					if (vt instanceof com.arjuna.wst.Prepared)
 					{
 						// do nothing
 					}
 					else
 						throw new SystemException();
 				}
 			}
 			else
 				throw new SystemException();
 		}
 		catch (SystemException ex)
 		{
 			throw ex;
 		}
 		catch (Exception ex)
 		{
 			throw new SystemException(ex.toString());
 		}
	}

The transaction that the instance is enrolled with has completed and the state in which is completed is passed as a parameter.

Parameters:
CompletionStatus cs The state in which the transaction completed.
Throws:
com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs. This has no affect on the outcome of the transaction.
	public void afterCompletion (int statusthrows SystemException
	{
		if (!)
		{
			try
			{
				switch (status)
				{
					break;
				default:
					break;
				}
			}
			catch (SystemException ex)
			{
				throw ex;
			}
			catch (Exception ex)
			{
				throw new SystemException(ex.toString());
			}
		}
	}
	private final void confirm () throws InvalidParticipantException,
	{
		if ( != null)
		{
			try
			{
			}
			// catch (com.arjuna.mw.wst.exceptions.WrongStateException ex)
			{
				throw new WrongStateException(ex.toString());
			}
			/*
			 * catch (com.arjuna.mw.wst.exceptions.HeuristicHazardException ex) {
			 * throw new HeuristicHazardException(ex.toString()); } catch
			 * (com.arjuna.mw.wst.exceptions.HeuristicMixedException ex) { throw
			 * new HeuristicMixedException(ex.toString()); } catch
			 * (com.arjuna.mw.wst.exceptions.HeuristicRollbackException ex) {
			 * throw new HeuristicCancelException(ex.toString()); }
			 */
			// catch (com.arjuna.mw.wst.exceptions.SystemException ex)
			{
				throw new SystemException(ex.toString());
			}
		}
		else
	}
	private final void cancel () throws InvalidParticipantException,
	{
		if ( != null)
		{
			try
			{
			}
			// catch (com.arjuna.mw.wst.exceptions.WrongStateException ex)
			{
				throw new WrongStateException(ex.toString());
			}
			/*
			 * catch (com.arjuna.mw.wst.exceptions.HeuristicHazardException ex) {
			 * throw new HeuristicHazardException(ex.toString()); } catch
			 * (com.arjuna.mw.wst.exceptions.HeuristicMixedException ex) { throw
			 * new HeuristicMixedException(ex.toString()); } catch
			 * (com.arjuna.mw.wst.exceptions.HeuristicCommitException ex) {
			 * throw new HeuristicConfirmException(ex.toString()); }
			 */
			// catch (com.arjuna.mw.wst.exceptions.SystemException ex)
			{
				throw new SystemException(ex.toString());
			}
		}
		else
	}
	private boolean _readonly = false;
New to GrepCode? Check out our FAQ X