/** * Creates the {@code MBeanServer} instance. */ @Override public void afterPropertiesSet() throws MBeanServerNotFoundException { // Try to locate existing MBeanServer, if desired. if (this.locateExistingServerIfPossible || this.agentId != null) { try { this.server = locateMBeanServer(this.agentId); } catch (MBeanServerNotFoundException ex) { // If agentId was specified, we were only supposed to locate that // specific MBeanServer; so let's bail if we can't find it. if (this.agentId != null) { throw ex; } logger.debug("No existing MBeanServer found - creating new one"); } } // Create a new MBeanServer and register it, if desired. if (this.server == null) { this.server = createMBeanServer(this.defaultDomain, this.registerWithFactory); this.newlyRegistered = this.registerWithFactory; } }
/** * Creates the {@code MBeanServer} instance. */ @Override public void afterPropertiesSet() throws MBeanServerNotFoundException { // Try to locate existing MBeanServer, if desired. if (this.locateExistingServerIfPossible || this.agentId != null) { try { this.server = locateMBeanServer(this.agentId); } catch (MBeanServerNotFoundException ex) { // If agentId was specified, we were only supposed to locate that // specific MBeanServer; so let's bail if we can't find it. if (this.agentId != null) { throw ex; } logger.debug("No existing MBeanServer found - creating new one"); } } // Create a new MBeanServer and register it, if desired. if (this.server == null) { this.server = createMBeanServer(this.defaultDomain, this.registerWithFactory); this.newlyRegistered = this.registerWithFactory; } }
/** * Creates the {@code MBeanServer} instance. */ @Override public void afterPropertiesSet() throws MBeanServerNotFoundException { // Try to locate existing MBeanServer, if desired. if (this.locateExistingServerIfPossible || this.agentId != null) { try { this.server = locateMBeanServer(this.agentId); } catch (MBeanServerNotFoundException ex) { // If agentId was specified, we were only supposed to locate that // specific MBeanServer; so let's bail if we can't find it. if (this.agentId != null) { throw ex; } logger.debug("No existing MBeanServer found - creating new one"); } } // Create a new MBeanServer and register it, if desired. if (this.server == null) { this.server = createMBeanServer(this.defaultDomain, this.registerWithFactory); this.newlyRegistered = this.registerWithFactory; } }