Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.arjuna.mwlabs.wst11.at.remote;
  
 
This is the interface that the core exposes in order to allow different types of participants to be enrolled. The messaging layer continues to work in terms of the registrar, but internally we map to one of these methods.
 
 
 {
 	{
 	}
 
     {
 		try
 		{
             final W3CEndpointReference participant = getParticipant(idisCurrentContextSecure());
 
 			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tppidcoordinator), id) ;
 		}
 		{
 			throw new SystemException(ex.toString());
 		}
 		{
 			throw new WrongStateException();
 		}
 		{
             // cause could actually be no activity or already registered
 		}
 	}
 
 	{
 		try
 		{
             final W3CEndpointReference participant = getParticipant(idisCurrentContextSecure());
 
 			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tppidcoordinator), id) ;
 		}
 		{
 			throw new SystemException(ex.toString());
 		}
 		{
 			throw new WrongStateException();
 		}
 		{
             // cause could actually be no activity or already registered
 
 		}
 	}
 
 	/*
 	 * TODO
 	 *
 	 * Have participant interfaces in WSTX have url method and services use
 	 * those. The ones in WS-T are message oriented and we translate to/from.
 	 *
 	 */
 
 	public int replay () throws SystemException
 	{
 		throw new SystemException(
 	}
	public TxContext suspend () throws SystemException
	{
	}
	// resume overwrites. Should we check first a la JTA?
	public void resume (TxContext txthrows UnknownTransactionException,
	{
	}
	{
	}
    private boolean isCurrentContextSecure()  throws SystemException
    {
        TxContextImple currentTx = (TxContextImple.currentTransaction();
        if (currentTx != null) {
            return currentTx.isSecure();
        }
        return false;
    }
    final W3CEndpointReference getParticipant(final String idfinal boolean isSecure)
    {
        final QName serviceName = .;
        final QName endpointName = .;
        final String address = ServiceRegistry.getRegistry().getServiceURI(.isSecure);
        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
        builder.serviceName(serviceName);
        builder.endpointName(endpointName);
        builder.address(address);
        InstanceIdentifier.setEndpointInstanceIdentifier(builderid);
        return builder.build();
    }
	final W3CEndpointReference registerParticipant (final W3CEndpointReference participantfinal String protocol)
	{
		TxContextImple currentTx = null;
		try
		{
			if (currentTx == null)
            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
            final String messageId = MessageId.getMessageId() ;
            return com.arjuna.wsc11.RegistrationCoordinator.register(coordinationContextmessageIdparticipantprotocol) ;
        }
		catch (final SoapFault sf)
		{
			throw new SystemException(sf.getMessage());
		}
		catch (final CannotRegisterException cre)
		{
			throw cre ;
		}
        catch (final InvalidStateException ise)
        {
            throw ise ;
        }
        catch (final InvalidProtocolException ipe)
        {
            throw ipe ;
        }
		catch (final Exception ex)
		{
			throw new SystemException(ex.toString());
		}
		finally
		{
			try
			{
				if (currentTx != null)
					.resume(currentTx);
			}
			catch (Exception ex)
			{
			}
		}
	}
New to GrepCode? Check out our FAQ X