Author: cmueller
Date: Sun Jan 27 23:19:36 2013
New Revision: 1439207

URL: http://svn.apache.org/viewvc?rev=1439207&view=rev
Log:
polished the camel quickfix component a bit

Modified:
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
    
camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjComponent.java
 Sun Jan 27 23:19:36 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.camel.component.quickfixj;
 
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -26,7 +24,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.StartupListener;
 import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.util.UnsafeUriCharactersEncoder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import quickfix.LogFactory;

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
 Sun Jan 27 23:19:36 2013
@@ -24,9 +24,6 @@ import quickfix.Dictionary;
 import quickfix.SessionID;
 import quickfix.SessionSettings;
 
-/**
- *
- */
 public class QuickfixjConfiguration {
 
     private Map<Object, Object> defaultSettings;

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
 Sun Jan 27 23:19:36 2013
@@ -50,9 +50,7 @@ public class QuickfixjConsumer extends D
             Message camelMessage = exchange.getOut();
             quickfix.Message quickfixjMessage = 
camelMessage.getBody(quickfix.Message.class);
      
-            if (log.isDebugEnabled()) {
-                log.debug("Sending FIX message reply: " + 
quickfixjMessage.toString());
-            }
+            log.debug("Sending FIX message reply: {}", quickfixjMessage);
             
             SessionID messageSessionID = 
MessageUtils.getReverseSessionID(exchange.getIn().getBody(quickfix.Message.class));
             

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
 Sun Jan 27 23:19:36 2013
@@ -66,17 +66,14 @@ public class QuickfixjEndpoint extends D
     }
 
     public Consumer createConsumer(Processor processor) throws Exception {
-        LOG.info("Creating QuickFIX/J consumer: "
-            + (sessionID != null ? sessionID : "No Session")
-            + ", ExchangePattern=" + getExchangePattern());
+        LOG.info("Creating QuickFIX/J consumer: {}, ExchangePattern={}", 
sessionID != null ? sessionID : "No Session", getExchangePattern());
         QuickfixjConsumer consumer = new QuickfixjConsumer(this, processor);
         consumers.add(consumer);
         return consumer;
     }
 
     public Producer createProducer() throws Exception {
-        LOG.info("Creating QuickFIX/J producer: "
-            + (sessionID != null ? sessionID : "No Session"));
+        LOG.info("Creating QuickFIX/J producer: {}", sessionID != null ? 
sessionID : "No Session");
         if (isWildcarded()) {
             throw new ResolveEndpointFailedException("Cannot create consumer 
on wildcarded session identifier: " + sessionID);
         }

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
 Sun Jan 27 23:19:36 2013
@@ -271,7 +271,7 @@ public class QuickfixjEngine extends Ser
         } else {
             messageStoreFactory = new MemoryStoreFactory();
         }
-        LOG.info("Inferring message store factory: " + 
messageStoreFactory.getClass().getName());
+        LOG.info("Inferring message store factory: {}", 
messageStoreFactory.getClass().getName());
         return messageStoreFactory;
     }
 
@@ -309,7 +309,7 @@ public class QuickfixjEngine extends Ser
             // Default
             sessionLogFactory = new ScreenLogFactory(settings);
         }
-        LOG.info("Inferring log factory: " + 
sessionLogFactory.getClass().getName());
+        LOG.info("Inferring log factory: {}", 
sessionLogFactory.getClass().getName());
         return sessionLogFactory;
     }
 
@@ -443,9 +443,7 @@ public class QuickfixjEngine extends Ser
         }
 
         private void dispatch(QuickfixjEventCategory quickfixjEventCategory, 
SessionID sessionID, Message message) throws Exception {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("FIX event dispatched: {} {}", 
quickfixjEventCategory, message != null ? message : "");
-            }
+            LOG.debug("FIX event dispatched: {} {}", quickfixjEventCategory, 
message != null ? message : "");
             for (QuickfixjEventListener listener : eventListeners) {
                 // Exceptions propagate back to the FIX engine so sequence 
numbers can be adjusted
                 listener.onEvent(quickfixjEventCategory, sessionID, message);

Modified: 
camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java?rev=1439207&r1=1439206&r2=1439207&view=diff
==============================================================================
--- 
camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
 (original)
+++ 
camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
 Sun Jan 27 23:19:36 2013
@@ -19,8 +19,8 @@ package org.apache.camel.component.quick
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
-import org.apache.camel.InvalidPayloadException;
 import org.apache.camel.builder.PredicateBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.quickfixj.QuickfixjComponent;
@@ -97,7 +97,7 @@ public class AuthenticationExample {
     }
     
     public static class LogonAuthenticator {
-        public void authenticate(Exchange exchange) throws RejectLogon, 
InvalidPayloadException, FieldNotFound {
+        public void authenticate(Exchange exchange) throws RejectLogon, 
CamelExchangeException, FieldNotFound {
             LOG.info("Acceptor is rejecting logon for " + 
exchange.getIn().getHeader(QuickfixjEndpoint.SESSION_ID_KEY));
             Message message = ExchangeHelper.getMandatoryInBody(exchange, 
Message.class);
             if (message.isSetField(RawData.FIELD)) {
@@ -114,7 +114,7 @@ public class AuthenticationExample {
             this.password = password;
         }
 
-        public void inject(Exchange exchange) throws InvalidPayloadException {
+        public void inject(Exchange exchange) throws CamelExchangeException {
             LOG.info("Injecting password into outgoing logon message");
             Message message = ExchangeHelper.getMandatoryInBody(exchange, 
Message.class);
             message.setString(RawData.FIELD, password);


Reply via email to