Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.wst11.stub;
  
  import  org.jboss.ws.api.addressing.MAP;
 
 
 public class CompletionStub implements
 {
     private W3CEndpointReference _completionCoordinator = null;
     private String _id;
 
 	public CompletionStub(final String idfinal W3CEndpointReference completionCoordinator)
 			throws Exception
 	{
 		 = completionCoordinator;
 		 = id;
 	}
 
 	public void commit () throws TransactionRolledBackException,
     {
         final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
 
         final CompletionStub.RequestCallback callback = new CompletionStub.RequestCallback() ;
         final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
         completionInitiator.registerCallback(callback) ;
         try
         {
             CompletionCoordinatorClient.getClient().sendCommit(mapnew InstanceIdentifier()) ;
             callback.waitUntilTriggered() ;
         }
         catch (final Throwable th)
         {
             th.printStackTrace() ;
             throw new SystemException() ;
         }
         finally
         {
             completionInitiator.removeCallback() ;
         }
 
         if (callback.hasTriggered())
         {
             if (callback.receivedCommitted())
             {
                 return ;
             }
             else if (callback.receivedAborted())
             {
                 throw new TransactionRolledBackException() ;
             }
             final SoapFault soapFault = callback.getSoapFault() ;
             if ((soapFault != null) && ..equals(soapFault.getSubcode()))
             {
                 throw new UnknownTransactionException();
             }
         }
 
         throw new SystemException() ;
 	}
 
 	{
         final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
 
         final CompletionStub.RequestCallback callback = new CompletionStub.RequestCallback() ;
         final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
         completionInitiator.registerCallback(callback) ;
         try
         {
             CompletionCoordinatorClient.getClient().sendRollback(mapnew InstanceIdentifier()) ;
             callback.waitUntilTriggered() ;
         }
         catch (final Throwable th)
         {
             th.printStackTrace() ;
             throw new SystemException() ;
         }
         finally
         {
             completionInitiator.removeCallback() ;
         }
 
         if (callback.hasTriggered())
        {
            if (callback.receivedAborted())
            {
                return ;
            }
            final SoapFault soapFault = callback.getSoapFault() ;
            if ((soapFault != null) && ..equals(soapFault.getSubcode()))
            {
                throw new UnknownTransactionException();
            }
        }
        throw new SystemException() ;
	}
    private static class RequestCallback extends CompletionInitiatorCallback
    {
        
The addressing context.
        private MAP map ;
        
The arjuna context.
        private ArjunaContext arjunaContext ;
        
The SOAP fault.
        private SoapFault soapFault ;
        
The aborted notification flag.
        private boolean aborted ;
        
The committed notification flag.
        private boolean committed ;

        
Get the addressing context.

Returns:
The addressing context.
        MAP getMAP()
        {
            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 aborted notification?

Returns:
True if aborted, false otherwise.
        boolean receivedAborted()
        {
            return  ;
        }

        
Did we receive a committed notification?

Returns:
True if committed, false otherwise.
        boolean receivedCommitted()
        {
            return  ;
        }

        
A aborted response.

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

        
An committed response.

Parameters:
committed The committed notification.
map The addressing context.
arjunaContext The arjuna context.
        public void committed(final Notification committedfinal MAP map,
            final ArjunaContext arjunaContext)
        {
            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)
        {
            this. = soapFault ;
            this. = map ;
            this. = arjunaContext ;
        }
    }
New to GrepCode? Check out our FAQ X