String destType = specImpl.getDestinationType();
String destName = specImpl.getDestination();
try {
Destination dest;
try {
Context ctx = new InitialContext();
dest = (Destination) ctx.lookup(destName);
} catch (javax.naming.NamingException exc) {
String shortName = removePrefix(destName);
if ("javax.jms.Queue".equals(destType))
dest = AdminModule.createQueue(serverId,
shortName,
"org.objectweb.joram.mom.dest.Queue",
null);
else if ("javax.jms.Topic".equals(destType))
dest = AdminModule.createTopic(serverId,
shortName,
"org.objectweb.joram.mom.dest.Topic",
null);
else
throw new NotSupportedException("Invalid destination type provided as activation parameter: " + destType);
dest.setFreeReading();
dest.setFreeWriting();
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO,
" - Destination [" + shortName + "] has been created.");