@Override public void stop() throws Exception { connector.stop(); }
protected void unregisterNetworkBridgeMBean(NetworkBridge bridge) { if (!getBrokerService().isUseJmx()) { return; } try { ObjectName objectName = createNetworkBridgeObjectName(bridge); getBrokerService().getManagementContext().unregisterMBean(objectName); } catch (Throwable e) { LOG.debug("Network bridge could not be unregistered in JMX: {}", e.getMessage(), e); } }
protected NetworkBridge configureBridge(DemandForwardingBridgeSupport result) { List<ActiveMQDestination> destsList = getDynamicallyIncludedDestinations(); ActiveMQDestination dests[] = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setDynamicallyIncludedDestinations(dests); destsList = getExcludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setExcludedDestinations(dests); destsList = getStaticallyIncludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setStaticallyIncludedDestinations(dests); result.setDurableDestinations(getDurableTopicDestinations(durableDestinations)); return result; }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
protected NetworkBridge configureBridge(DemandForwardingBridgeSupport result) { List<ActiveMQDestination> destsList = getDynamicallyIncludedDestinations(); ActiveMQDestination dests[] = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setDynamicallyIncludedDestinations(dests); destsList = getExcludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setExcludedDestinations(dests); destsList = getStaticallyIncludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setStaticallyIncludedDestinations(dests); if (durableDestinations != null) { HashSet<ActiveMQDestination> topics = new HashSet<ActiveMQDestination>(); for (ActiveMQDestination d : durableDestinations) { if( d.isTopic() ) { topics.add(d); } } ActiveMQDestination[] dest = new ActiveMQDestination[topics.size()]; dest = (ActiveMQDestination[])topics.toArray(dest); result.setDurableDestinations(dest); } return result; }
@Override public String getName() { return connector.getName(); }
@Override public String getPassword() { String pw = connector.getPassword(); // Hide the password for security reasons. if (pw != null) { pw = pw.replaceAll(".", "*"); } return pw; }
@Override public int getPrefetchSize() { return connector.getPrefetchSize(); }
protected ObjectName createNetworkBridgeObjectName(NetworkBridge bridge) throws MalformedObjectNameException { return BrokerMBeanSupport.createNetworkBridgeObjectName(getObjectName(), bridge.getRemoteAddress()); }
public NetworkConnector getNetworkConnectorByName(String connectorName) { for (NetworkConnector connector : networkConnectors) { if (connector.getName().equals(connectorName)) { return connector; } } return null; }
@Override public String getPassword() { String pw = connector.getPassword(); // Hide the password for security reasons. if (pw != null) { pw = pw.replaceAll(".", "*"); } return pw; }
@Override public int getPrefetchSize() { return connector.getPrefetchSize(); }
protected ObjectName createNetworkBridgeObjectName(NetworkBridge bridge) throws MalformedObjectNameException { return BrokerMBeanSupport.createNetworkBridgeObjectName(getObjectName(), bridge.getRemoteAddress()); }
protected NetworkBridge configureBridge(DemandForwardingBridgeSupport result) { List<ActiveMQDestination> destsList = getDynamicallyIncludedDestinations(); ActiveMQDestination dests[] = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setDynamicallyIncludedDestinations(dests); destsList = getExcludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setExcludedDestinations(dests); destsList = getStaticallyIncludedDestinations(); dests = destsList.toArray(new ActiveMQDestination[destsList.size()]); result.setStaticallyIncludedDestinations(dests); result.setDurableDestinations(getDurableTopicDestinations(durableDestinations)); return result; }
protected void registerNetworkBridgeMBean(NetworkBridge bridge) { if (!getBrokerService().isUseJmx()) { return; } NetworkBridgeViewMBean view = new NetworkBridgeView(bridge); try { ObjectName objectName = createNetworkBridgeObjectName(bridge); AnnotatedMBean.registerMBean(getBrokerService().getManagementContext(), view, objectName); } catch (Throwable e) { LOG.debug("Network bridge could not be registered in JMX: {}", e.getMessage(), e); } }
/** * stop the connector */ @Override public void stop() throws Exception { LOG.info("stopping context..."); for (NetworkConnector connector : connectorMap.values()) { connector.stop(); } connectorMap.clear(); referenceMap.clear(); uuidMap.clear(); context.close(); }
@Override public String addNetworkConnector(String discoveryAddress) throws Exception { NetworkConnector connector = brokerService.addNetworkConnector(discoveryAddress); if (connector == null) { throw new NoSuchElementException("Not connector matched the given name: " + discoveryAddress); } brokerService.registerNetworkConnectorMBean(connector); connector.start(); return connector.getName(); }
public ObjectName createNetworkConnectorObjectName(NetworkConnector connector) throws MalformedObjectNameException { return BrokerMBeanSupport.createNetworkConnectorName(getBrokerObjectName(), "networkConnectors", connector.getName()); }
@Override public String getPassword() { String pw = connector.getPassword(); // Hide the password for security reasons. if (pw != null) { pw = pw.replaceAll(".", "*"); } return pw; }