geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r884408 - in /geronimo/sandbox/rex: org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/ org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/ org.apache.g...
Date Thu, 26 Nov 2009 06:23:57 GMT
Author: rwonly
Date: Thu Nov 26 06:23:56 2009
New Revision: 884408

URL: http://svn.apache.org/viewvc?rev=884408&view=rev
Log:
some updates on Metadata Mbean

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/BlueprintMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPBeanMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPCollectionMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPComponentMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPIdRefMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMapMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPNullMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPPropsMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPRefMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceListMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceReferenceMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPValueMetadata.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/OSGiBlueprintEvent.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/Util.java
    geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintMetadataMBean.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=884408&r1=884407&r2=884408&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
Thu Nov 26 06:23:56 2009
@@ -73,7 +73,7 @@
 
                 return mbeanServer;
             } catch (RuntimeException e) {
-                System.out.println("uncaught exception in addingService"); // Severe
+                System.out.println("uncaught exception in addingService" + e); // Severe
                 throw e;
             }
         }
@@ -108,7 +108,7 @@
         try {
             blueprintState = new StandardMBean(new BlueprintState(bundleContext), BlueprintStateMBean.class);
         } catch (NotCompliantMBeanException e) {
-            System.out.println("Unable to create StandardMBean for BlueprintState"); // Severe
+            System.out.println("Unable to create StandardMBean for BlueprintState" + e);
// Severe
             return;
         }
         // register BlueprintStateMBean to MBean server
@@ -119,16 +119,16 @@
         } catch (InstanceAlreadyExistsException e) {
             System.out.println("Cannot register BlueprintStateMBean"); // Fine
         } catch (MBeanRegistrationException e) {
-            System.out.println("Cannot register BlueprintStateMBean"); // Severe
+            System.out.println("Cannot register BlueprintStateMBean" + e); // Severe
         } catch (NotCompliantMBeanException e) {
-            System.out.println("Cannot register BlueprintStateMBean"); // Severe
+            System.out.println("Cannot register BlueprintStateMBean" + e); // Severe
         }
 
         // create BlueprintMetadataMBean
         try {
             blueprintMetadata = new StandardMBean(new BlueprintMetadata(bundleContext), BlueprintMetadataMBean.class);
         } catch (NotCompliantMBeanException e) {
-            System.out.println("Unable to create StandardMBean for BlueprintMetadata"); //
Severe
+            System.out.println("Unable to create StandardMBean for BlueprintMetadata" + e);
// Severe
             return;
         }
         // register BlueprintMetadataMBean to MBean server
@@ -139,9 +139,9 @@
         } catch (InstanceAlreadyExistsException e) {
             System.out.println("Cannot register BlueprintMetadataMBean"); // Fine
         } catch (MBeanRegistrationException e) {
-            System.out.println("Cannot register BlueprintMetadataMBean"); // Severe
+            System.out.println("Cannot register BlueprintMetadataMBean" + e); // Severe
         } catch (NotCompliantMBeanException e) {
-            System.out.println("Cannot register BlueprintMetadataMBean"); // Severe
+            System.out.println("Cannot register BlueprintMetadataMBean" + e); // Severe
         }
 
         servicesRegistered.set(true);

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadata.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/BlueprintMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintMetadata.java
Thu Nov 26 06:23:56 2009
@@ -2,6 +2,8 @@
 
 import java.io.IOException;
 
+import javax.management.openmbean.CompositeData;
+
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.apache.geronimo.blueprint.jmx.impl.codec.BPMetadata;
 import org.apache.geronimo.blueprint.jmx.impl.codec.Util;
@@ -31,7 +33,6 @@
      */
     public long getBlueprintContainerServiceId(long bundleId) throws IOException {
         Bundle bpBundle = bundleContext.getBundle(bundleId);
-
         String filter = "(&(osgi.blueprint.container.symbolicname=" // no similar one
in interfaces
                 + bpBundle.getSymbolicName() + ")(osgi.blueprint.container.version=" + bpBundle.getVersion()
+ "))";
         ServiceReference[] serviceReferences = null;
@@ -40,10 +41,7 @@
         } catch (InvalidSyntaxException e) {
             throw new RuntimeException(e);
         }
