/** * Starts the management context. * Creates and registers a TransportLoggerControl MBean which enables the user * to enable/disable logging for all transport loggers at once. */ private void createTransportLoggerControl(int port) { try { this.managementContext = new ManagementContext(); this.managementContext.setConnectorPort(port); this.managementContext.start(); } catch (Exception e) { LOG.error("Management context could not be started, reason: " + e, e); } try { this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl"); AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName); this.transportLoggerControlCreated = true; } catch (Exception e) { LOG.error("TransportLoggerControlMBean could not be registered, reason: " + e, e); } }
@Autowired public ActiveMqMessagingService(DaemonThreadStatsCollector daemonThreadStatsCollector) throws Exception { this.daemonThreadStatsCollector = daemonThreadStatsCollector; SystemEnvironment systemEnvironment = new SystemEnvironment(); broker = new BrokerService(); broker.setBrokerName(BROKER_NAME); broker.setPersistent(false); broker.setUseJmx(systemEnvironment.getActivemqUseJmx()); broker.getManagementContext().setConnectorPort(systemEnvironment.getActivemqConnectorPort()); broker.start(); factory = new ActiveMQConnectionFactory(BROKER_URL); factory.getPrefetchPolicy().setQueuePrefetch(systemEnvironment.getActivemqQueuePrefetch()); factory.setCopyMessageOnSend(false); connection = (ActiveMQConnection) factory.createConnection(); connection.start(); }
/** * Starts the management context. * Creates and registers a TransportLoggerControl MBean which enables the user * to enable/disable logging for all transport loggers at once. */ private void createTransportLoggerControl(int port) { try { this.managementContext = new ManagementContext(); this.managementContext.setConnectorPort(port); this.managementContext.start(); } catch (Exception e) { LOG.error("Management context could not be started, reason: " + e, e); } try { this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl"); AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName); this.transportLoggerControlCreated = true; } catch (Exception e) { LOG.error("TransportLoggerControlMBean could not be registered, reason: " + e, e); } }
/** * Starts the management context. * Creates and registers a TransportLoggerControl MBean which enables the user * to enable/disable logging for all transport loggers at once. */ private void createTransportLoggerControl(int port) { try { this.managementContext = new ManagementContext(); this.managementContext.setConnectorPort(port); this.managementContext.start(); } catch (Exception e) { LOG.error("Management context could not be started, reason: " + e, e); } try { this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl"); AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName); this.transportLoggerControlCreated = true; } catch (Exception e) { LOG.error("TransportLoggerControlMBean could not be registered, reason: " + e, e); } }
/** * Starts the management context. * Creates and registers a TransportLoggerControl MBean which enables the user * to enable/disable logging for all transport loggers at once. */ private void createTransportLoggerControl(int port) { try { this.managementContext = new ManagementContext(); this.managementContext.setConnectorPort(port); this.managementContext.start(); } catch (Exception e) { LOG.error("Management context could not be started, reason: " + e, e); } try { this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl"); AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName); this.transportLoggerControlCreated = true; } catch (Exception e) { LOG.error("TransportLoggerControlMBean could not be registered, reason: " + e, e); } }
/** * Starts the management context. * Creates and registers a TransportLoggerControl MBean which enables the user * to enable/disable logging for all transport loggers at once. */ private void createTransportLoggerControl(int port) { try { this.managementContext = new ManagementContext(); this.managementContext.setConnectorPort(port); this.managementContext.start(); } catch (Exception e) { LOG.error("Management context could not be started, reason: " + e, e); } try { this.objectName = new ObjectName(this.managementContext.getJmxDomainName()+":"+ "Type=TransportLoggerControl"); AnnotatedMBean.registerMBean(this.managementContext, new TransportLoggerControl(this.managementContext),this.objectName); this.transportLoggerControlCreated = true; } catch (Exception e) { LOG.error("TransportLoggerControlMBean could not be registered, reason: " + e, e); } }