Title: [913] trunk/core/src/main/java/org/servicemix/jbi/framework: SM-186: Javadoc and suggested fix corrected
Revision
913
Author
gastaldi
Date
2005-11-23 16:16:12 -0500 (Wed, 23 Nov 2005)

Log Message

SM-186: Javadoc and suggested fix corrected

Modified Paths


Diff

Modified: trunk/core/src/main/java/org/servicemix/jbi/framework/ComponentPacketEvent.java (912 => 913)

--- trunk/core/src/main/java/org/servicemix/jbi/framework/ComponentPacketEvent.java	2005-11-23 21:04:42 UTC (rev 912)
+++ trunk/core/src/main/java/org/servicemix/jbi/framework/ComponentPacketEvent.java	2005-11-23 21:16:12 UTC (rev 913)
@@ -32,16 +32,16 @@
     /**
      * ComponentConnector activated
      */
-    public static int ACTIVATED = 1;
+    public static final int ACTIVATED = 1;
     /**
      * ComponentConnector deactivated
      */
-    public static int DEACTIVATED = 2;
+    public static final int DEACTIVATED = 2;
     
     /**
      * ComponentConnector changed it's state
      */
-    public static int STATE_CHANGE  = 3;
+    public static final int STATE_CHANGE  = 3;
     
     
     int status = ACTIVATED;
@@ -103,16 +103,19 @@
      */
     public static String getStatusAsString(int status){
         String result = null;
-        if (status == ACTIVATED){
-            result = "activated";
-        } else if (status == DEACTIVATED){
-            result = "deactivated";
-        } else if (status == STATE_CHANGE){
-             result = "changed";
-        } else {
-            result = "unknown";
+        switch (status) {
+        	case ACTIVATED: 
+        		result = "activated";
+        		break;
+        	case DEACTIVATED:
+        		result = "deactivated";
+        		break;
+        	case STATE_CHANGE:
+        		result = "changed";
+        		break;
+        	default:
+        		result = "unknown";
         }
         return result;
-          
     }
 }

Modified: trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/jms/JMSFlow.java (912 => 913)

--- trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/jms/JMSFlow.java	2005-11-23 21:04:42 UTC (rev 912)
+++ trunk/core/src/main/java/org/servicemix/jbi/nmr/flow/jms/JMSFlow.java	2005-11-23 21:16:12 UTC (rev 913)
@@ -299,7 +299,7 @@
     }
 
     /**
-     * ConsumerAdvisoerEventListener implementation
+     * ConsumerAdvisoryEventListener implementation
      * 
      * @param event
      */
@@ -323,7 +323,7 @@
     /**
      * Distribute an ExchangePacket
      * 
-     * @param packet
+     * @param me
      * @throws MessagingException
      */
     protected void doSend(MessageExchangeImpl me) throws MessagingException {
@@ -333,7 +333,7 @@
     /**
      * Distribute an ExchangePacket
      * 
-     * @param packet
+     * @param me
      * @throws MessagingException
      */
     public void doRouting(MessageExchangeImpl me) throws MessagingException{
@@ -401,19 +401,20 @@
     protected void processInBoundPacket(String containerName, ComponentPacketEvent event) {
         ComponentPacket packet = event.getPacket();
         if (!packet.getComponentNameSpace().getContainerName().equals(broker.getContainerName())) {
-            if (event.getStatus() == ComponentPacketEvent.ACTIVATED) {
-                addRemotePacket(containerName, packet);
-            }
-            else if (event.getStatus() == ComponentPacketEvent.DEACTIVATED) {
-                removeRemotePacket(containerName, packet);
-            }
-            else if (event.getStatus() == ComponentPacketEvent.STATE_CHANGE) {
-                updateRemotePacket(containerName, packet);
-            }
-            else {
-                log.warn("Unable to determine ComponentPacketEvent type: " + event.getStatus() + " for packet: "
-                        + packet);
-            }
+            int eventStatus = event.getStatus();
+            switch (eventStatus) {
+                case ComponentPacketEvent.ACTIVATED:
+                    addRemotePacket(containerName, packet);
+                    break;
+                case ComponentPacketEvent.DEACTIVATED:
+                    removeRemotePacket(containerName, packet);
+                    break;
+                case ComponentPacketEvent.STATE_CHANGE:
+                    updateRemotePacket(containerName, packet);
+                    break;
+                default:
+                    log.warn("Unable to determine ComponentPacketEvent type: " + eventStatus + " for packet: " + packet);
+            }         	
         }
     }
 

Reply via email to