-        if (serviceReferences != null)
-            return (Long) serviceReferences[0].getProperty(Constants.SERVICE_ID);
-        else
-            return -1;
+        return serviceReferences == null ? -1 : (Long) serviceReferences[0].getProperty(Constants.SERVICE_ID);
     }
 
     public long[] getBlueprintContainerServiceIds() throws IOException {
@@ -51,6 +49,7 @@
         try {
             serviceReferences = bundleContext.getServiceReferences(BlueprintContainer.class.getName(),
null);
         } catch (InvalidSyntaxException e) {
+            throw new RuntimeException(e);
         }
         long[] serviceIds = new long[serviceReferences.length];
         for (int i = 0; i < serviceReferences.length; i++) {
@@ -60,16 +59,7 @@
     }
 
     public String[] getComponentIds(long containerServiceId) {
-        String filter = "(" + Constants.SERVICE_ID + "=" + containerServiceId + ")";
-        ServiceReference[] serviceReferences = null;
-        try {
-            serviceReferences = bundleContext.getServiceReferences(BlueprintContainer.class.getName(),
filter);
-        } catch (InvalidSyntaxException e) {
-            throw new RuntimeException(e);
-        }
-        if (serviceReferences == null)
-            return null;
-        BlueprintContainer container = (BlueprintContainer) bundleContext.getService(serviceReferences[0]);
+        BlueprintContainer container = getBlueprintContainer(containerServiceId);
         return (String[]) container.getComponentIds().toArray();
     }
 
@@ -80,16 +70,7 @@
      * @see org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean#getComponentIdsByType(long,
java.lang.String)
      */
     public String[] getComponentIdsByType(long containerServiceId, String type) {
-        String filter = "(" + Constants.SERVICE_ID + "=" + containerServiceId + ")";
-        ServiceReference[] serviceReferences = null;
-        try {
-            serviceReferences = bundleContext.getServiceReferences(BlueprintContainer.class.getName(),
filter);
-        } catch (InvalidSyntaxException e) {
-            throw new RuntimeException(e);
-        }
-        if (serviceReferences == null)
-            return null;
-        BlueprintContainer container = (BlueprintContainer) bundleContext.getService(serviceReferences[0]);
+        BlueprintContainer container = getBlueprintContainer(containerServiceId);
         ComponentMetadata[] components;
         if (type.equals(BlueprintMetadataMBean.SERVICE_MATADATA))
             components = (ComponentMetadata[]) container.getMetadata(ServiceMetadata.class).toArray();
@@ -106,7 +87,14 @@
         return ids;// (String [])container.getMetadata(type).toArray();
     }
 
-    public byte[] getComponentMetadata(long containerServiceId, String componentId) {
+    public CompositeData getComponentMetadata(long containerServiceId, String componentId)
{
+        BlueprintContainer container = getBlueprintContainer(containerServiceId);
+        ComponentMetadata componentMetadata = container.getComponentMetadata(componentId);
+        BPMetadata metadata = Util.metadata2BPMetadata(componentMetadata);
+        return metadata.asCompositeData();
+    }
+
+    private BlueprintContainer getBlueprintContainer(long containerServiceId) {
         String filter = "(" + Constants.SERVICE_ID + "=" + containerServiceId + ")";
         ServiceReference[] serviceReferences = null;
         try {
@@ -114,11 +102,8 @@
         } catch (InvalidSyntaxException e) {
             throw new RuntimeException(e);
         }
-        if (serviceReferences == null)
-            return null;
-        BlueprintContainer container = (BlueprintContainer) bundleContext.getService(serviceReferences[0]);
-        ComponentMetadata componentMetadata = container.getComponentMetadata(componentId);
-        BPMetadata metadata = Util.metadata2BPMetadata(componentMetadata);
-        return Util.bpMetadata2Binary(metadata);
+
+        return serviceReferences == null ? null : (BlueprintContainer) bundleContext.getService(serviceReferences[0]);
     }
+
 }

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPBeanMetadata.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/BPBeanMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPBeanMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPBeanMetadata.java
Thu Nov 26 06:23:56 2009
@@ -11,7 +11,7 @@
 import org.osgi.service.blueprint.reflect.BeanMetadata;
 import org.osgi.service.blueprint.reflect.BeanProperty;
 
