use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class TwoPCParticipantTest method checkDetails.
/**
* check the message details to see that they have the correct to, from and faultto address and message id, a
* none reply to address and an arjuna context containing the correct instannce identifier
* @param details
* @param hasFrom
* @param hasFaultTo
* @param messageId
* @param instanceIdentifier
*/
private void checkDetails(CoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier) {
MAP inMAP = details.getMAP();
ArjunaContext inArjunaContext = details.getArjunaContext();
assertEquals(inMAP.getTo(), TestUtil.coordinatorServiceURI);
assertNotNull(inMAP.getReplyTo());
assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
if (hasFrom) {
assertNotNull(inMAP.getFrom());
assertEquals(inMAP.getFrom().getAddress(), TestUtil.participantServiceURI);
} else {
assertNull(inMAP.getFrom());
}
if (hasFaultTo) {
assertNotNull(inMAP.getFaultTo());
assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.participantServiceURI);
} else {
assertNull(inMAP.getFrom());
}
assertNotNull(inMAP.getMessageID());
assertEquals(inMAP.getMessageID(), messageId);
if (instanceIdentifier == null) {
assertNull(inArjunaContext);
} else {
assertNotNull(inArjunaContext);
assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier());
}
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class WSATClient method configureEndpointPort.
private static void configureEndpointPort(BindingProvider bindingProvider, String action, MAP map) {
/*
* we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
List<Handler> customHandlerChain = new ArrayList<Handler>();
customHandlerChain.add(new WSAddressingClientHandler());
bindingProvider.getBinding().setHandlerChain(customHandlerChain);
*/
Map<String, Object> requestContext = bindingProvider.getRequestContext();
MAP requestMap = AddressingHelper.outboundMap(requestContext);
map.setAction(action);
AddressingHelper.installCallerProperties(map, requestMap);
AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class CompletionCoordinatorPortTypeImpl method commitOperation.
/**
* @param parameters
*/
@WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
public void commitOperation(@WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
MessageContext ctx = webServiceCtx.getMessageContext();
final Notification commit = parameters;
final MAP inboundMap = AddressingHelper.inboundMap(ctx);
final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
TaskManager.getManager().queueTask(new Task() {
public void executeTask() {
CompletionCoordinatorProcessor.getProcessor().commit(commit, inboundMap, arjunaContext);
}
});
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class WSARJTXClient method getTerminationCoordinatorRPCPort.
public static TerminationCoordinatorRPCPortType getTerminationCoordinatorRPCPort(W3CEndpointReference endpointReference, String action, MAP map) {
final TerminationCoordinatorRPCService service = getTerminationCoordinatorRPCService();
final TerminationCoordinatorRPCPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, TerminationCoordinatorRPCPortType.class, new AddressingFeature(true, true));
BindingProvider bindingProvider = (BindingProvider) port;
/*
* we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
List<Handler> customHandlerChain = new ArrayList<Handler>();
customHandlerChain.add(new WSAddressingClientHandler());
bindingProvider.getBinding().setHandlerChain(customHandlerChain);
*/
Map<String, Object> requestContext = bindingProvider.getRequestContext();
MAP requestMap = AddressingHelper.outboundMap(requestContext);
map.setAction(action);
AddressingHelper.installCallerProperties(map, requestMap);
AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
return port;
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class WSARJTXClient method getTerminationCoordinatorPort.
public static TerminationCoordinatorPortType getTerminationCoordinatorPort(W3CEndpointReference endpointReference, String action, MAP map) {
final TerminationCoordinatorService service = getTerminationCoordinatorService();
final TerminationCoordinatorPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
BindingProvider bindingProvider = (BindingProvider) port;
/*
* we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
List<Handler> customHandlerChain = new ArrayList<Handler>();
customHandlerChain.add(new WSAddressingClientHandler());
bindingProvider.getBinding().setHandlerChain(customHandlerChain);
*/
Map<String, Object> requestContext = bindingProvider.getRequestContext();
MAP requestMap = AddressingHelper.outboundMap(requestContext);
map.setAction(action);
AddressingHelper.installCallerProperties(map, requestMap);
AddressingHelper.configureRequestContext(requestContext, requestMap.getTo(), action);
return port;
}
Aggregations