use of org.apache.cxf.jaxws.EndpointImpl in project cxf by apache.
the class ProviderImpl method createEndpoint.
// new in 2.2
public Endpoint createEndpoint(String bindingId, Object implementor, WebServiceFeature... features) {
EndpointImpl ep = null;
if (EndpointUtils.isValidImplementor(implementor)) {
Bus bus = BusFactory.getThreadDefaultBus();
ep = createEndpointImpl(bus, bindingId, implementor, features);
return ep;
}
throw new WebServiceException(new Message("INVALID_IMPLEMENTOR_EXC", LOG).toString());
}
use of org.apache.cxf.jaxws.EndpointImpl in project iaf by ibissource.
the class NamespaceUriProviderBean method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
// TODO look into NamespaceHandlerResolver
Bus bus = (Bus) applicationContext.getBean("cxf");
if (bus instanceof SpringBus) {
log.debug("default CXF SpringBus [" + bus.getId() + "]");
log.info("registering NamespaceURI Provider with JAX-WS CXF Dispatcher");
namespaceRouter = new EndpointImpl(bus, new NamespaceUriProvider());
namespaceRouter.publish("/rpcrouter");
if (namespaceRouter.isPublished()) {
log.info("published NamespaceURI Provider on CXF endpoint [rpcrouter] on SpringBus [" + namespaceRouter.getBus().getId() + "]");
} else {
throw new IllegalStateException("unable to NamespaceURI Service Provider on CXF endpoint [rpcrouter]");
}
} else {
throw new IllegalStateException("CXF bus [" + bus + "] not instance of [SpringBus]");
}
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsConfiguratorTest method testCreateAndConfigureEndpoint.
@Test
public void testCreateAndConfigureEndpoint() {
HelloWorldImpl2 implementor = new HelloWorldImpl2();
String address = "local://JmsUriConfiguratorTest";
ep = Endpoint.publish(address, implementor);
JmsConfigurator jmsConfigurator = JmsConfigurator.create(ep);
Assert.assertNotNull(jmsConfigurator);
Assert.assertEquals("HelloWorldImpl2Port", jmsConfigurator.getConfigurationPrefix());
Assert.assertEquals(SERVICE_NAME, jmsConfigurator.getServiceName());
JMSConfiguration jmsConf = new JMSConfiguration();
jmsConfigurator.setJmsConfiguration(jmsConf);
Endpoint ep2 = jmsConfigurator.configureEndpoint(ep);
Assert.assertNotNull(ep2);
Configuration cnf = jmsConfigurator.getConfiguration();
Assert.assertNotNull(cnf);
Assert.assertEquals("org.apache.activemq.jndi.ActiveMQInitialContextFactory", cnf.get("jndiInitialContextFactory"));
Assert.assertEquals("jndi", cnf.get("variant"));
Assert.assertEquals("ConnectionFactory", cnf.get("jndiConnectionFactoryName"));
Assert.assertEquals("tcp://localhost:61616", cnf.get("jndiURL"));
Assert.assertEquals("dynamicQueues/libraryprovider.queue", cnf.get("destinationName"));
List<Feature> features = ((EndpointImpl) ep2).getFeatures();
boolean jmsConfigFeaturePresent = false;
for (Feature f : features) {
if (f instanceof org.apache.cxf.transport.jms.JMSConfigFeature) {
jmsConfigFeaturePresent = true;
break;
}
}
Assert.assertTrue(jmsConfigFeaturePresent);
}
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;
}
Aggregations