diff options
Diffstat (limited to 'policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java')
-rw-r--r-- | policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java index 9136defb..04f0dfd0 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/jmx/PdpJmxListener.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * policy-core * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,36 +35,41 @@ import org.slf4j.LoggerFactory; public class PdpJmxListener { - public static final Logger logger = LoggerFactory.getLogger(PdpJmxListener.class); + public static final Logger logger = LoggerFactory.getLogger(PdpJmxListener.class); - private PdpJmxListener() { - } + private PdpJmxListener() { + } - public static void stop() { - final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - try { - server.unregisterMBean(new ObjectName("PolicyEngine:type=PdpJmx")); - } catch (MBeanRegistrationException | InstanceNotFoundException - | MalformedObjectNameException e) { - logger.error("PdpJmxListener.stop(): " + - "Could not unregister PolicyEngine:type=PdpJmx MBean " + - "with the MBean server", e); - } - - } + /** + * Stop the listener. + */ + public static void stop() { + final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + try { + server.unregisterMBean(new ObjectName("PolicyEngine:type=PdpJmx")); + } catch (MBeanRegistrationException | InstanceNotFoundException + | MalformedObjectNameException e) { + logger.error("PdpJmxListener.stop(): " + + "Could not unregister PolicyEngine:type=PdpJmx MBean " + + "with the MBean server", e); + } - - public static void start() { - final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); - try { - server.registerMBean(PdpJmx.getInstance(), new ObjectName("PolicyEngine:type=PdpJmx")); - } catch (InstanceAlreadyExistsException | MBeanRegistrationException - | NotCompliantMBeanException | MalformedObjectNameException e) { - logger.error("PdpJmxListener.start(): " + - "Could not unregister PolicyEngine:type=PdpJmx MBean " + - "with the MBean server", e); - } - - } + } + + /** + * Start. + */ + public static void start() { + final MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + try { + server.registerMBean(PdpJmx.getInstance(), new ObjectName("PolicyEngine:type=PdpJmx")); + } catch (InstanceAlreadyExistsException | MBeanRegistrationException + | NotCompliantMBeanException | MalformedObjectNameException e) { + logger.error("PdpJmxListener.start(): " + + "Could not unregister PolicyEngine:type=PdpJmx MBean " + + "with the MBean server", e); + } + + } } |