geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r885340 - in /geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl: ./ codec/
Date Mon, 30 Nov 2009 06:55:49 GMT
Author: rwonly
Date: Mon Nov 30 06:55:46 2009
New Revision: 885340

URL: http://svn.apache.org/viewvc?rev=885340&view=rev
Log:
some updates, thanks Siqi for the patch.

Modified:
    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/BlueprintState.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/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/Util.java

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=885340&r1=885339&r2=885340&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
Mon Nov 30 06:55:46 2009
@@ -62,8 +62,7 @@
 
     public String[] getComponentIds(long containerServiceId) {
         BlueprintContainer container = getBlueprintContainer(containerServiceId);
-        Set<String> componentIds = container.getComponentIds();
-        return (String[]) componentIds.toArray(new String [componentIds.size()]);
+        return container.getComponentIds().toArray(new String[0]);
     }
 
     /*

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintState.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/BlueprintState.java?rev=885340&r1=885339&r2=885340&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintState.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx.impl/src/main/java/org/apache/geronimo/blueprint/jmx/impl/BlueprintState.java
Mon Nov 30 06:55:46 2009
@@ -31,7 +31,7 @@
     }
 
     public synchronized long[] getBlueprintBundleIds() throws IOException {
-        Long[] bundleIdKeys = (Long[]) dataMap.keySet().toArray(new Long [] {});
+        Long[] bundleIdKeys = dataMap.keySet().toArray(new Long[0]);
         long[] bundleIds = new long[bundleIdKeys.length];
         for (int i = 0; i < bundleIdKeys.length; i++) {
             bundleIds[i] = bundleIdKeys[i].longValue();

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=885340&r1=885339&r2=885340&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
Mon Nov 30 06:55:46 2009
@@ -24,7 +24,7 @@
 
     protected BPComponentMetadata(ComponentMetadata component) {
         activation = component.getActivation();
-        dependsOn = (String[]) component.getDependsOn().toArray(new String [] {});
+        dependsOn =  component.getDependsOn().toArray(new String[0]);
         id = (String) component.getId();
     }
 

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=885340&r1=885339&r2=885340&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
Mon Nov 30 06:55:46 2009
@@ -50,7 +50,7 @@
     public BPServiceMetadata(ServiceMetadata service) {
         super(service);
         autoExport = service.getAutoExport();
-        interfaces = (String[]) service.getInterfaces().toArray(new String [] {});
+        interfaces = service.getInterfaces().toArray(new String[0]);
         ranking = service.getRanking();
 
         listeners = new BPRegistrationListener[service.getRegistrationListeners().size()];

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=885340&r1=885339&r2=885340&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
Mon Nov 30 06:55:46 2009
@@ -23,9 +23,9 @@
     protected BPServiceReferenceMetadata(CompositeData reference) {
         super(reference);
         availability = (Integer) reference.get(BlueprintMetadataMBean.AVAILABILITY);
-        componentName = (String) reference.get(BlueprintMetadataMBean.DESTROY_METHOD);
-        filter = (String) reference.get(BlueprintMetadataMBean.FACTORY_METHOD);
-        $interface = (String) reference.get(BlueprintMetadataMBean.INIT_METHOD);
+        componentName = (String) reference.get(BlueprintMetadataMBean.COMPONENT_NAME);
+        filter = (String) reference.get(BlueprintMetadataMBean.FILTER);
+        $interface = (String) reference.get(BlueprintMetadataMBean.INTERFACE);
 
         CompositeData[] cd_listeners = (CompositeData[]) reference.get(BlueprintMetadataMBean.REFERENCE_LISTENERS);
         listeners = new BPReferenceListener[cd_listeners.length];
@@ -61,7 +61,7 @@
         for (int i = 0; i < listeners.length; i++) {
             cd_listeners[i] = listeners[i].asCompositeData();
         }
-        items.put(BlueprintMetadataMBean.ARGUMENTS, cd_listeners);
+        items.put(BlueprintMetadataMBean.REFERENCE_LISTENERS, cd_listeners);
 
         return items;
     }

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=885340&r1=885339&r2=885340&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
Mon Nov 30 06:55:46 2009
@@ -25,9 +25,8 @@
 public class Util {
 
     public static BPMetadata metadata2BPMetadata(Metadata metadata) {
-        if (metadata == null) {
+        if(null == metadata)
             return null;
-        }
         // target first
         if (metadata instanceof BeanMetadata)
             return new BPBeanMetadata((BeanMetadata) metadata);
@@ -68,6 +67,9 @@
     }
 
     public static BPMetadata binary2BPMetadata(byte[] buf) {
+        if(null == buf)
+            return null;
+        
         ByteArrayInputStream inBytes = new ByteArrayInputStream(buf);
         ObjectInputStream inObject;
         CompositeData metadata;
@@ -120,13 +122,13 @@
         if (metadata instanceof NullMetadata)
             return new BPNullMetadata(metadata);
 
-        return null;
+        throw new RuntimeException("Unknown metadata type");
     }
 
     public static byte[] bpMetadata2Binary(BPMetadata metadata) {
-        if (metadata == null) {
+        if(null == metadata)
             return null;
-        }
+        
         ByteArrayOutputStream outBytes = new ByteArrayOutputStream();
         ObjectOutputStream outObject;
         try {



Mime
View raw message