You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/06/06 14:51:38 UTC

[10/13] isis git commit: ISIS-1429: removing unused JmxBeanServer

ISIS-1429: removing unused JmxBeanServer


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/4a8c2368
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/4a8c2368
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/4a8c2368

Branch: refs/heads/master
Commit: 4a8c2368daab67792956f8c72c1359fb33136ec1
Parents: c465d41
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jun 4 20:31:03 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Jun 6 15:44:47 2016 +0100

----------------------------------------------------------------------
 .../isis/core/commons/jmx/JmxBeanServer.java    | 67 --------------------
 1 file changed, 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/4a8c2368/core/metamodel/src/main/java/org/apache/isis/core/commons/jmx/JmxBeanServer.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/commons/jmx/JmxBeanServer.java b/core/metamodel/src/main/java/org/apache/isis/core/commons/jmx/JmxBeanServer.java
deleted file mode 100644
index 86a1e9d..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/commons/jmx/JmxBeanServer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package org.apache.isis.core.commons.jmx;
-
-import java.lang.management.ManagementFactory;
-
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.ObjectName;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JmxBeanServer {
-
-    private static final Logger LOG = LoggerFactory.getLogger(JmxBeanServer.class);
-
-    private static JmxBeanServer instance;
-    private final MBeanServer server;
-
-    private JmxBeanServer() {
-        server = ManagementFactory.getPlatformMBeanServer();
-        instance = this;
-    }
-
-    public static JmxBeanServer getInstance() {
-        if (instance == null) {
-            LOG.info("JMX bean server created");
-            instance = new JmxBeanServer();
-        }
-        return instance;
-    }
-
-    public void register(final String name, final Object object) {
-        try {
-            final ObjectName objectName = new ObjectName("Isis:name=" + name);
-            server.registerMBean(object, objectName);
-            LOG.info(name + " JMX mbean registered: " + object);
-        } catch (final MalformedObjectNameException | NullPointerException | MBeanRegistrationException | NotCompliantMBeanException e) {
-            throw new RuntimeException(e);
-        } catch (final InstanceAlreadyExistsException e) {
-            LOG.info(name + " JMX mbean already registered: " + object);
-        }
-
-    }
-}
-
-// Copyright (c) Naked Objects Group Ltd.