-public class BPBeanMetadata extends BPComponentMetadata implements BPTarget, TransferObject
{
+public class BPBeanMetadata extends BPComponentMetadata implements BPTarget {
 
     private String className;
 

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPCollectionMetadata.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/BPCollectionMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPCollectionMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPCollectionMetadata.java
Thu Nov 26 06:23:56 2009
@@ -10,7 +10,7 @@
 import org.osgi.service.blueprint.reflect.CollectionMetadata;
 import org.osgi.service.blueprint.reflect.Metadata;
 
-public class BPCollectionMetadata implements BPNonNullMetadata, TransferObject {
+public class BPCollectionMetadata implements BPNonNullMetadata {
     private String collectionClass;
 
     private String valueType;

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPComponentMetadata.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/BPComponentMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPComponentMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPComponentMetadata.java
Thu Nov 26 06:23:56 2009
@@ -8,7 +8,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 
-public class BPComponentMetadata implements BPNonNullMetadata {
+public abstract class BPComponentMetadata implements BPNonNullMetadata {
     private int activation;
 
     private String[] dependsOn;

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPIdRefMetadata.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/BPIdRefMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPIdRefMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPIdRefMetadata.java
Thu Nov 26 06:23:56 2009
@@ -9,7 +9,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.IdRefMetadata;
 
-public class BPIdRefMetadata implements BPNonNullMetadata, TransferObject {
+public class BPIdRefMetadata implements BPNonNullMetadata {
     private String componentId;
 
     public BPIdRefMetadata(CompositeData idRef) {

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMapMetadata.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/BPMapMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMapMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMapMetadata.java
Thu Nov 26 06:23:56 2009
@@ -10,7 +10,7 @@
 import org.osgi.service.blueprint.reflect.MapEntry;
 import org.osgi.service.blueprint.reflect.MapMetadata;
 
-public class BPMapMetadata implements BPNonNullMetadata, TransferObject {
+public class BPMapMetadata implements BPNonNullMetadata {
     private String keyType;
 
     private String valueType;

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMetadata.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/BPMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPMetadata.java
Thu Nov 26 06:23:56 2009
@@ -1,5 +1,5 @@
 package org.apache.geronimo.blueprint.jmx.impl.codec;
 
-public interface BPMetadata {
+public interface BPMetadata extends TransferObject{
     // marker interface
 }

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPNullMetadata.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/BPNullMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPNullMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPNullMetadata.java
Thu Nov 26 06:23:56 2009
@@ -7,7 +7,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.NullMetadata;
 
-public class BPNullMetadata implements BPMetadata, TransferObject {
+public class BPNullMetadata implements BPMetadata {
     public BPNullMetadata(CompositeData Null) {
     	//do nothing ?
     }

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPPropsMetadata.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/BPPropsMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPPropsMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPPropsMetadata.java
Thu Nov 26 06:23:56 2009
@@ -10,7 +10,7 @@
 import org.osgi.service.blueprint.reflect.MapEntry;
 import org.osgi.service.blueprint.reflect.PropsMetadata;
 
-public class BPPropsMetadata implements BPNonNullMetadata, TransferObject {
+public class BPPropsMetadata implements BPNonNullMetadata {
     BPMapEntry[] entries;
 
     public BPPropsMetadata(CompositeData props) {

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPRefMetadata.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/BPRefMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPRefMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPRefMetadata.java
Thu Nov 26 06:23:56 2009
@@ -9,7 +9,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.RefMetadata;
 
-public class BPRefMetadata implements BPNonNullMetadata, BPTarget, TransferObject {
+public class BPRefMetadata implements BPNonNullMetadata, BPTarget {
     private String componentId;
 
     public BPRefMetadata(CompositeData ref) {

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceListMetadata.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/BPReferenceListMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceListMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceListMetadata.java
Thu Nov 26 06:23:56 2009
@@ -9,7 +9,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.ReferenceListMetadata;
 
-public class BPReferenceListMetadata extends BPServiceReferenceMetadata implements TransferObject
{
+public class BPReferenceListMetadata extends BPServiceReferenceMetadata {
     private int memberType;
 
     public BPReferenceListMetadata(CompositeData ref_list) {

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceMetadata.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/BPReferenceMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPReferenceMetadata.java
Thu Nov 26 06:23:56 2009
@@ -9,7 +9,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 
-public class BPReferenceMetadata extends BPServiceReferenceMetadata implements BPTarget,
TransferObject {
+public class BPReferenceMetadata extends BPServiceReferenceMetadata implements BPTarget {
 
     private long timeout;
 

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceMetadata.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/BPServiceMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceMetadata.java
Thu Nov 26 06:23:56 2009
@@ -11,7 +11,7 @@
 import org.osgi.service.blueprint.reflect.RegistrationListener;
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
 
-public class BPServiceMetadata extends BPComponentMetadata implements TransferObject {
+public class BPServiceMetadata extends BPComponentMetadata {
 
     private int autoExport;
 

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceReferenceMetadata.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/BPServiceReferenceMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceReferenceMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPServiceReferenceMetadata.java
Thu Nov 26 06:23:56 2009
@@ -8,8 +8,7 @@
 import org.osgi.service.blueprint.reflect.ReferenceListener;
 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
 
-public class BPServiceReferenceMetadata extends BPComponentMetadata// implements ServiceReferenceMetadata
-{
+public abstract class BPServiceReferenceMetadata extends BPComponentMetadata {
 
     private int availability;
 

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPValueMetadata.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/BPValueMetadata.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPValueMetadata.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/BPValueMetadata.java
Thu Nov 26 06:23:56 2009
@@ -9,7 +9,7 @@
 import org.apache.geronimo.blueprint.jmx.BlueprintMetadataMBean;
 import org.osgi.service.blueprint.reflect.ValueMetadata;
 
-public class BPValueMetadata implements BPNonNullMetadata, TransferObject {
+public class BPValueMetadata implements BPNonNullMetadata {
     private String stringValue;
 
     private String type;

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=884408&r1=884407&r2=884408&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
Thu Nov 26 06:23:56 2009
@@ -51,7 +51,7 @@
  * </table>
  */
 
-public class OSGiBlueprintEvent {
+public class OSGiBlueprintEvent implements TransferObject{
     
     private long bundleId;
 

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/Util.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/Util.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/Util.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/codec/Util.java
Thu Nov 26 06:23:56 2009
@@ -121,16 +121,11 @@
     }
 
     public static byte[] bpMetadata2Binary(BPMetadata metadata) {
-        if (!(metadata instanceof TransferObject))
-            throw new RuntimeException("Non-TransferObject metadata can not be translated
into byte array");
-
-        TransferObject data = (TransferObject) metadata;
-
         ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
         ObjectOutputStream outObject;
         try {
             outObject = new ObjectOutputStream(outBytes);
-            outObject.writeObject(data.asCompositeData());
+            outObject.writeObject(metadata.asCompositeData());
             outObject.close();
         } catch (IOException e) {// there is no io op
             throw new RuntimeException(e);

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintMetadataMBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintMetadataMBean.java?rev=884408&r1=884407&r2=884408&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintMetadataMBean.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintMetadataMBean.java
Thu Nov 26 06:23:56 2009
@@ -3,6 +3,7 @@
 import java.io.IOException;
 
 import javax.lang.model.type.ArrayType;
+import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.CompositeType;
 import javax.management.openmbean.SimpleType;
 
@@ -1065,56 +1066,15 @@
     
     /**
      * Returns the ComponentMetadata according to the its component id.
-     * The returned Composite Data is serialized and stored in a byte array, 
-     * typed by {@link JmxConstants#PRIMITIVE_BYTE_ARRAY_TYPE}.
+     * The returned Composite Data's type is actually one of {@link #BEAN_METADATA_TYPE},

+     * {@link #SERVICE_METADATA_TYPE}, {@link #REFERENCE_METADATA_TYPE}, REFERENCE_LIST_METADATA_TYPE.
      * 
      * @param containerServiceId The blueprint container service id
      * @param componentId The component id
-     * @return the serialized ComponentMetadata, see {@link JmxConstants#PRIMITIVE_BYTE_ARRAY_TYPE}
+     * @return the ComponentMetadata
      */
-    public byte [] getComponentMetadata(long containerServiceId, String componentId);
-    
-//    
-//    /**
-//     * Returns the BeanMetadata according to the its component id.
-//     * The returned Composite Data is typed by {@link #BEAN_METADATA_TYPE}.
-//     * 
-//     * @param containerServiceId The blueprint container service id
-//     * @param componentId The component id
-//     * @return the BeanMetadata, see {@link #BEAN_METADATA_TYPE}
-//     */
-//    CompositeData getBeanMetadata(long containerServiceId, String componentId);
-//    
-//    /**
-//     * Returns the ServiceMetadata according to the its component id.
-//     * The returned Composite Data is typed by {@link #SERVICE_MATADATA_TYPE}.
-//     * 
-//     * @param containerServiceId The blueprint container service id
-//     * @param componentId The component id
-//     * @return the ServiceMetadata, see {@link #SERVICE_MATADATA_TYPE} 
-//     */
-//    CompositeData getServiceMetadata(long containerServiceId, String componentId);
-//    
-//    /**
-//     * Returns the ReferenceMetadata according to the its component id.
-//     * The returned Composite Data is typed by {@link #REFERENCE_METADATA_TYPE}.
-//     * 
-//     * @param containerServiceId The blueprint container service id
-//     * @param componentId The component id
-//     * @return the ReferenceMetadata, see {@link #REFERENCE_METADATA_TYPE}
-//     */
-//    CompositeData getReferenceMetadata(long containerServiceId, String componentId);
-//    
-//    /**
-//     * Returns the ReferenceListMetadata according to the its component id.
-//     * The returned Composite Data is typed by {@link #REFERENCE_LIST_METADATA_TYPE}.
-//     * 
-//     * @param containerServiceId The blueprint container service id
-//     * @param componentId The component id
-//     * @return the ReferenceListMetadata, see {@link #REFERENCE_LIST_METADATA_TYPE} 
-//     */
-//    CompositeData getReferenceListMetadata(long containerServiceId, String componentId);
-    
+    public CompositeData getComponentMetadata(long containerServiceId, String componentId);
+        
     /**
      * Returns all the blueprint containers' service IDs, which successfully
      * created from blueprint bundles.



Mime
View raw message