1 18 package org.apache.activemq.web; 19 20 import org.apache.activemq.broker.BrokerService; 21 import org.apache.activemq.broker.BrokerRegistry; 22 23 28 public class SingletonBrokerFacade extends LocalBrokerFacade { 29 public SingletonBrokerFacade() { 30 super(findSingletonBroker()); 31 } 32 33 protected static BrokerService findSingletonBroker() { 34 BrokerService broker = BrokerRegistry.getInstance().findFirst(); 35 if (broker == null) { 36 throw new IllegalArgumentException ("No BrokerService is registered with the BrokerRegistry." + 37 " Are you sure there is a configured broker in the same ClassLoader?"); 38 } 39 return broker; 40 } 41 } 42 | Popular Tags |