geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwo...@apache.org
Subject svn commit: r883992 [2/2] - 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.ap...
Date Wed, 25 Nov 2009 06:46:16 GMT
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=883992&r1=883991&r2=883992&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
Wed Nov 25 06:46:13 2009
@@ -24,122 +24,118 @@
 
 public class Util {
 
-	public static BPMetadata metadata2BPMetadata(Metadata metadata)
-	{
-		//target first
-		if(metadata instanceof BeanMetadata)
-			return new BPBeanMetadata((BeanMetadata)metadata);
-		
-		if(metadata instanceof ReferenceMetadata)
-			return new BPReferenceMetadata((ReferenceMetadata)metadata);
-		
-		if(metadata instanceof RefMetadata)
-			return new BPRefMetadata((RefMetadata)metadata);
-		
-		//others
-		if(metadata instanceof CollectionMetadata)
-			return new BPCollectionMetadata((CollectionMetadata)metadata);
-		
-		if(metadata instanceof ServiceMetadata)
-			return new BPServiceMetadata((ServiceMetadata)metadata);
-		
-		if(metadata instanceof ReferenceListMetadata)
-			return new BPReferenceListMetadata((ReferenceListMetadata)metadata);
-		
-		if(metadata instanceof IdRefMetadata)
-			return new BPIdRefMetadata((IdRefMetadata)metadata);
-		
-		if(metadata instanceof MapMetadata)
-			return new BPMapMetadata((MapMetadata)metadata);
-		
-		if(metadata instanceof PropsMetadata)
-			return new BPPropsMetadata((PropsMetadata)metadata);
-		
-		if(metadata instanceof ValueMetadata)
-			return new BPValueMetadata((ValueMetadata)metadata);
-		
-		//null last
-		if(metadata instanceof NullMetadata)
-			return new BPNullMetadata((NullMetadata)metadata);
-		
-		throw new RuntimeException("Unknown metadata type");
-	}
-	
-	public static BPMetadata binary2BPMetadata(byte [] buf)
-	{
-		ByteArrayInputStream inBytes = new ByteArrayInputStream(buf);
+    public static BPMetadata metadata2BPMetadata(Metadata metadata) {
+        // target first
+        if (metadata instanceof BeanMetadata)
+            return new BPBeanMetadata((BeanMetadata) metadata);
+
+        if (metadata instanceof ReferenceMetadata)
+            return new BPReferenceMetadata((ReferenceMetadata) metadata);
+
+        if (metadata instanceof RefMetadata)
+            return new BPRefMetadata((RefMetadata) metadata);
+
+        // others
+        if (metadata instanceof CollectionMetadata)
+            return new BPCollectionMetadata((CollectionMetadata) metadata);
+
+        if (metadata instanceof ServiceMetadata)
+            return new BPServiceMetadata((ServiceMetadata) metadata);
+
+        if (metadata instanceof ReferenceListMetadata)
+            return new BPReferenceListMetadata((ReferenceListMetadata) metadata);
+
+        if (metadata instanceof IdRefMetadata)
+            return new BPIdRefMetadata((IdRefMetadata) metadata);
+
+        if (metadata instanceof MapMetadata)
+            return new BPMapMetadata((MapMetadata) metadata);
+
+        if (metadata instanceof PropsMetadata)
+            return new BPPropsMetadata((PropsMetadata) metadata);
+
+        if (metadata instanceof ValueMetadata)
+            return new BPValueMetadata((ValueMetadata) metadata);
+
+        // null last
+        if (metadata instanceof NullMetadata)
+            return new BPNullMetadata((NullMetadata) metadata);
+
+        throw new RuntimeException("Unknown metadata type");
+    }
+
+    public static BPMetadata binary2BPMetadata(byte[] buf) {
+        ByteArrayInputStream inBytes = new ByteArrayInputStream(buf);
         ObjectInputStream inObject;
         CompositeData metadata;
-		try {
-			inObject = new ObjectInputStream(inBytes);
-			metadata = (CompositeData)inObject.readObject();
-	        inObject.close();
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		} catch (ClassNotFoundException e) {
-			e.printStackTrace();
-			return null;
-		}
-        
-        
+        try {
+            inObject = new ObjectInputStream(inBytes);
+            metadata = (CompositeData) inObject.readObject();
+            inObject.close();
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        } catch (ClassNotFoundException e) {
+            e.printStackTrace();
+            return null;
+        }
+
         String typename = metadata.getCompositeType().getTypeName();
-        
-		//target first
-		if(typename.equals(BlueprintMetadataMBean.BEAN_METADATA))
-			return new BPBeanMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.REFERENCE_METADATA))
-			return new BPReferenceMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.REF_METADATA))
-			return new BPRefMetadata(metadata);
-		
-		//others
-		if(typename.equals(BlueprintMetadataMBean.COLLECTION_METADATA))
-			return new BPCollectionMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.SERVICE_MATADATA))
-			return new BPServiceMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.REFERENCE_LIST_METADATA))
-  		    return new BPReferenceListMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.ID_REF_METADATA))
-			return new BPIdRefMetadata(metadata);
-
-		if(typename.equals(BlueprintMetadataMBean.MAP_METADATA))
-			return new BPMapMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.PROPS_METADATA))
-			return new BPPropsMetadata(metadata);
-		
-		if(typename.equals(BlueprintMetadataMBean.VALUE_METADATA))
-			return new BPValueMetadata(metadata);
-		
-		//null last
-		if(metadata instanceof NullMetadata)
-			return new BPNullMetadata(metadata);
-		
-		return null;
-	}
-	
-	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.close();
-		} catch (IOException e) {//there is no io op
-			throw new RuntimeException(e);
-		}
-		
-		return outBytes.toByteArray();
-	}
+
+        // target first
+        if (typename.equals(BlueprintMetadataMBean.BEAN_METADATA))
+            return new BPBeanMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.REFERENCE_METADATA))
+            return new BPReferenceMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.REF_METADATA))
+            return new BPRefMetadata(metadata);
+
+        // others
+        if (typename.equals(BlueprintMetadataMBean.COLLECTION_METADATA))
+            return new BPCollectionMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.SERVICE_MATADATA))
+            return new BPServiceMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.REFERENCE_LIST_METADATA))
+            return new BPReferenceListMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.ID_REF_METADATA))
+            return new BPIdRefMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.MAP_METADATA))
+            return new BPMapMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.PROPS_METADATA))
+            return new BPPropsMetadata(metadata);
+
+        if (typename.equals(BlueprintMetadataMBean.VALUE_METADATA))
+            return new BPValueMetadata(metadata);
+
+        // null last
+        if (metadata instanceof NullMetadata)
+            return new BPNullMetadata(metadata);
+
+        return null;
+    }
+
+    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.close();
+        } catch (IOException e) {// there is no io op
+            throw new RuntimeException(e);
+        }
+
+        return outBytes.toByteArray();
+    }
 }

