protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { Destination dest = null; destinationsLock.readLock().lock(); try { dest = destinations.get(destination); } finally { destinationsLock.readLock().unlock(); } if (dest == null) { if (isAutoCreateDestinations()) { // Try to auto create the destination... re-invoke broker // from the // top so that the proper security checks are performed. dest = context.getBroker().addDestination(context, destination, createTemporary); } if (dest == null) { throw new JMSException("The destination " + destination + " does not exist."); } } return dest; }
protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { Destination dest = null; destinationsLock.readLock().lock(); try { dest = destinations.get(destination); } finally { destinationsLock.readLock().unlock(); } if (dest == null) { if (isAutoCreateDestinations()) { // Try to auto create the destination... re-invoke broker // from the // top so that the proper security checks are performed. dest = context.getBroker().addDestination(context, destination, createTemporary); } if (dest == null) { throw new JMSException("The destination " + destination + " does not exist."); } } return dest; }
protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { Destination dest = null; destinationsLock.readLock().lock(); try { dest = destinations.get(destination); } finally { destinationsLock.readLock().unlock(); } if (dest == null) { if (isAutoCreateDestinations()) { // Try to auto create the destination... re-invoke broker // from the // top so that the proper security checks are performed. dest = context.getBroker().addDestination(context, destination, createTemporary); } if (dest == null) { throw new JMSException("The destination " + destination + " does not exist."); } } return dest; }
protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { Destination dest = null; destinationsLock.readLock().lock(); try { dest = destinations.get(destination); } finally { destinationsLock.readLock().unlock(); } if (dest == null) { if (isAutoCreateDestinations()) { // Try to auto create the destination... re-invoke broker // from the // top so that the proper security checks are performed. dest = context.getBroker().addDestination(context, destination, createTemporary); } if (dest == null) { throw new JMSException("The destination " + destination + " does not exist."); } } return dest; }
protected Destination lookup(ConnectionContext context, ActiveMQDestination destination,boolean createTemporary) throws Exception { Destination dest = null; synchronized (destinationsMutex) { dest = destinations.get(destination); } if (dest == null) { if (isAutoCreateDestinations()) { // Try to auto create the destination... re-invoke broker // from the // top so that the proper security checks are performed. try { context.getBroker().addDestination(context, destination, createTemporary); dest = addDestination(context, destination, false); } catch (DestinationAlreadyExistsException e) { // if the destination already exists then lets ignore // this error } // We should now have the dest created. synchronized (destinationsMutex) { dest = destinations.get(destination); } } if (dest == null) { throw new JMSException("The destination " + destination + " does not exist."); } } return dest; }