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) 2003, Arjuna Technologies Limited.
  *
  * $Id: BusinessActivityTerminatorStub.java,v 1.7.6.1 2005/11/22 10:35:29 kconner Exp $
  */
 
 package com.arjuna.wst11.stub;
 
 import  org.jboss.ws.api.addressing.MAP;
 
 
 {
     private W3CEndpointReference _terminationCoordinator = null;
     private final String _id ;
 
     public BusinessActivityTerminatorRPCStub(final String idfinal W3CEndpointReference terminationCoordinator)
         throws Exception
     {
          = terminationCoordinator;
          = id ;
     }
 
     public void close ()
     {
         final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
 
         try
         {
             TerminationCoordinatorRPCClient.getClient().sendClose(mapnew InstanceIdentifier()) ;
         }
         catch (SoapFault11 soapFault)
         {
             if ((..equals(soapFault.getSubcode()))) {
                 throw new TransactionRolledBackException(soapFault.getMessage());
             }
             else if (..equals(soapFault.getSubcode()))
             {
                 throw new UnknownTransactionException(soapFault.getMessage()) ;
             }
 
             throw new SystemException(soapFault.getMessage()) ;
         }
         catch (Exception e)
         {
             throw new SystemException();
         }
     }
 
     public void cancel ()
     {
         final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
 
         try
         {
             TerminationCoordinatorRPCClient.getClient().sendCancel(mapnew InstanceIdentifier()) ;
         }
         catch (SoapFault11 soapFault)
        {
            if (..equals(soapFault.getSubcode()))
            {
                throw new FaultedException(soapFault.getMessage()) ;
            }
            else if (..equals(soapFault.getSubcode()))
            {
                throw new UnknownTransactionException(soapFault.getMessage()) ;
            }
            throw new SystemException(soapFault.getMessage()) ;
        }
        catch (Exception e)
        {
            throw new SystemException(e.getMessage());
        }
        catch (final Throwable th)
        {
            th.printStackTrace() ;
            throw new SystemException(th.getMessage()) ;
        }
    }
    public void complete ()
    {
        final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
        try
        {
            TerminationCoordinatorRPCClient.getClient().sendComplete(mapnew InstanceIdentifier()) ;
        }
        catch (SoapFault11 soapFault)
        {
            if (..equals(soapFault.getSubcode()))
            {
                throw new FaultedException(soapFault.getMessage()) ;
            }
            else if (..equals(soapFault.getSubcode()))
            {
                throw new UnknownTransactionException(soapFault.getMessage()) ;
            }
            throw new SystemException(soapFault.getMessage()) ;
        }
        catch (Exception e)
        {
            throw new SystemException(e.getMessage());
        }
        catch (final Throwable th)
        {
            th.printStackTrace() ;
            throw new SystemException(th.getMessage()) ;
        }
    }
    {
        return ;
    }
    /*
     * this never gets called
     */
    public void unknown ()
        throws SystemException
    {
        error() ;
    }
    /*
     * this never gets called
     */
    public void error ()
        throws SystemException
    {
/*
 * Since it is never used this has been decommissioned due to problems with using the soap fault service to
  * send a fault via a W3C endpoint. the latter is broken now that CXF helpfully puts metadata into the endpoint.
        final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
        final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME,
                WSTLogger.i18NLogger.get_wst11_stub_BusinessActivityTerminatorStub_1()) ;
        try
        {
            TerminationCoordinatorClient.getClient().sendSoapFault(_terminationCoordinator, map, soapFault, new InstanceIdentifier(_id)) ;
        }
        catch (final Throwable th)
        {
            throw new SystemException() ;
        }
*/
    }
    private static class RequestCallback extends TerminationParticipantCallback
    {
        
The addressing context.
        private MAP map ;
        
The arjuna context.
        private ArjunaContext arjunaContext ;
        
The SOAP fault.
        private SoapFault soapFault ;
        
The completed notification flag.
        private boolean completed ;
        
The cancelled notification flag.
        private boolean cancelled ;
        
The closed notification flag.
        private boolean closed ;
        
The faulted notification flag.
        private boolean faulted ;

        
Get the addressing context.

Returns:
The addressing context.
        MAP getAddressingProperties()
        {
            return  ;
        }

        
Get the arjuna context.

Returns:
The arjuna context.
        {
            return  ;
        }

        
Get the SOAP fault.

Returns:
The SOAP fault.
        SoapFault getSoapFault()
        {
            return  ;
        }

        
Did we receive a completed notification?

Returns:
True if completed, false otherwise.
        boolean receivedCompleted()
        {
            return  ;
        }

        
Did we receive a cancelled notification?

Returns:
True if cancelled, false otherwise.
        boolean receivedCancelled()
        {
            return  ;
        }

        
Did we receive a closed notification?

Returns:
True if closed, false otherwise.
        boolean receivedClosed()
        {
            return  ;
        }

        
Did we receive a faulted notification?

Returns:
True if faulted, false otherwise.
        boolean receivedFaulted()
        {
            return  ;
        }

        
A completed response.

Parameters:
completed The completed notification.
map The addressing context.
arjunaContext The arjuna context.
        public void completed(final NotificationType completedfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            this. = true ;
            this. = map ;
            this. = arjunaContext ;
        }

        
A cancelled response.

Parameters:
cancelled The cancelled notification.
map The addressing context.
arjunaContext The arjuna context.
        public void cancelled(final NotificationType cancelledfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            this.  = true ;
            this. = map ;
            this. = arjunaContext ;
        }

        
A closed response.

Parameters:
closed The closed notification.
map The addressing context.
arjunaContext The arjuna context.
        public void closed(final NotificationType closedfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            this. = true ;
            this. = map ;
            this. = arjunaContext ;
        }

        
A faulted response.

Parameters:
faulted The faulted notification.
map The addressing context.
arjunaContext The arjuna context.
        public void faulted(final NotificationType faultedfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            // TODO - convert wsdl to use NotificationType instead of ExceptionType
            this. = true ;
            this. = map ;
            this. = arjunaContext ;
        }

        
A SOAP fault response.

Parameters:
soapFault The SOAP fault.
map The addressing context.
arjunaContext The arjuna context.
        public void soapFault(final SoapFault soapFaultfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            // TODO - pass soap fault to this callback
            this. = soapFault ;
            this. = map ;
            this. = arjunaContext ;
        }
    }
New to GrepCode? Check out our FAQ X