Modified: geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintStateMBean.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintStateMBean.java?rev=883992&r1=883991&r2=883992&view=diff
==============================================================================
--- geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintStateMBean.java
(original)
+++ geronimo/sandbox/rex/org.apache.geronimo.blueprint.jmx/src/main/java/org/apache/geronimo/blueprint/jmx/BlueprintStateMBean.java
Wed Nov 25 06:46:13 2009
@@ -34,7 +34,7 @@
      */
     Item            BUNDLE_ID_ITEM             = new Item(
                                                     BUNDLE_ID,
-                                                    "",
+                                                    "the Blueprint bundle id associated with
this event.",
                                                     SimpleType.LONG);
     
     /**
@@ -48,7 +48,7 @@
      */
     Item            EXTENDER_BUNDLE_ID_ITEM    = new Item(
                                                     EXTENDER_BUNDLE_ID,
-                                                    "",
+                                                    "the Blueprint extender bundle id that
is generating this event.",
                                                     SimpleType.LONG);
 
     /**
@@ -62,7 +62,7 @@
      */
     Item            REPLAY_ITEM          = new Item(
                                                     REPLAY,
-                                                    "",
+                                                    "the flag that represents whether this
event is a replay event.",
                                                     SimpleType.BOOLEAN);
     
     
@@ -91,7 +91,7 @@
      */
     Item            TIMESTAMP_ITEM          = new Item(
                                                     TIMESTAMP,
-                                                    "",
+                                                    "the time at which this event was created.",
                                                     SimpleType.LONG);
 
 
@@ -106,7 +106,7 @@
      */
     Item            DEPENDENCIES_ITEM       = new Item(
                                                     DEPENDENCIES,
-                                                    "",
+                                                    "the filters identifying the missing
dependencies that caused the WAITING, GRACE_PERIOD or FAILURE event.",
                                                     JmxConstants.STRING_ARRAY_TYPE);
         
     /**
@@ -115,12 +115,12 @@
     String          EXCEPTION_MESSAGE       = "ExceptionMessage";
     
     /**
-     * The item containing the error message for this FAILURE event.
+     * The item containing the exception message that cause this FAILURE event.
      * The key is {@link #EXCEPTION_MESSAGE}, and the type is {@link SimpleType#STRING}.
      */
     Item            EXCEPTION_MESSAGE_ITEM  = new Item(
                                                     EXCEPTION_MESSAGE,
-                                                    "",
+                                                    "the exception message that cause this
FAILURE event.",
                                                     SimpleType.STRING);
     
     /**



Mime
View raw message