/**
* Construct the coordinator client.
*/
private CoordinatorClient()
{
final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
try {
preparedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARED);
abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
readOnlyAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_READ_ONLY);
committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
} catch (URISyntaxException use) {
// TODO - log fault and throw exception
}
// final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
// Add WS-Addressing
// AddressingPolicy.register(handlerRegistry) ;
// Add client policies
// ClientPolicy.register(handlerRegistry) ;
final String participantURIString =
ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, false);
final String secureParticipantURIString =
ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, true);
try {
URI participantURI = new URI(participantURIString);
participant = builder.newEndpointReference(participantURI);
} catch (URISyntaxException use) {
// TODO - log fault and throw exception
}
try {
URI secureParticipantURI = new URI(secureParticipantURIString);
secureParticipant = builder.newEndpointReference(secureParticipantURI);
} catch (URISyntaxException use) {
// TODO - log fault and throw exception
}
}