geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r884940 - in /geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl: Activator.java RegistrationStandardMBean.java codec/OSGiBlueprintEvent.java
Date Fri, 27 Nov 2009 18:22:15 GMT
Author: gawor
Date: Fri Nov 27 18:22:14 2009
New Revision: 884940

URL: http://svn.apache.org/viewvc?rev=884940&view=rev
Log:
StandardMBean does not deletege MBeanRegistration methods. BlueprintStateMBean seems to be
working now

Added:
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
  (with props)
Modified:
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/Activator.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/Activator.java?rev=884940&r1=884939&r2=884940&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/Activator.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/Activator.java
Fri Nov 27 18:22:14 2009
@@ -106,7 +106,7 @@
     protected synchronized void registerServices(MBeanServer mbeanServer) {
         // create BlueprintMetadataMBean
         try {
-            blueprintState = new StandardMBean(new BlueprintState(bundleContext), BlueprintStateMBean.class);
+            blueprintState = new RegistrationStandardMBean(new BlueprintState(bundleContext),
BlueprintStateMBean.class);
         } catch (NotCompliantMBeanException e) {
             System.out.println("Unable to create StandardMBean for BlueprintState" + e);
// Severe
             return;

Added: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java?rev=884940&view=auto
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
(added)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
Fri Nov 27 18:22:14 2009
@@ -0,0 +1,53 @@
+package org.apache.geronimo.blueprint.jmx.impl;
+
+import javax.management.MBeanRegistration;
+import javax.management.MBeanServer;
+import javax.management.NotCompliantMBeanException;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;
+
+public class RegistrationStandardMBean extends StandardMBean {
+
+    public <T> RegistrationStandardMBean(T implementation, Class<T> mbeanInterface)

+        throws NotCompliantMBeanException {
+        super(implementation, mbeanInterface);
+    }
+
+    @Override
+    public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception {
+        name = super.preRegister(server, name);
+        Object impl = getImplementation();
+        if (impl instanceof MBeanRegistration) {
+            return ((MBeanRegistration) impl).preRegister(server, name);
+        }
+        return name;
+    }
+
+    @Override
+    public void postRegister(Boolean registrationDone) {
+        super.postRegister(registrationDone);
+        Object impl = getImplementation();
+        if (impl instanceof MBeanRegistration) {
+            ((MBeanRegistration) impl).postRegister(registrationDone);
+        }
+    }
+
+    @Override
+    public void preDeregister() throws Exception {
+        super.preDeregister();
+        Object impl = getImplementation();
+        if (impl instanceof MBeanRegistration) {
+            ((MBeanRegistration) impl).preDeregister();
+        }
+    }
+
+    @Override
+    public void postDeregister() {
+        super.postDeregister();
+        Object impl = getImplementation();
+        if (impl instanceof MBeanRegistration) {
+            ((MBeanRegistration) impl).postDeregister();
+        }
+    }
+    
+}

Propchange: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/RegistrationStandardMBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java?rev=884940&r1=884939&r2=884940&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java
Fri Nov 27 18:22:14 2009
@@ -81,7 +81,7 @@
                 event.isReplay(),
                 event.getTimestamp(),
                 event.getDependencies(),
-                event.getCause().getMessage());
+                (event.getCause() == null) ? null : event.getCause().getMessage());
     }
 
     /**



Mime
View raw message