public String createMessageDestinationWithJMSAdapter()
{
String serviceId = "message-service";
String id = "messaging_AMF_Poll_JMS_Topic_Runtime";
MessageService msgService = (MessageService)msgBroker.getService(serviceId);
MessageDestination msgDestination = (MessageDestination)msgService.createDestination(id);
msgDestination.addChannel("my-amf-poll");
// Use JMSSettings object for the <jms> properties above
JMSSettings js = new JMSSettings();
js.setConnectionFactory("java:comp/env/jms/flex/TopicConnectionFactory");
js.setDestinationType("Topic");
js.setMessageType("javax.jms.TextMessage");
js.setDestinationJNDIName("java:comp/env/jms/topic/flex/simpletopic");
JMSAdapter adapter = new JMSAdapter();
adapter.setId("jms");
adapter.setJMSSettings(js);
adapter.setDestination(msgDestination);
if (msgService.isStarted())
msgDestination.start();
return "Destination: " + id + " created for Service: " + serviceId;
}