[CVS nano] unending!

Paul Hammant <paul-yCVjj/[email protected]> Mon, 17 Nov 2003 16:02:14 -0600
Newsgroups gmane.comp.java.nanocontainer.cvs
Message-ID <[email protected]>
Commit in nano/jmx/src/java/org/nanocontainer/jmx on MAIN

NanoMBean.java -27 1.1 removed

NanoMXComponentAdapter.java -92 1.4 removed

NanoMXComponentAdapterFactory.java -25 1.1 removed

NanoMXContainer.java -84 1.7 removed

NanoMXInitializationException.java -36 1.1 removed

NanoMXRegistrationException.java -39 1.2 removed

package.html -8 1.1 removed

-311

7 removed files

unending!

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMBean.java removed after 1.1

diff -N NanoMBean.java
--- NanoMBean.java 10 Sep 2003 15:22:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,27 +0,0 @@

-/*****************************************************************************
- * Copyright (C) NanoContainer Organization. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * The software in this package is published under the terms of the BSD *
- * style license a copy of which has been included with this distribution in *
- * the LICENSE.txt file. *
- * *
- * Original code by James Strachan *
- *****************************************************************************/
-package org.nanocontainer.jmx;
-
-import mx4j.AbstractDynamicMBean;
-
-/**
- * @author James Strachan
- * @version $Revision: 1.1 $
- */
-public class NanoMBean extends AbstractDynamicMBean {
-
- public NanoMBean(Object component) {
- setResource(component);
- }
- /* Method of the second group that is overridden */
- protected String getMBeanDescription() {
- return "A simple DynamicMBean";
- }
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMXComponentAdapter.java removed after 1.4

diff -N NanoMXComponentAdapter.java
--- NanoMXComponentAdapter.java 15 Oct 2003 06:40:02 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,92 +0,0 @@

-/*****************************************************************************
- * Copyright (C) NanoContainer Organization. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * The software in this package is published under the terms of the BSD *
- * style license a copy of which has been included with this distribution in *
- * the LICENSE.txt file. *
- * *
- * Original code by James Strachan and Mauro Talevi *
- *****************************************************************************/
-package org.nanocontainer.jmx;
-
-import org.picocontainer.extras.DecoratingComponentAdapter;
-import org.picocontainer.ComponentAdapter;
-import org.picocontainer.defaults.AssignabilityRegistrationException;
-import org.picocontainer.defaults.NotConcreteRegistrationException;
-import org.picocontainer.PicoInitializationException;
-import org.picocontainer.PicoIntrospectionException;
-import org.picocontainer.MutablePicoContainer;
-
-import javax.management.*;
-
-/**
- * @author James Strachan
- * @author Mauro Talevi
- * @author Jeppe Cramon
- * @version $Revision: 1.4 $
- */
-public class NanoMXComponentAdapter extends DecoratingComponentAdapter {
-
- private final MBeanServer mbeanServer;
- private Object componentInstance;
-
- /**
- * @param mbeanServer
- */
- public NanoMXComponentAdapter(MBeanServer mbeanServer, ComponentAdapter delegate) {
- super(delegate);
- this.mbeanServer = mbeanServer;
- }
-
- public Object getComponentInstance(MutablePicoContainer picoContainer) throws PicoInitializationException, PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
- if (componentInstance == null) {
- componentInstance = super.getComponentInstance(picoContainer);
-
- ObjectName name = null;
- try {
- name = asObjectName(getComponentKey());
- Object mbean = asMBean(componentInstance);
- mbeanServer.registerMBean(mbean, name);
- } catch (MalformedObjectNameException e) {
- throw new NanoMXInitializationException("Failed to register MBean '" + name + "' for component '" + getComponentKey() + "', due to " + e.getMessage(), e);
- } catch (MBeanRegistrationException e) {
- throw new NanoMXInitializationException("Failed to register MBean '" + name + "' for component '" + getComponentKey() + "', due to " + e.getMessage(), e);
- } catch (NotCompliantMBeanException e) {
- throw new NanoMXInitializationException("Failed to register MBean '" + name + "' for component '" + getComponentKey() + "', due to " + e.getMessage(), e);
- } catch (InstanceAlreadyExistsException e) {
- throw new NanoMXInitializationException("Failed to register MBean '" + name + "' for component '" + getComponentKey() + "', due to " + e.getMessage(), e);
- }
- return componentInstance;
- }
- return componentInstance;
- }
-
- public static Object asMBean(Object component) {
- return new NanoMBean(component);
- }
-
- /**
- * Ensures that the given key is converted to a JMX ObjectName
- * @param key
- * @return an ObjectName based on the given key
- */
- public static ObjectName asObjectName(Object key) throws MalformedObjectNameException {
- if (key == null) {
- throw new NullPointerException("key cannot be null");
- }
- if (key instanceof ObjectName) {
- return (ObjectName) key;
- }
- if (key instanceof Class) {
- Class clazz = (Class) key;
- return new ObjectName("nanomx:type=" + clazz.getName());
- } else {
- String text = key.toString();
- // Fix, so it works under WebSphere ver. 5
- if (text.indexOf(':') == -1) {
- text = "nanomx:type=" + text;
- }
- return new ObjectName(text);
- }
- }
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMXComponentAdapterFactory.java removed after 1.1

diff -N NanoMXComponentAdapterFactory.java
--- NanoMXComponentAdapterFactory.java 10 Sep 2003 15:22:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,25 +0,0 @@

-package org.nanocontainer.jmx;
-
-import org.picocontainer.defaults.ComponentAdapterFactory;
-import org.picocontainer.ComponentAdapter;
-import org.picocontainer.defaults.AssignabilityRegistrationException;
-import org.picocontainer.defaults.NotConcreteRegistrationException;
-import org.picocontainer.Parameter;
-import org.picocontainer.PicoIntrospectionException;
-
-import javax.management.MBeanServer;
-import java.io.Serializable;
-
-public class NanoMXComponentAdapterFactory implements ComponentAdapterFactory, Serializable {
- private MBeanServer mbeanServer;
- private ComponentAdapterFactory delegate;
-
- public NanoMXComponentAdapterFactory(MBeanServer mbeanServer, ComponentAdapterFactory componentAdapterFactory) {
- this.mbeanServer = mbeanServer;
- delegate = componentAdapterFactory;
- }
-
- public ComponentAdapter createComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
- return new NanoMXComponentAdapter(mbeanServer, delegate.createComponentAdapter(componentKey, componentImplementation, parameters));
- }
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMXContainer.java removed after 1.7

diff -N NanoMXContainer.java
--- NanoMXContainer.java 3 Nov 2003 17:05:58 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,84 +0,0 @@

-/*****************************************************************************
- * Copyright (C) NanoContainer Organization. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * The software in this package is published under the terms of the BSD *
- * style license a copy of which has been included with this distribution in *
- * the LICENSE.txt file. *
- * *
- * Original code by James Strachan and Mauro Talevi *
- *****************************************************************************/
-
-package org.nanocontainer.jmx;
-
-import org.picocontainer.PicoRegistrationException;
-import org.picocontainer.defaults.*;
-import org.picocontainer.defaults.ComponentAdapterFactory;
-
-import javax.management.*;
-import java.io.Serializable;
-
-/**
- * A simple PicoContainer which allow multiple implementations of the same interface
- * and any component registered with the internals is also registered into JMX
- * for viewing in a JMX management console.
- *
- * @author James Strachan
- * @author Mauro Talevi
- * @author Aslak Helles&oslash;y
- * @author Jeppe Cramon
- * @version $Revision: 1.7 $
- */
-public class NanoMXContainer extends DefaultPicoContainer implements Serializable {
-
- private MBeanServer mbeanServer;
-
- public NanoMXContainer(MBeanServer mbeanServer, ComponentAdapterFactory componentAdapterFactory) {
- super(new NanoMXComponentAdapterFactory(mbeanServer, componentAdapterFactory));
- this.mbeanServer = mbeanServer;
- }
-
- public NanoMXContainer(MBeanServer mbeanServer) {
- this(mbeanServer, new DefaultComponentAdapterFactory());
- }
-
- public NanoMXContainer() {
- this(MBeanServerFactory.newMBeanServer());
- MBeanServerFactory.createMBeanServer();
- }
-
- public MBeanServer getMBeanServer() {
- return mbeanServer;
- }
-
- /**
- * Registers a new constructed component with the given key
- *
- * @param key is the key (or name) used to lookup the component in the future
- * @param component is the component to be registered
- * @throws PicoRegistrationException
- */
- public synchronized Object registerComponentInstance(Object key, Object component)
- throws PicoRegistrationException {
- ObjectName name = null;
- try {
- name = NanoMXComponentAdapter.asObjectName(key);
- Object result = super.registerComponentInstance(key, component);
-
- Object mbean = NanoMXComponentAdapter.asMBean(component);
- mbeanServer.registerMBean(mbean, name);
-
- return result;
- } catch (InstanceAlreadyExistsException e) {
- throw new NanoMXRegistrationException("Failed to register MBean '" + name + "' for component '" + key + "', due to " + e.getMessage(), e);
- } catch (MBeanRegistrationException e) {
- throw new NanoMXRegistrationException("Failed to register MBean '" + name + "' for component '" + key + "', due to " + e.getMessage(), e);
- } catch (NotCompliantMBeanException e) {
- throw new NanoMXRegistrationException("Failed to register MBean '" + name + "' for component '" + key + "', due to " + e.getMessage(), e);
- } catch (MalformedObjectNameException e) {
- throw new NanoMXRegistrationException("Failed to register MBean '" + name + "' for component '" + key + "', due to " + e.getMessage(), e);
- } catch (PicoRegistrationException e) {
- throw new NanoMXRegistrationException("Failed to register MBean '" + name + "' for component '" + key + "', due to " + e.getMessage(), e);
- }
- }
-
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMXInitializationException.java removed after 1.1

diff -N NanoMXInitializationException.java
--- NanoMXInitializationException.java 10 Sep 2003 15:22:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@

-/*****************************************************************************
- * Copyright (C) NanoContainer Organization. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * The software in this package is published under the terms of the BSD *
- * style license a copy of which has been included with this distribution in *
- * the LICENSE.txt file. *
- * *
- * Original code by James Strachan and Mauro Talevi *
- *****************************************************************************/
-package org.nanocontainer.jmx;
-
-import org.picocontainer.PicoInitializationException;
-
-/**
- * A registration exception caused trying to register the component with JMX
- *
- * @author James Strachan
- * @author Mauro Talevi
- * @version $Revision: 1.1 $
- */
-public class NanoMXInitializationException extends PicoInitializationException {
- public NanoMXInitializationException() {
- }
-
- public NanoMXInitializationException(String message) {
- super(message);
- }
-
- public NanoMXInitializationException(Throwable cause) {
- super(cause);
- }
-
- public NanoMXInitializationException(String message, Throwable cause) {
- super(message, cause);
- }
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

NanoMXRegistrationException.java removed after 1.2

diff -N NanoMXRegistrationException.java
--- NanoMXRegistrationException.java 15 Oct 2003 06:40:02 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,39 +0,0 @@

-/*****************************************************************************
- * Copyright (C) NanoContainer Organization. All rights reserved. *
- * ------------------------------------------------------------------------- *
- * The software in this package is published under the terms of the BSD *
- * style license a copy of which has been included with this distribution in *
- * the LICENSE.txt file. *
- * *
- * Original code by James Strachan and Mauro Talevi *
- *****************************************************************************/
-package org.nanocontainer.jmx;
-
-import org.picocontainer.PicoRegistrationException;
-
-/**
- * A registration exception caused trying to register the component with JMX
- *
- * @author James Strachan
- * @author Mauro Talevi
- * @author Jeppe Cramon
- * @version $Revision: 1.2 $
- */
-public class NanoMXRegistrationException extends PicoRegistrationException {
- public NanoMXRegistrationException() {
- super();
- }
-
- public NanoMXRegistrationException(String message) {
- super(message);
- }
-
-
- public NanoMXRegistrationException(String message, Exception cause) {
- super(message, cause);
- }
-
- public NanoMXRegistrationException(Throwable cause) {
- super(cause);
- }
-}

----------

nano /jmx /src /java /org /nanocontainer /jmx

package.html removed after 1.1

diff -N package.html
--- package.html 10 Sep 2003 15:22:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@

-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-</head>
-<body>
-Foo
-</body>
-</html>