if (isTopic) {
TopicConnectionFactory factory = (TopicConnectionFactory)
context.lookup(OPENJMS_TOPIC);
context.close();
return factory.createTopicConnection();
} else {
QueueConnectionFactory factory = (QueueConnectionFactory)
context.lookup(OPENJMS_QUEUE);
context.close();