use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsConfigurator method create.
public static JmsConfigurator 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();
JmsConfigurator result = new JmsConfigurator();
result.setConfigurationPrefix(portName);
result.setJmsConfiguration(new JMSConfiguration());
result.setServiceName(serviceName);
return result;
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsEndpointConfigurator method afterPropertiesSet.
@Override
public void afterPropertiesSet() throws Exception {
final JmsUriConfigurator cfg = JmsUriConfigurator.create(endpoint);
if (cfg == null) {
return;
}
final EndpointImpl ei = (EndpointImpl) endpoint;
CallContext.setupEndpoint(ei);
cfg.setPresetJmsAddress(ei.getAddress());
ei.setAddress(cfg.createJmsAddress());
if (publishEndpoint) {
ei.publish();
}
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class CallContext method setupEndpoint.
public static void setupEndpoint(final Endpoint endpoint) {
if (!(endpoint instanceof EndpointImpl)) {
throw new IllegalArgumentException("Only CXF JAX-WS endpoints supported. ");
}
final EndpointImpl ep = (EndpointImpl) endpoint;
final List<Feature> features = new ArrayList<Feature>();
features.add(new RequestCallbackFeature());
if (logging) {
features.add(new LoggingFeature());
}
if (serviceActivityMonitoring) {
features.add(getEventFeature());
}
if (ep.getFeatures() != null) {
features.addAll(ep.getFeatures());
}
ep.setFeatures(features);
ep.getProperties().put(NULL_MEANS_ONEWAY, Boolean.TRUE);
}
use of org.apache.cxf.jaxws.EndpointImpl in project tesb-rt-se by Talend.
the class JmsUriConfiguratorTest method testCreateEndpoint.
@Test
public void testCreateEndpoint() {
HelloWorldImpl implementor = new HelloWorldImpl();
String address = "local://JmsUriConfiguratorTest";
ep = Endpoint.publish(address, implementor);
Assert.assertNotNull(ep);
Assert.assertTrue(ep instanceof EndpointImpl);
JmsUriConfigurator conf = JmsUriConfigurator.create(ep);
Assert.assertNotNull(conf);
JmsUriConfiguration jmsConf = conf.createJmsUriConfiguration();
Assert.assertNotNull(jmsConf);
System.out.println("Configurator identifier is: " + conf.getConfiguration().getConfigurationIdentifier());
Assert.assertNotNull(conf.getConfiguration().getProperty("jndiInitialContextFactory"));
Assert.assertEquals("org.apache.activemq.jndi.ActiveMQInitialContextFactory", conf.getConfiguration().getProperty("jndiInitialContextFactory"));
// --------------------------------------------------------------------------------------------------
conf.setPresetJmsAddress("jms://");
conf.setVariant(jmsConf.getVariant());
conf.setDefaultVariant("jndi");
conf.setDestinationName(jmsConf.getDestinationName());
conf.setDefaultDestinationName("defaultDestinationName");
conf.setEndpointName("JmsUriConfiguratorTest");
Assert.assertEquals("jms://", conf.getPresetJmsAddress());
Assert.assertEquals("jndi", conf.getVariant());
Assert.assertEquals("jndi", conf.getDefaultVariant());
Assert.assertEquals("dynamicQueues/libraryprovider.queue", conf.getDestinationName());
Assert.assertEquals("defaultDestinationName", conf.getDefaultDestinationName());
Assert.assertEquals("jms:jndi:dynamicQueues/libraryprovider.queue?jndiConnectionFactoryName=ConnectionFactory&jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&jndiURL=tcp://localhost:61616", conf.getJmsAddress());
Assert.assertEquals("http://internal.test.requestcallback.mep.esb.talend.org/", conf.getServiceName().getNamespaceURI());
Assert.assertEquals("HelloWorldImplService", conf.getServiceName().getLocalPart());
Assert.assertEquals(new QName(null, "JmsUriConfiguratorTest"), conf.getEndpointName());
Assert.assertEquals("JmsUriConfiguratorTest", conf.getConfigurationPrefix());
Map<String, Object> m = new HashMap<String, Object>();
m.put("key1", "val1");
conf.setDefaultParameters(m);
Map m2 = conf.getDefaultParameters();
Assert.assertNotNull(m2);
Assert.assertEquals(1, m2.size());
Assert.assertTrue(m2.containsKey("key1"));
Assert.assertTrue(m2.containsValue("val1"));
conf.setParameters(m);
m2 = conf.getParameters();
Assert.assertNotNull(m2);
Assert.assertEquals(1, m2.size());
Assert.assertTrue(m2.containsKey("key1"));
Assert.assertTrue(m2.containsValue("val1"));
String jmsAddr = conf.getJmsAddress();
Assert.assertEquals(jmsAddr, conf.resetJmsAddress());
Assert.assertNotNull(conf.getJmsAddress());
conf.setServiceName("{http://example.com/}AService");
Assert.assertEquals(new QName("http://example.com/", "AService"), conf.getServiceName());
conf.setEndpointName(new QName("http://example.com/", "AService"));
Assert.assertEquals(new QName("http://example.com/", "AService"), conf.getEndpointName());
conf.setEncodeURI(true);
Assert.assertTrue(conf.isEncodeURI());
conf.setEncodeURI("none");
Assert.assertFalse(conf.isEncodeURI());
conf.setConfiguration(null);
Assert.assertNull(conf.getConfiguration());
}
use of org.apache.cxf.jaxws.EndpointImpl in project survey by markoniemi.
the class WebServiceConfig method pollServiceEndpoint.
@Bean
public Endpoint pollServiceEndpoint() {
EndpointImpl endpoint = new EndpointImpl(bus, pollService);
endpoint.setAddress("/soap/pollService");
endpoint.publish("/soap/pollService");
return endpoint;
}
Aggregations