camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject svn commit: r1399634 - /camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
Date Thu, 18 Oct 2012 12:44:41 GMT
Author: bvahdat
Date: Thu Oct 18 12:44:41 2012
New Revision: 1399634

URL: http://svn.apache.org/viewvc?rev=1399634&view=rev
Log:
Polished

Modified:
    camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java

Modified: camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java?rev=1399634&r1=1399633&r2=1399634&view=diff
==============================================================================
--- camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
(original)
+++ camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
Thu Oct 18 12:44:41 2012
@@ -96,7 +96,7 @@ public class QuickfixjEngine extends Ser
     private final MessageCorrelator messageCorrelator = new MessageCorrelator();
     private List<QuickfixjEventListener> eventListeners = new CopyOnWriteArrayList<QuickfixjEventListener>();
     private final String uri;
-    private ObjectName connectorObjectName;
+    private ObjectName initiatorObjectName;
 
     public enum ThreadModel {
         ThreadPerConnector, ThreadPerSession;
@@ -228,7 +228,7 @@ public class QuickfixjEngine extends Ser
         if (initiator != null) {
             initiator.start();
             if (jmxExporter != null) {
-                connectorObjectName = jmxExporter.register(initiator);
+                initiatorObjectName = jmxExporter.register(initiator);
             }
         }
     }
@@ -241,8 +241,8 @@ public class QuickfixjEngine extends Ser
         if (initiator != null) {
             initiator.stop();
 
-            if (jmxExporter != null && connectorObjectName != null) {
-                jmxExporter.getMBeanServer().unregisterMBean(connectorObjectName);
+            if (jmxExporter != null && initiatorObjectName != null) {
+                jmxExporter.getMBeanServer().unregisterMBean(initiatorObjectName);
             }
         }
     }
@@ -462,10 +462,11 @@ public class QuickfixjEngine extends Ser
                 throw new DispatcherException(e);
             }
         }
-        
-        @SuppressWarnings("unchecked")
+
         private <T extends Exception> void rethrowIfType(Exception e, Class<T>
exceptionClass) throws T {
-            throw (T) e;
+            if (e.getClass() == exceptionClass) {
+                throw exceptionClass.cast(e);
+            }
         }
 
         private void dispatch(QuickfixjEventCategory quickfixjEventCategory, SessionID sessionID,
Message message) throws Exception {
@@ -477,15 +478,17 @@ public class QuickfixjEngine extends Ser
                 listener.onEvent(quickfixjEventCategory, sessionID, message);
             }
         }
-        
-        @SuppressWarnings("serial")
+
         private class DispatcherException extends RuntimeException {
+
+            private static final long serialVersionUID = 1L;
+
             public DispatcherException(Throwable cause) {
                 super(cause);
             }
         }
     }
-        
+
     public String getUri() {
         return uri;
     }



Mime
View raw message