private String topicPrefix = "topic.";
public Context getInitialContext(Hashtable environment) throws NamingException {
// lets create a factory
Map data = new ConcurrentHashMap();
ActiveMQConnectionFactory factory = createConnectionFactory(environment);
data.put("ConnectionFactory", factory);
data.put("QueueConnectionFactory", factory);
data.put("TopicConnectionFactory", factory);
createQueues(data, environment);
createTopics(data, environment);
try {
Broker broker = factory.getEmbeddedBroker();
if (broker != null) {
data.put("destinations", broker.getDestinationContext(environment));
}
}
catch (JMSException e) {