use of org.apache.cxf.jaxws.context.WebServiceContextImpl in project cxf by apache.
the class ProviderImpl method createEndpoint.
// new in 2.2
public Endpoint createEndpoint(String bindingId, Class<?> implementorClass, Invoker invoker, WebServiceFeature... features) {
if (EndpointUtils.isValidImplementor(implementorClass)) {
Bus bus = BusFactory.getThreadDefaultBus();
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
if (features != null) {
factory.getJaxWsServiceFactory().setWsFeatures(Arrays.asList(features));
}
if (invoker != null) {
factory.setInvoker(new JAXWSMethodInvoker(invoker));
try {
invoker.inject(new WebServiceContextImpl());
} catch (Exception e) {
throw new WebServiceException(new Message("ENDPOINT_CREATION_FAILED_MSG", LOG).toString(), e);
}
}
EndpointImpl ep = new EndpointImpl(bus, null, factory);
ep.setImplementorClass(implementorClass);
return ep;
}
throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}
Aggregations