use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class TerminationCoordinatorPortTypeImpl method closeOperation.
/**
* @param parameters
*/
@WebMethod(operationName = "CloseOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close")
@Oneway
public void closeOperation(@WebParam(name = "Close", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters") NotificationType parameters) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.trace(getClass().getSimpleName() + ".closeOperation");
}
MessageContext ctx = webServiceCtx.getMessageContext();
final NotificationType close = parameters;
final MAP inboundMap = AddressingHelper.inboundMap(ctx);
final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
TaskManager.getManager().queueTask(new Task() {
public void executeTask() {
TerminationCoordinatorProcessor.getProcessor().close(close, inboundMap, arjunaContext);
}
});
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class TerminationParticipantPortTypeImpl method faultedOperation.
/**
* @param parameters
*/
@WebMethod(operationName = "FaultedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted")
@Oneway
public void faultedOperation(@WebParam(name = "Faulted", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters") NotificationType parameters) {
MessageContext ctx = webServiceCtx.getMessageContext();
final NotificationType faulted = parameters;
final MAP inboundMap = AddressingHelper.inboundMap(ctx);
final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
TaskManager.getManager().queueTask(new Task() {
public void executeTask() {
TerminationParticipantProcessor.getProcessor().handleFaulted(faulted, inboundMap, arjunaContext);
}
});
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class ActivationCoordinator method createCoordinationContext.
/**
* Create the coordination context.
* @param activationCoordinatorURI The URI of the activation coordinator.
* @param messageID The messageID to use.
* @param coordinationTypeURI The coordination type.
* @param expires The expiry time or null.
* @param currentContext The currnt context or null.
* @return The coordination context.
* @throws com.arjuna.wsc.InvalidCreateParametersException if the create parameters are invalid.
* @throws SoapFault for errors during processing.
*/
public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI, final String messageID, final String coordinationTypeURI, final Long expires, final CoordinationContext currentContext) throws InvalidCreateParametersException, SoapFault {
final MAP map = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID);
final Expires expiresValue;
if (expires == null) {
expiresValue = null;
} else {
expiresValue = new Expires();
expiresValue.setValue(expires.longValue());
}
try {
CreateCoordinationContextResponseType response;
ActivationCoordinatorClient client = ActivationCoordinatorClient.getClient();
response = client.sendCreateCoordination(map, coordinationTypeURI, expiresValue, currentContext);
return response.getCoordinationContext();
} catch (final IOException ioe) {
throw new SoapFault11(ioe);
} catch (SOAPFaultException sfe) {
// TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
final SOAPFault soapFault = sfe.getFault();
final QName subcode = soapFault.getFaultCodeAsQName();
if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(subcode)) {
Detail detail = soapFault.getDetail();
String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
throw new InvalidCreateParametersException(message);
}
throw SoapFault11.create(sfe);
}
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class WSCOORClient method getRegistrationPortMap.
private static MAP getRegistrationPortMap(Map<String, Object> requestContext) {
final WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
MAP map;
if (WSCEnvironmentBean.SECURE_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getSecureServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME);
String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getSecureServiceURI(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME);
WSCLogger.logger.tracev("WSCOORClient Using secure endpoints {0} {1}", responseService, faultService);
map = AddressingHelper.outboundMap(requestContext, responseService, faultService);
} else if (WSCEnvironmentBean.PLAIN_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
String responseService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getServiceURI(CoordinationConstants.REGISTRATION_RESPONSE_SERVICE_NAME);
String faultService = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry().getServiceURI(CoordinationConstants.COORDINATION_SOAP_FAULT_SERVICE_NAME);
WSCLogger.logger.tracev("WSCOORClient Using plain endpoints {0} {1}", responseService, faultService);
map = AddressingHelper.outboundMap(requestContext, responseService, faultService);
} else {
WSCLogger.logger.tracev("WSCOORClient Using anonymous endpoints");
map = AddressingHelper.outboundMap(requestContext);
}
return map;
}
use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.
the class CoordinationFaultPortTypeImpl method soapFault.
@WebMethod(operationName = "SoapFault", action = "http://www.w3.org/2005/08/addressing/soap/fault")
@Oneway
@Action(input = "http://www.w3.org/2005/08/addressing/soap/fault")
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "fault") Fault fault) {
MessageContext ctx = webServiceCtx.getMessageContext();
MAP inboundMap = AddressingHelper.inboundMap(ctx);
if (inboundMap.getRelatesTo() != null) {
WSCLogger.logger.tracev("CoordinationFaultPortTypeImpl receiving fault for message={0} - string={1} code={2} details={3}", inboundMap.getRelatesTo().getRelatesTo(), fault.getFaultstring(), fault.getFaultcode(), fault.getDetail() == null ? "null" : fault.getDetail().getAny());
AsynchronousRegistrationMapper.getInstance().assignFault(inboundMap.getRelatesTo().getRelatesTo(), fault);
} else {
WSCLogger.i18NLogger.error_empty_messageId_received_by_async_endpoint();
}
}
Aggregations