Author: cmueller
Date: Sun Jan 27 23:09:50 2013
New Revision: 1439204
URL: http://svn.apache.org/viewvc?rev=1439204&view=rev
Log:
polished the camel quickfix component a bit
Modified:
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
Modified:
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java?rev=1439204&r1=1439203&r2=1439204&view=diff
==============================================================================
---
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
(original)
+++
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConfiguration.java
Sun Jan 27 23:09:50 2013
@@ -24,9 +24,6 @@ import quickfix.Dictionary;
import quickfix.SessionID;
import quickfix.SessionSettings;
-/**
- *
- */
public class QuickfixjConfiguration {
private Map<Object, Object> defaultSettings;
Modified:
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java?rev=1439204&r1=1439203&r2=1439204&view=diff
==============================================================================
---
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
(original)
+++
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjConsumer.java
Sun Jan 27 23:09:50 2013
@@ -49,9 +49,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/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java?rev=1439204&r1=1439203&r2=1439204&view=diff
==============================================================================
---
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
(original)
+++
camel/trunk/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEndpoint.java
Sun Jan 27 23:09:50 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/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=1439204&r1=1439203&r2=1439204&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
Sun Jan 27 23:09:50 2013
@@ -302,7 +302,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;
}
@@ -340,7 +340,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;
}
@@ -475,9 +475,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/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
URL:
http://svn.apache.org/viewvc/camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java?rev=1439204&r1=1439203&r2=1439204&view=diff
==============================================================================
---
camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
(original)
+++
camel/trunk/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/examples/AuthenticationExample.java
Sun Jan 27 23:09:50 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.QuickfixjEndpoint;
@@ -96,7 +96,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 = exchange.getIn().getMandatoryBody(Message.class);
if (message.isSetField(RawData.FIELD)) {
@@ -113,7 +113,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 = exchange.getIn().getMandatoryBody(Message.class);
message.setString(RawData.FIELD, password);