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,
  *
  * Arjuna Technologies Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
  * UK.
  *
  * $Id: BusinessAgreementWithParticipantCompletionImple.java,v 1.1.2.2 2004/08/09 12:34:26 nmcl Exp $
  */
 
 package com.arjuna.mwlabs.wst11.ba.participants;
 
 // import com.arjuna.mw.wst.resources.BusinessAgreement;
 
 
 
 // TODO crash recovery (for EVERYTHING!!)
 
 // TODO re-architect!!
 

Author(s):
Mark Little (mark.little@arjuna.com)
Version:
$Id: BusinessAgreementWithParticipantCompletionImple.java,v 1.1.2.2 2004/08/09 12:34:26 nmcl Exp $
Since:
1.0.
 
 
 {
    
this constructor installs a participant manager which routes messages via the current activity

Parameters:
resource
id
 
             BusinessAgreementWithParticipantCompletionParticipant resource,
             String id)
     {
         this(new BAParticipantManagerImple(id), resource,  id);
     }

    
this constructor installs the supplied participant manager

Parameters:
participantManager
resource
id
 
             BAParticipantManager participantManager,
             BusinessAgreementWithParticipantCompletionParticipant resource,
             String id)
     {
          = participantManager;
          = resource;
          = id;
     }

    
this constructor is used during recovery and does not install a participant manager. the resource and identifier will be initialised by loading saved state
 
     {
          = null;
          = null;
         = null;
    }
	public void close () throws InvalidParticipantException,
	{
		try
		{
			if ( != null)
			{
			}
			else
		}
		{
			throw new WrongStateException(ex.toString());
		}
		{
			throw new SystemException(ex.toString());
		}
	}
	{
		try
		{
			if ( != null)
			{
			}
			else
		}
		{
			throw new WrongStateException(ex.toString());
		}
        catch (com.arjuna.wst.FaultedException ex)
        {
            // we can see this in 1.1
            throw new CancelFailedException(ex.toString());
        }
        catch (com.arjuna.wst.SystemException ex)
        {
            throw new SystemException(ex.toString());
        }
	}
	public void compensate () throws CompensateFailedException,
	{
		try
		{
			if ( != null)
			{
			}
			else
		}
		{
		}
		{
			throw new WrongStateException(ex.toString());
		}
		{
			throw new SystemException(ex.toString());
		}
	}

Returns:
the status value.
	public String status () throws SystemException
	{
		try
		{
			if ( != null)
			{
				return .status();
			}
			else
				throw new SystemException("InvalidParticipant");
		}
		{
			throw new SystemException(ex.toString());
		}
	}

Inform the participant that is can forget the heuristic result.

Throws:
com.arjuna.mw.wscf.exceptions.InvalidParticipantException Thrown if the participant identity is invalid.
com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the participant is in an invalid state.
com.arjuna.mw.wsas.exceptions.SystemException Thrown in the event of a general fault.
	public void forget () throws InvalidParticipantException,
	{
		// not supported by the IBM protocol.
	}
	public void unknown () throws SystemException
	{
		/*
		 * If the transaction is unknown, then we assume it cancelled.
		 */
		try
		{
		}
		catch (Exception ex)
		{
			// TODO
		}
	}
	public String id () throws SystemException
	{
		return ;
	}
	{
	}
	public boolean save_state (OutputObjectState os)
	{
        try {
            os.packString();
        } catch (IOException e) {
            return false;
        }
        return PersistableParticipantHelper.save_state(os) ;
	}
	public boolean restore_state (InputObjectState is)
	{
        try {
             = is.unpackString();
        } catch (IOException e) {
            return false;
        }
        final Object resource = PersistableParticipantHelper.restore_state(is) ;
        if (resource != null)
        {
            return true ;
        }
        else
        {
            return false ;
        }
	}
	private String _identifier = null;
New to GrepCode? Check out our FAQ X