/** * @param brokerName * @return the BrokerService */ public MessageBrokerView lookup(String brokerName) { MessageBrokerView result = null; synchronized (mutex) { result = brokerViews.get(brokerName); if (result==null){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService != null){ result = new MessageBrokerView(brokerService); brokerViews.put(brokerName,result); } } } return result; } }
/** * Create a view of a running Broker * @param brokerName */ public MessageBrokerView(String brokerName){ this.brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService == null){ throw new NullPointerException("BrokerService is null"); } if (!brokerService.isStarted()){ throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); } }
public MessageInterceptorRegistry get(String brokerName){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); return get(brokerService); }
private boolean validateBroker(String host) { boolean result = true; if (BROKERS.containsKey(host) || SERVERS.containsKey(host) || CONNECTORS.containsKey(host)) { // check the broker is still in the BrokerRegistry TransportConnector connector = CONNECTORS.get(host); if (BrokerRegistry.getInstance().lookup(host) == null || (connector != null && connector.getBroker().isStopped())) { result = false; // clean-up BROKERS.remove(host); SERVERS.remove(host); if (connector != null) { CONNECTORS.remove(host); if (connector != null) { ServiceSupport.dispose(connector); } } } } return result; } }
BrokerService broker = null; synchronized(registry.getRegistryMutext()) { broker = registry.lookup(brokerName); if (broker == null || waitForStart > 0) { final long expiry = System.currentTimeMillis() + waitForStart; LOG.debug("waiting for broker named: " + brokerName + " to enter registry"); registry.getRegistryMutext().wait(timeout); broker = registry.lookup(brokerName); } catch (InterruptedException ignored) {
if (brokerRegistry.lookup(getBrokerName()) == null) { brokerRegistry.bind(getBrokerName(), BrokerService.this);
/** * @param registry * @param brokerName * @param waitForStart - time in milliseconds to wait for a broker to appear * @return */ private BrokerService lookupBroker(final BrokerRegistry registry, final String brokerName, int waitForStart) { BrokerService broker = null; synchronized(registry.getRegistryMutext()) { broker = registry.lookup(brokerName); if (broker == null && waitForStart > 0) { final long expiry = System.currentTimeMillis() + waitForStart; while (broker == null && expiry > System.currentTimeMillis()) { long timeout = Math.max(0, expiry - System.currentTimeMillis()); try { LOG.debug("waiting for broker named: " + brokerName + " to start"); registry.getRegistryMutext().wait(timeout); } catch (InterruptedException ignored) { } broker = registry.lookup(brokerName); } } } return broker; }
/** * Create a view of a running Broker * @param brokerName */ public MessageBrokerView(String brokerName){ this.brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService == null){ throw new NullPointerException("BrokerService is null"); } if (!brokerService.isStarted()){ throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); } }
/** * Create a view of a running Broker * @param brokerName */ public MessageBrokerView(String brokerName){ this.brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService == null){ throw new NullPointerException("BrokerService is null"); } if (!brokerService.isStarted()){ throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); } }
public MessageInterceptorRegistry get(String brokerName){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); return get(brokerService); }
/** * @param brokerName * @return the BrokerService */ public MessageBrokerView lookup(String brokerName) { MessageBrokerView result = null; synchronized (mutex) { result = brokerViews.get(brokerName); if (result==null){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService != null){ result = new MessageBrokerView(brokerService); brokerViews.put(brokerName,result); } } } return result; } }
/** * @param brokerName * @return the BrokerService */ public MessageBrokerView lookup(String brokerName) { MessageBrokerView result = null; synchronized (mutex) { result = brokerViews.get(brokerName); if (result==null){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService != null){ result = new MessageBrokerView(brokerService); brokerViews.put(brokerName,result); } } } return result; } }
/** * @param brokerName * @return the BrokerService */ public MessageBrokerView lookup(String brokerName) { MessageBrokerView result = null; synchronized (mutex) { result = brokerViews.get(brokerName); if (result==null){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService != null){ result = new MessageBrokerView(brokerService); brokerViews.put(brokerName,result); } } } return result; } }
private BrokerService getProvider () { return BrokerRegistry.getInstance().lookup(getJmsBrokerName()); }
public MessageInterceptorRegistry get(String brokerName){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); return get(brokerService); }
public MessageInterceptorRegistry get(String brokerName){ BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerName); return get(brokerService); }
/** * Create a view of a running Broker * @param brokerName */ public MessageBrokerView(String brokerName){ this.brokerService = BrokerRegistry.getInstance().lookup(brokerName); if (brokerService == null){ throw new NullPointerException("BrokerService is null"); } if (!brokerService.isStarted()){ throw new IllegalStateException("BrokerService " + brokerService.getBrokerName() + " is not started"); } }
private boolean validateBroker(String host) { boolean result = true; if (BROKERS.containsKey(host) || SERVERS.containsKey(host) || CONNECTORS.containsKey(host)) { // check the broker is still in the BrokerRegistry TransportConnector connector = CONNECTORS.get(host); if (BrokerRegistry.getInstance().lookup(host) == null || (connector != null && connector.getBroker().isStopped())) { result = false; // clean-up BROKERS.remove(host); SERVERS.remove(host); if (connector != null) { CONNECTORS.remove(host); if (connector != null) { ServiceSupport.dispose(connector); } } } } return result; } }
private boolean validateBroker(String host) { boolean result = true; if (BROKERS.containsKey(host) || SERVERS.containsKey(host) || CONNECTORS.containsKey(host)) { // check the broker is still in the BrokerRegistry TransportConnector connector = CONNECTORS.get(host); if (BrokerRegistry.getInstance().lookup(host) == null || (connector != null && connector.getBroker().isStopped())) { result = false; // clean-up BROKERS.remove(host); SERVERS.remove(host); if (connector != null) { CONNECTORS.remove(host); if (connector != null) { ServiceSupport.dispose(connector); } } } } return result; } }
private boolean validateBroker(String host) { boolean result = true; if (BROKERS.containsKey(host) || SERVERS.containsKey(host) || CONNECTORS.containsKey(host)) { // check the broker is still in the BrokerRegistry TransportConnector connector = CONNECTORS.get(host); if (BrokerRegistry.getInstance().lookup(host) == null || (connector != null && connector.getBroker().isStopped())) { result = false; // clean-up BROKERS.remove(host); SERVERS.remove(host); if (connector != null) { CONNECTORS.remove(host); if (connector != null) { ServiceSupport.dispose(connector); } } } } return result; } }