use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsConfigurator method configureEndpoint.
public Endpoint configureEndpoint(Endpoint endpoint) {
if (jmsConfiguration == null || !(endpoint instanceof EndpointImpl) || (serviceName == null && configuration == null)) {
return null;
}
if (!jmsConfigured) {
setupJmsConfiguration();
}
final EndpointImpl ei = (EndpointImpl) endpoint;
final JMSConfigFeature feature = new JMSConfigFeature();
feature.setJmsConfig(jmsConfiguration);
List<Feature> features = ei.getFeatures();
if (features == null) {
features = new ArrayList<Feature>();
}
features.add(feature);
ei.setFeatures(features);
return endpoint;
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsUriConfigurator method create.
public static JmsUriConfigurator create(Endpoint endpoint) {
if (!(endpoint instanceof EndpointImpl)) {
return null;
}
final EndpointImpl ep = (EndpointImpl) endpoint;
final QName serviceName = ep.getServiceName();
if (serviceName == null) {
return null;
}
final QName endpointName = ep.getEndpointName();
final String portName = endpointName == null ? null : endpointName.getLocalPart();
JmsUriConfigurator result = new JmsUriConfigurator();
result.setConfigurationPrefix(portName);
result.setServiceName(serviceName);
return result;
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class CallContext method createCallbackEndpoint.
public static Endpoint createCallbackEndpoint(final Object implementor, final CallbackInfo cbInfo, final String policyAlias) {
final Bus bus = BusFactory.getThreadDefaultBus();
final JaxWsServerFactoryBean serverFactory = new JaxWsServerFactoryBean();
final List<Feature> features = new ArrayList<Feature>();
features.add(new RequestCallbackFeature());
if (logging) {
features.add(new LoggingFeature());
}
if (serviceActivityMonitoring) {
features.add(getEventFeature());
}
serverFactory.setFeatures(features);
final QName cbInterfaceName;
final String wsdlLocation;
if (cbInfo == null) {
cbInterfaceName = null;
wsdlLocation = null;
} else {
cbInterfaceName = cbInfo.getCallbackPortTypeName();
wsdlLocation = cbInfo.getEffectiveCallbackReceiverWsdlLocation(policyAlias);
}
final boolean useWsdlLocation = wsdlLocation != null && cbInfo.getCallbackServiceName() != null && cbInfo.getCallbackPortName() != null;
if (cbInterfaceName != null) {
final QName cbServiceName = cbInfo.getCallbackServiceName() == null ? new QName(cbInterfaceName.getNamespaceURI(), cbInterfaceName.getLocalPart() + "Service") : cbInfo.getCallbackServiceName();
final QName cbEndpointName = cbInfo.getCallbackServiceName() == null ? new QName(cbInterfaceName.getNamespaceURI(), cbInterfaceName.getLocalPart() + "ServicePort") : new QName(cbServiceName.getNamespaceURI(), cbInfo.getCallbackPortName() == null ? cbServiceName.getLocalPart() + "Port" : cbInfo.getCallbackPortName());
serverFactory.setServiceName(cbServiceName);
serverFactory.setEndpointName(cbEndpointName);
final List<AbstractServiceConfiguration> svcConfigs = serverFactory.getServiceFactory().getServiceConfigurations();
for (ListIterator<AbstractServiceConfiguration> it = svcConfigs.listIterator(); it.hasNext(); ) {
final AbstractServiceConfiguration cfg = it.next();
if (cfg instanceof DefaultServiceConfiguration) {
final AbstractServiceConfiguration ncfg = new CallbackDefaultServiceConfiguration(cbInfo);
it.set(ncfg);
}
}
if (useWsdlLocation) {
serverFactory.setWsdlLocation(wsdlLocation);
}
}
final EndpointImpl endpoint = new EndpointImpl(bus, implementor, serverFactory);
endpoint.setFeatures(features);
endpoint.getProperties().put(NULL_MEANS_ONEWAY, Boolean.TRUE);
if (cbInterfaceName != null) {
endpoint.setEndpointName(serverFactory.getEndpointName());
endpoint.setServiceName(serverFactory.getServiceName());
if (useWsdlLocation) {
endpoint.setWsdlLocation(wsdlLocation);
}
}
return endpoint;
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class RequestCallbackOutInterceptor method doHandleSoapMessage.
private void doHandleSoapMessage(SoapMessage message) throws Fault {
final Object callbackEndpoint = message.getContextualProperty(RequestCallbackFeature.CALLBACK_ENDPOINT_PROPERTY_NAME);
if (callbackEndpoint != null) {
final String callbackEndpointAddress;
if (callbackEndpoint instanceof String) {
callbackEndpointAddress = (String) callbackEndpoint;
} else if (callbackEndpoint instanceof EndpointImpl) {
callbackEndpointAddress = ((EndpointImpl) callbackEndpoint).getAddress();
} else {
throw new IllegalArgumentException("Unsupported type of endpoint. ");
}
doHandleRequestSoapMessage(message, callbackEndpointAddress);
return;
}
final CallContext ctx = (CallContext) message.getContextualProperty(RequestCallbackFeature.CALLCONTEXT_PROPERTY_NAME);
if (ctx != null) {
doHandleCallbackSoapMessage(message, ctx);
return;
}
}
use of org.apache.cxf.jaxws.EndpointImpl in project springBoot-learn-demo by nbfujx.
the class CxfConfig method endpoint.
@Bean
public Endpoint endpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, examplecontroller);
// 接口发布在 /NetbarServices 目录下
endpoint.publish("/ExampleService");
return endpoint;
}
Aggregations