{
throw new NoActivityException();
}
catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
{
throw new InvalidProtocolException();
}
// TODO check for AlreadyRegisteredException
if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
.equals(protocolIdentifier))
{
// enlist participant that wraps the requester URI.
final String id = new Uid().stringForm();
try
{
final ParticipantCompletionCoordinatorEngine engine = new ParticipantCompletionCoordinatorEngine(id, participantProtocolService) ;
BusinessAgreementWithParticipantCompletionImple participant = new BusinessAgreementWithParticipantCompletionImple(
new BusinessAgreementWithParticipantCompletionStub(engine), id);
engine.setCoordinator(participant.participantManager()) ;
_coordManager.enlistParticipant(participant);
_coordManager.suspend();
return getParticipantManager(
BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
id);
}
catch (Exception ex)
{
throw new InvalidStateException();
}
}
else
if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
.equals(protocolIdentifier))
{
final String id = new Uid().stringForm();
try
{
final CoordinatorCompletionCoordinatorEngine engine = new CoordinatorCompletionCoordinatorEngine(id, participantProtocolService) ;
BusinessAgreementWithCoordinatorCompletionImple participant = new BusinessAgreementWithCoordinatorCompletionImple(
new BusinessAgreementWithCoordinatorCompletionStub(engine), id);
engine.setCoordinator(participant.participantManager()) ;
_coordManager.enlistParticipant(participant);
_coordManager.suspend();
return getParticipantManager(
BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
id);
}
catch (Exception ex)
{
throw new InvalidStateException();
}
}
else
if (ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
{
try
{
return getParticipantManager(
ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
instanceIdentifier.getInstanceIdentifier());
}
catch (Exception ex)
{
throw new InvalidStateException();
}
}
else
{
wstxLogger.arjLoggerI18N
.warn(
"com.arjuna.mwlabs.wst.ba.RegistrarImple_1",
new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
throw new InvalidProtocolException();
}
}