use of org.apache.cxf.jaxws.DispatchImpl in project tesb-rt-se by Talend.
the class JmsConfigurator method configureDispatch.
public <T> Dispatch<T> configureDispatch(Dispatch<T> dispatch, String addressing) {
if (configuration == null) {
if (serviceName == null) {
return null;
}
configuration = CallContext.resolveConfiguration(serviceName);
}
String overrideAddress = getProperty("requestURI2010");
if (overrideAddress != null && (overrideAddress.equals(addressing) || OVERRIDE_BY_URI_CONFIG.equals(addressing))) {
return dispatch;
}
if (jmsConfiguration == null || !(dispatch instanceof DispatchImpl<?>) || (serviceName == null && configuration == null)) {
return null;
}
if (!jmsConfigured) {
setupJmsConfiguration();
}
final DispatchImpl<?> di = (DispatchImpl<?>) dispatch;
final Client cl = di.getClient();
final JMSConfigFeature feature = new JMSConfigFeature();
feature.setJmsConfig(jmsConfiguration);
feature.initialize(cl, cl.getBus());
return dispatch;
}
use of org.apache.cxf.jaxws.DispatchImpl in project tesb-rt-se by Talend.
the class JmsConfigurator method configureDispatch.
public <T> Dispatch<T> configureDispatch(Dispatch<T> dispatch) {
if (jmsConfiguration == null || !(dispatch instanceof DispatchImpl<?>) || (serviceName == null && configuration == null)) {
return null;
}
if (!jmsConfigured) {
setupJmsConfiguration();
}
final DispatchImpl<?> di = (DispatchImpl<?>) dispatch;
final Client cl = di.getClient();
final JMSConfigFeature feature = new JMSConfigFeature();
feature.setJmsConfig(jmsConfiguration);
feature.initialize(cl, cl.getBus());
return dispatch;
}
use of org.apache.cxf.jaxws.DispatchImpl in project tesb-rt-se by Talend.
the class JmsUriConfigurator method create.
public static JmsUriConfigurator create(Dispatch<?> dispatch) {
if (!(dispatch instanceof DispatchImpl<?>)) {
return null;
}
DispatchImpl<?> dsp = (DispatchImpl<?>) dispatch;
Client cl = dsp.getClient();
final QName serviceName;
try {
serviceName = cl.getEndpoint().getService().getName();
} catch (Exception e) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "Exception caught: ", e);
}
return null;
}
if (serviceName == null) {
return null;
}
EndpointInfo endpointInfo;
QName endpointName;
String endpointAddress;
try {
endpointInfo = cl.getEndpoint().getEndpointInfo();
endpointName = endpointInfo.getName();
endpointAddress = endpointInfo.getAddress();
} catch (Exception e) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "Exception caught: ", e);
}
endpointInfo = null;
endpointName = null;
endpointAddress = null;
}
final String portName = endpointName == null ? null : endpointName.getLocalPart();
JmsUriConfigurator result = new JmsUriConfigurator();
result.setConfigurationPrefix(portName);
result.setServiceName(serviceName);
if (endpointAddress != null && endpointAddress.startsWith("jms:")) {
result.setPresetJmsAddress(endpointAddress);
}
return result;
}
use of org.apache.cxf.jaxws.DispatchImpl in project tesb-rt-se by Talend.
the class JmsUriConfigurator method configureDispatch.
public <T> Dispatch<T> configureDispatch(Dispatch<T> dispatch) {
if (!(dispatch instanceof DispatchImpl<?>) || (serviceName == null && configuration == null)) {
return null;
}
final DispatchImpl<?> di = (DispatchImpl<?>) dispatch;
final Client cl = di.getClient();
try {
String jmsAddr = getJmsAddress();
cl.getRequestContext().put(Message.ENDPOINT_ADDRESS, jmsAddr);
cl.getEndpoint().getEndpointInfo().setAddress(jmsAddr);
} catch (Exception e) {
if (LOGGER.isLoggable(Level.FINER)) {
LOGGER.log(Level.FINER, "Exception caught: ", e);
}
return null;
}
return dispatch;
}
Aggregations