From f9172a33f9b0e3cf504fc06c5710fd1837b61e9f Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Wed, 6 Jan 2016 12:45:19 -0600 Subject: [PATCH] Allow topics to be configured in tomcat. --- .../jms/resource/NevadoReferencableFactory.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java b/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java index 075defc..c8a7d2c 100644 --- a/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java +++ b/nevado-jms/src/main/java/org/skyscreamer/nevado/jms/resource/NevadoReferencableFactory.java @@ -78,10 +78,18 @@ public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable en instance = connectionFactory; } else if (ref.getClassName().equals(NevadoQueue.class.getName())) { - instance = new NevadoQueue(getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME)); + String destinationName = getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME); + if (destinationName == null) { + destinationName = name.toString(); + } + instance = new NevadoQueue(destinationName); } else if (ref.getClassName().equals(NevadoTopic.class.getName())) { - instance = new NevadoTopic(getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME)); + String destinationName = getRefContent(ref, NevadoDestination.JNDI_DESTINATION_NAME); + if (destinationName == null) { + destinationName = name.toString(); + } + instance = new NevadoTopic(destinationName); } else { throw new IllegalArgumentException("This factory does not support objects of type "