// create the application context
ClassPathXmlApplicationContext context =
new ClassPathXmlApplicationContext("org/apache/cxf/systest/jms/tx/jms_server_config.xml");
context.start();
EndpointImpl endpoint = new EndpointImpl(new GreeterImplWithTransaction());
endpoint.setAddress("jms://");
JMSConfiguration jmsConfig = new JMSConfiguration();
ConnectionFactory connectionFactory
= context.getBean("jmsConnectionFactory", ConnectionFactory.class);
jmsConfig.setConnectionFactory(connectionFactory);
jmsConfig.setTargetDestination("greeter.queue.noaop");
jmsConfig.setSessionTransacted(true);
jmsConfig.setPubSubDomain(false);
jmsConfig.setUseJms11(true);
jmsConfig.setTransactionManager(new JmsTransactionManager(connectionFactory));
jmsConfig.setCacheLevel(3);
JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
jmsConfigFeature.setJmsConfig(jmsConfig);
endpoint.getFeatures().add(jmsConfigFeature);
endpoint.publish();
}