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); }
@WebMethod(operationName = "CreateCoordinationContextOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext") @WebResult(name = "CreateCoordinationContextResponse", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters") @Action(input="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext", output="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContextResponse") public CreateCoordinationContextResponseType createCoordinationContextOperation( @WebParam(name = "CreateCoordinationContext", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters") CreateCoordinationContextType parameters) { MessageContext ctx = webServiceCtx.getMessageContext(); HttpServletRequest request = (HttpServletRequest)ctx.get(MessageContext.SERVLET_REQUEST); boolean isSecure = "https".equals(request.getScheme()); MAP inboundMAP = AddressingHelper.inboundMap(ctx); return ActivationCoordinatorProcessor.getCoordinator().createCoordinationContext(parameters, inboundMAP, isSecure); } }
/** * Create a response context from the incoming context. * @return The addressing context. */ private MAP createContext() { final String messageId = MessageId.getMessageId() ; return AddressingHelper.createNotificationContext(messageId) ; }
public static RegistrationPortType getRegistrationPort(W3CEndpointReference endpointReference, String action, String messageID) { RegistrationService service = getRegistrationService(); RegistrationPortType port = service.getPort(endpointReference, RegistrationPortType.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 map = AddressingHelper.outboundMap(requestContext); AddressingHelper.installActionMessageID(map, action, messageID); // we should not need to do this but JBossWS does not pick up the value in the addressing properties AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; } }
AddressingHelper.createResponseContext(map, messageId) ; CompletionInitiatorClient.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ; return ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, messageId) ; final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_1()) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, messageId) ; final String pattern = WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_2(); final String message = MessageFormat.format(pattern, new Object[] {se}) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, MessageId.getMessageId()) ; final SoapFault soapFault = new SoapFault11(th) ; CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ; return ; final MAP responseAddressingContext = AddressingHelper.createResponseContext(map, messageId) ; CompletionInitiatorClient.getClient().sendCommitted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, MessageId.getMessageId()) ; final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_5()) ;
/** * JBossWS Native version to configure request context with MAP, to and action * @param requestContext * @param map * @param to * @param action */ public static void configureRequestContext(Map<String, Object> requestContext, MAP map, String to, String action) { configureRequestContext(requestContext, map); map.setAction(action); configureRequestContext(requestContext, to, action); }
/** * Send a fail message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * @param exceptionIdentifier The exception identifier. * */ private void sendFail(final MAP map, final ArjunaContext arjunaContext, final QName exceptionIdentifier) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseMAP = AddressingHelper.createFaultContext(map, messageId) ; try { // supply null endpoint to indicate addressing properties should be used to route message CoordinatorCompletionCoordinatorClient.getClient().sendFail(null, responseMAP, arjunaContext.getInstanceIdentifier(), exceptionIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Fail", th) ; } } } }
/** * Send a faulted message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * */ private void sendFailed(final MAP map, final ArjunaContext arjunaContext) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseAddressingContext = AddressingHelper.createOneWayResponseContext(map, messageId) ; try { // supply null endpoint so that addressing properties are used to deliver message CoordinatorCompletionParticipantClient.getClient().sendFailed(null, responseAddressingContext, arjunaContext.getInstanceIdentifier()) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Faulted", th) ; } } }
public static RegistrationPortType getRegistrationPort(final W3CEndpointReference endpointReference, String action, String messageID) { final RegistrationService service = getRegistrationService(); final RegistrationPortType port = PrivilegedServiceHelper.getInstance().getPort(service, endpointReference, RegistrationPortType.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 map = getRegistrationPortMap(requestContext); AddressingHelper.installActionMessageID(map, action, messageID); // we should not need to do this but JBossWS does not pick up the value in the addressing properties AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; }
public static void installNoneReplyTo(MAP map) { map.setReplyTo(getNoneAddress()); }
/** * Send an aborted message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * */ private void sendAborted(final MAP map, final ArjunaContext arjunaContext) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseMAP = AddressingHelper.createResponseContext(map, messageId) ; final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ; try { CoordinatorClient.getClient().sendAborted(null, responseMAP, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Aborted", th) ; } } } }
throws InvalidCreateParametersException, SoapFault final MAP map = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID) ;
public static RegistrationPortType getRegistrationPort(W3CEndpointReference endpointReference, String action, String messageID) { RegistrationService service = getRegistrationService(); RegistrationPortType port = service.getPort(endpointReference, RegistrationPortType.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 map = AddressingHelper.outboundMap(requestContext); AddressingHelper.installActionMessageID(map, action, messageID); // we should not need to do this but JBossWS does not pick up the value in the addressing properties AddressingHelper.configureRequestContext(requestContext, map.getTo(), action); return port; } }
AddressingHelper.createResponseContext(map, messageId) ; CompletionInitiatorClient.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ; return ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, messageId) ; final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_1()) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, messageId) ; final String pattern = WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_2(); final String message = MessageFormat.format(pattern, new Object[] {se}) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, MessageId.getMessageId()) ; final SoapFault soapFault = new SoapFault11(th) ; CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ; return ; final MAP responseAddressingContext = AddressingHelper.createResponseContext(map, messageId) ; CompletionInitiatorClient.getClient().sendCommitted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ; final MAP faultAddressingContext = AddressingHelper.createFaultContext(map, MessageId.getMessageId()) ; final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_CompletionCoordinatorProcessorImpl_5()) ;
/** * JBossWS Native version to configure request context with MAP, to and action * @param requestContext * @param map * @param to * @param action */ public static void configureRequestContext(Map<String, Object> requestContext, MAP map, String to, String action) { configureRequestContext(requestContext, map); map.setAction(action); configureRequestContext(requestContext, to, action); }
/** * Send a fail message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * @param exceptionIdentifier The exception identifier. * */ private void sendFail(final MAP map, final ArjunaContext arjunaContext, final QName exceptionIdentifier) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseMAP = AddressingHelper.createFaultContext(map, messageId) ; try { // supply null endpoint to indicate addressing properties should be used to route message CoordinatorCompletionCoordinatorClient.getClient().sendFail(null, responseMAP, arjunaContext.getInstanceIdentifier(), exceptionIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Fail", th) ; } } } }
/** * Send a cancelled message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * */ private void sendCancelled(final MAP map, final ArjunaContext arjunaContext) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseMAP = AddressingHelper.createOneWayResponseContext(map, messageId) ; try { // supply null endpoint to indicate addressing properties should be used to route message CoordinatorCompletionCoordinatorClient.getClient().sendCancelled(null, responseMAP, arjunaContext.getInstanceIdentifier()) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Cancelled", th) ; } } }
public static void installNoneReplyTo(MAP map) { map.setReplyTo(getNoneAddress()); }
/** * Send a committed message. * * @param map The addressing context. * @param arjunaContext The arjuna context. * */ private void sendCommitted(final MAP map, final ArjunaContext arjunaContext) { // KEV add check for recovery final String messageId = MessageId.getMessageId() ; final MAP responseMAP = AddressingHelper.createResponseContext(map, messageId) ; final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ; try { CoordinatorClient.getClient().sendCommitted(null, responseMAP, instanceIdentifier) ; } catch (final Throwable th) { if (WSTLogger.logger.isTraceEnabled()) { WSTLogger.logger.tracev("Unexpected exception while sending Committed", th) ; } } }
throws InvalidCreateParametersException, SoapFault final MAP map = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID) ;