You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2008/03/25 08:49:26 UTC
svn commit: r640731 [1/4] - in /activemq/camel/trunk/components:
camel-amqp/src/main/java/org/apache/camel/component/amqp/
camel-amqp/src/test/java/org/apache/camel/component/amqp/
camel-ftp/src/main/java/org/apache/camel/component/file/remote/ camel-f...
Author: ningjiang
Date: Tue Mar 25 00:49:12 2008
New Revision: 640731
URL: http://svn.apache.org/viewvc?rev=640731&view=rev
Log:
Get more components pass the CS's check
Modified:
activemq/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
activemq/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/CamelGroovyMethods.java
activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java
activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyLanguage.java
activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyRouteBuilder.java
activemq/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyTest.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpClientConfigurer.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpPollingConsumer.java
activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetTest.java
activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithHeadersTest.java
activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithQueryParamsTest.java
activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java
activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ExchangeType.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/HeaderType.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/IntegerHeader.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbConverter.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/LongHeader.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/MessageType.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ObjectHeader.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/PropertyType.java
activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/StringHeader.java
activemq/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/converter/jaxb/MessageTypeTest.java
activemq/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/PurchaseOrder.java
activemq/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/DumpToXmlTest.java
activemq/camel/trunk/components/camel-jcr/src/main/java/org/apache/camel/component/jcr/JcrProducer.java
activemq/camel/trunk/components/camel-jcr/src/test/java/org/apache/camel/component/jcr/JcrRouteTest.java
activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcComponent.java
activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcEndpoint.java
activemq/camel/trunk/components/camel-jdbc/src/main/java/org/apache/camel/component/jdbc/JdbcProducer.java
activemq/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcRouteTest.java
activemq/camel/trunk/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/TestDataSource.java
activemq/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
activemq/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpEndpoint.java
activemq/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpProducer.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncHttpRequestHandler.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncResponseHandler.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/DefaultListeningIOReactor.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConverter.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcMessage.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java
activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngineFactory.java
activemq/camel/trunk/components/camel-jing/src/main/java/org/apache/camel/component/validator/jing/JingComponent.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsExchange.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsQueueEndpoint.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageJMSPropertyAccessException.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/requestor/FailedToProcessResponse.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/requestor/FutureHandler.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/requestor/ReplyHandler.java
activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/requestor/Requestor.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/AggregratedJmsRouteTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/BrowsableQueueTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/ConsumeJmsBytesMessageTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/ConsumeJmsMapMessageTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsSelectorTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsTransactedRouteTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/TransactedJmsRouteTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/bind/JmsMessageBindTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/bind/MyBean.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/MyRegistry.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/discovery/MyService.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsIssue170Test.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/LarsIssueTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/MQSeriesHeaderTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/remoting/JmsRemotingTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/AbstractTransactionTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/ConditionalExceptionProcessor.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/QueueToProcessorTransactionTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/QueueToQueueTransactionTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/XMLQueueToProcessorTransactionTest.java
activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/XMLQueueToQueueTransactionTest.java
activemq/camel/trunk/components/camel-josql/src/main/java/org/apache/camel/builder/sql/SQL.java
activemq/camel/trunk/components/camel-jpa/src/test/java/org/apache/camel/processor/jpa/JpaIdempotentConsumerTest.java
activemq/camel/trunk/components/camel-juel/src/main/java/org/apache/camel/language/juel/BeanAndMethodELResolver.java
activemq/camel/trunk/components/camel-juel/src/main/java/org/apache/camel/language/juel/EL.java
activemq/camel/trunk/components/camel-juel/src/main/java/org/apache/camel/language/juel/JuelExpression.java
activemq/camel/trunk/components/camel-juel/src/test/java/org/apache/camel/language/juel/NullBodyTest.java
activemq/camel/trunk/components/camel-juel/src/test/java/org/apache/camel/language/juel/issues/XsltLosesHeaderTest.java
activemq/camel/trunk/components/camel-juel/src/test/java/org/apache/camel/processor/juel/SimulatorTest.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestComponent.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/test/TestEndpoint.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/validator/ValidatorComponent.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/component/xslt/XsltComponent.java
activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
Modified: activemq/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java (original)
+++ activemq/camel/trunk/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,10 +16,10 @@
*/
package org.apache.camel.component.amqp;
-import org.apache.camel.component.jms.JmsComponent;
-import org.apache.camel.component.jms.JmsConfiguration;
import org.apache.camel.CamelContext;
import org.apache.camel.Component;
+import org.apache.camel.component.jms.JmsComponent;
+import org.apache.camel.component.jms.JmsConfiguration;
import org.apache.qpid.client.AMQConnectionFactory;
import org.apache.qpid.url.URLSyntaxException;
@@ -29,11 +28,6 @@
*/
public class AMQPComponent extends JmsComponent {
- public static Component amqpComponent(String uri) throws URLSyntaxException {
- AMQConnectionFactory connectionFactory = new AMQConnectionFactory(uri);
- return new AMQPComponent(connectionFactory);
- }
-
public AMQPComponent() {
init();
}
@@ -51,7 +45,12 @@
public AMQPComponent(AMQConnectionFactory connectionFactory) {
setConnectionFactory(connectionFactory);
}
-
+
+ public static Component amqpComponent(String uri) throws URLSyntaxException {
+ AMQConnectionFactory connectionFactory = new AMQConnectionFactory(uri);
+ return new AMQPComponent(connectionFactory);
+ }
+
/**
* Lets install the default connection factory
*/
Modified: activemq/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java Tue Mar 25 00:49:12 2008
@@ -16,13 +16,15 @@
*/
package org.apache.camel.component.amqp;
+
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
-import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.qpid.client.transport.TransportConnection;
+import static org.apache.camel.component.amqp.AMQPComponent.amqpComponent;
+
/**
* @version $Revision$
*/
@@ -61,7 +63,7 @@
// lets create an in JVM broker
TransportConnection.createVMBroker(1);
- super.setUp();
+ super.setUp();
resultEndpoint = (MockEndpoint) context.getEndpoint("mock:result");
}
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java Tue Mar 25 00:49:12 2008
@@ -26,18 +26,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPConnectionClosedException;
+import org.apache.commons.net.ftp.FTPFile;
public class FtpConsumer extends RemoteFileConsumer<RemoteFileExchange> {
private static final transient Log LOG = LogFactory.getLog(FtpConsumer.class);
-
+ private final FtpEndpoint endpoint;
private boolean recursive = true;
private String regexPattern = "";
private long lastPollTime;
- private final FtpEndpoint endpoint;
+
private FTPClient client;
- private boolean setNames = false;
+ private boolean setNames;
public FtpConsumer(FtpEndpoint endpoint, Processor processor, FTPClient client) {
super(endpoint, processor);
@@ -50,7 +50,7 @@
this.endpoint = endpoint;
this.client = client;
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void connectIfNecessary() throws IOException {
if (!client.isConnected()) {
@@ -59,7 +59,7 @@
LOG.info("Connected to " + endpoint.getConfiguration());
}
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void disconnect() throws IOException {
LOG.info("FtpConsumer's client is being explicitly disconnected");
@@ -69,7 +69,7 @@
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void poll() throws Exception {
connectIfNecessary();
- // If the attempt to connect isn't successful, then the thrown
+ // If the attempt to connect isn't successful, then the thrown
// exception will signify that we couldn't poll
try {
final String fileName = endpoint.getConfiguration().getFile();
@@ -82,7 +82,7 @@
}
lastPollTime = System.currentTimeMillis();
} catch (FTPConnectionClosedException e) {
- // If the server disconnected us, then we must manually disconnect
+ // If the server disconnected us, then we must manually disconnect
// the client before attempting to reconnect
LOG.warn("Disconnecting due to exception: " + e.toString());
disconnect();
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java Tue Mar 25 00:49:12 2008
@@ -21,10 +21,10 @@
import org.apache.camel.Exchange;
import org.apache.camel.RuntimeCamelException;
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPConnectionClosedException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPConnectionClosedException;
public class FtpProducer extends RemoteFileProducer<RemoteFileExchange> {
private static final transient Log LOG = LogFactory.getLog(FtpProducer.class);
@@ -41,12 +41,12 @@
// TODO: is there a way to avoid copy-pasting the reconnect logic?
public void process(Exchange exchange) throws Exception {
connectIfNecessary();
- // If the attempt to connect isn't successful, then the thrown
+ // If the attempt to connect isn't successful, then the thrown
// exception will signify that we couldn't deliver
try {
process(endpoint.createExchange(exchange));
} catch (FTPConnectionClosedException e) {
- // If the server disconnected us, then we must manually disconnect
+ // If the server disconnected us, then we must manually disconnect
// the client before attempting to reconnect
LOG.warn("Disconnecting due to exception: " + e.toString());
disconnect();
@@ -60,7 +60,7 @@
throw e;
}
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void connectIfNecessary() throws IOException {
if (!client.isConnected()) {
@@ -69,7 +69,7 @@
LOG.info("Connected to " + endpoint.getConfiguration());
}
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
public void disconnect() throws IOException {
LOG.info("FtpProducer's client is being explicitly disconnected");
@@ -80,25 +80,23 @@
InputStream payload = exchange.getIn().getBody(InputStream.class);
try {
String fileName = createFileName(exchange.getIn(), endpoint.getConfiguration());
-
+
int lastPathIndex = fileName.lastIndexOf('/');
- if (lastPathIndex != -1)
- {
+ if (lastPathIndex != -1) {
String directory = fileName.substring(0, lastPathIndex);
if (!buildDirectory(client, directory)) {
LOG.warn("Couldn't buildDirectory: " + directory + " (either permissions deny it, or it already exists)");
}
}
-
+
final boolean success = client.storeFile(fileName, payload);
if (!success) {
throw new RuntimeCamelException("error sending file");
}
-
+
RemoteFileConfiguration config = endpoint.getConfiguration();
LOG.info("Sent: " + fileName + " to " + config.toString().substring(0, config.toString().indexOf(config.getFile())));
- }
- finally {
+ } finally {
if (null != payload) {
payload.close();
}
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileComponent.java Tue Mar 25 00:49:12 2008
@@ -16,12 +16,12 @@
*/
package org.apache.camel.component.file.remote;
+import java.net.URI;
+import java.util.Map;
+
import org.apache.camel.CamelContext;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.impl.DefaultComponent;
-
-import java.net.URI;
-import java.util.Map;
public class RemoteFileComponent extends DefaultComponent<RemoteFileExchange> {
private RemoteFileConfiguration configuration;
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileEndpoint.java Tue Mar 25 00:49:12 2008
@@ -18,8 +18,8 @@
import java.io.ByteArrayOutputStream;
-import org.apache.camel.impl.ScheduledPollEndpoint;
import org.apache.camel.ExchangePattern;
+import org.apache.camel.impl.ScheduledPollEndpoint;
public abstract class RemoteFileEndpoint<T extends RemoteFileExchange> extends ScheduledPollEndpoint<T> {
private RemoteFileBinding binding;
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/RemoteFileProducer.java Tue Mar 25 00:49:12 2008
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.file.remote;
-import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.component.file.FileComponent;
import org.apache.camel.impl.DefaultProducer;
@@ -44,8 +43,8 @@
}
return answer;
}
-
- abstract protected void connectIfNecessary() throws Exception;
-
- abstract protected void disconnect() throws Exception;
+
+ protected abstract void connectIfNecessary() throws Exception;
+
+ protected abstract void disconnect() throws Exception;
}
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java Tue Mar 25 00:49:12 2008
@@ -20,31 +20,32 @@
import java.io.IOException;
import java.util.concurrent.ScheduledExecutorService;
+import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.SftpException;
+
import org.apache.camel.Processor;
import org.apache.camel.component.file.FileComponent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import com.jcraft.jsch.ChannelSftp;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.SftpException;
public class SftpConsumer extends RemoteFileConsumer<RemoteFileExchange> {
private static final transient Log LOG = LogFactory.getLog(SftpConsumer.class);
-
+ private final SftpEndpoint endpoint;
private boolean recursive = true;
private String regexPattern = "";
private long lastPollTime;
- private final SftpEndpoint endpoint;
+
private ChannelSftp channel;
private Session session;
- private boolean setNames = false;
+ private boolean setNames;
public SftpConsumer(SftpEndpoint endpoint, Processor processor, Session session) {
super(endpoint, processor);
this.endpoint = endpoint;
- this.session = session;
+ this.session = session;
}
public SftpConsumer(SftpEndpoint endpoint, Processor processor, Session session, ScheduledExecutorService executor) {
@@ -52,7 +53,7 @@
this.endpoint = endpoint;
this.session = session;
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void connectIfNecessary() throws JSchException {
if (channel == null || !channel.isConnected()) {
@@ -67,10 +68,9 @@
LOG.info("Connected to " + endpoint.getConfiguration().toString());
}
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
- protected void disconnect() throws JSchException
- {
+ protected void disconnect() throws JSchException {
if (session != null) {
LOG.info("Session is being explicitly disconnected");
session.disconnect();
@@ -84,7 +84,7 @@
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void poll() throws Exception {
connectIfNecessary();
- // If the attempt to connect isn't successful, then the thrown
+ // If the attempt to connect isn't successful, then the thrown
// exception will signify that we couldn't poll
try {
final String fileName = endpoint.getConfiguration().getFile();
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpEndpoint.java Tue Mar 25 00:49:12 2008
@@ -68,9 +68,8 @@
});
return session;
}
-
- public ChannelSftp createChannelSftp (Session session) throws JSchException
- {
+
+ public ChannelSftp createChannelSftp(Session session) throws JSchException {
final ChannelSftp channel = (ChannelSftp) session.openChannel("sftp");
return channel;
}
Modified: activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java Tue Mar 25 00:49:12 2008
@@ -16,18 +16,20 @@
*/
package org.apache.camel.component.file.remote;
+
import java.io.IOException;
import java.io.InputStream;
-import org.apache.camel.Exchange;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.SftpException;
+import org.apache.camel.Exchange;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+
public class SftpProducer extends RemoteFileProducer<RemoteFileExchange> {
private static final transient Log LOG = LogFactory.getLog(SftpProducer.class);
@@ -40,7 +42,7 @@
this.endpoint = endpoint;
this.session = session;
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
protected void connectIfNecessary() throws JSchException {
if (channel == null || !channel.isConnected()) {
@@ -55,10 +57,9 @@
LOG.info("Connected to " + endpoint.getConfiguration().toString());
}
}
-
+
// TODO: is there a way to avoid copy-pasting the reconnect logic?
- protected void disconnect() throws JSchException
- {
+ protected void disconnect() throws JSchException {
if (session != null) {
LOG.info("Session is being explicitly disconnected");
session.disconnect();
@@ -72,7 +73,7 @@
// TODO: is there a way to avoid copy-pasting the reconnect logic?
public void process(Exchange exchange) throws Exception {
connectIfNecessary();
- // If the attempt to connect isn't successful, then the thrown
+ // If the attempt to connect isn't successful, then the thrown
// exception will signify that we couldn't deliver
try {
process(endpoint.createExchange(exchange));
@@ -97,20 +98,18 @@
InputStream payload = exchange.getIn().getBody(InputStream.class);
try {
String fileName = createFileName(exchange.getIn(), endpoint.getConfiguration());
-
+
int lastPathIndex = fileName.lastIndexOf('/');
- if (lastPathIndex != -1)
- {
+ if (lastPathIndex != -1) {
boolean success = buildDirectory(channel, fileName.substring(0, lastPathIndex));
if (!success) {
LOG.warn("Couldn't buildDirectory: " + fileName.substring(0, lastPathIndex) + " (either permissions deny it, or it already exists)");
}
}
-
+
channel.put(payload, fileName);
LOG.info("Sent: " + fileName + " to " + endpoint.getConfiguration());
- }
- finally {
+ } finally {
if (null != payload) {
payload.close();
}
Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java (original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFileToFtpTest.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/CamelGroovyMethods.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/CamelGroovyMethods.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/CamelGroovyMethods.java (original)
+++ activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/CamelGroovyMethods.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,7 +26,10 @@
/**
* @version $Revision$
*/
-public class CamelGroovyMethods {
+public final class CamelGroovyMethods {
+ private CamelGroovyMethods() {
+ // Utility Class
+ }
public static FilterType filter(ProcessorType self, Closure filter) {
return self.filter(toExpression(filter));
Modified: activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java (original)
+++ activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyExpression.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyLanguage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyLanguage.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyLanguage.java (original)
+++ activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyLanguage.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -20,7 +19,6 @@
import groovy.lang.GroovyClassLoader;
import groovy.lang.Script;
import org.apache.camel.spi.Language;
-import org.apache.camel.Expression;
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyRouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyRouteBuilder.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyRouteBuilder.java (original)
+++ activemq/camel/trunk/components/camel-groovy/src/main/java/org/apache/camel/language/groovy/GroovyRouteBuilder.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyTest.java (original)
+++ activemq/camel/trunk/components/camel-groovy/src/test/java/org/apache/camel/language/groovy/GroovyTest.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,15 +17,10 @@
package org.apache.camel.language.groovy;
import groovy.lang.GroovyClassLoader;
-import groovy.lang.MetaClassRegistry;
-import groovy.lang.MetaClass;
-import groovy.lang.Closure;
-import groovy.lang.ProxyMetaClass;
import org.apache.camel.CamelContext;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.model.ProcessorType;
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java Tue Mar 25 00:49:12 2008
@@ -16,8 +16,6 @@
*/
package org.apache.camel.component.http;
-import org.apache.camel.ExchangePattern;
-
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpClientConfigurer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpClientConfigurer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpClientConfigurer.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpClientConfigurer.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -30,5 +29,5 @@
*
* @param client
*/
- public void configureHttpClient(HttpClient client);
+ void configureHttpClient(HttpClient client);
}
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpComponent.java Tue Mar 25 00:49:12 2008
@@ -29,19 +29,18 @@
/**
* Defines the <a href="http://activemq.apache.org/camel/http.html">HTTP
* Component</a>
- *
+ *
* @version $Revision$
*/
public class HttpComponent extends DefaultComponent<HttpExchange> {
private HttpClientConfigurer httpClientConfigurer;
- private HttpConnectionManager httpConnectionManager =
- new MultiThreadedHttpConnectionManager();
-
+ private HttpConnectionManager httpConnectionManager = new MultiThreadedHttpConnectionManager();
+
/**
* Connects the URL specified on the endpoint to the specified processor.
- *
+ *
* @throws Exception
*/
public void connect(HttpConsumer consumer) throws Exception {
@@ -50,7 +49,7 @@
/**
* Disconnects the URL specified on the endpoint from the specified
* processor.
- *
+ *
* @throws Exception
*/
public void disconnect(HttpConsumer consumer) throws Exception {
@@ -65,16 +64,16 @@
}
public HttpConnectionManager getHttpConnectionManager() {
- return httpConnectionManager;
- }
-
- public void setHttpConnectionManager(
- HttpConnectionManager httpConnectionManager) {
- this.httpConnectionManager = httpConnectionManager;
- }
-
+ return httpConnectionManager;
+ }
+
+ public void setHttpConnectionManager(HttpConnectionManager httpConnectionManager) {
+ this.httpConnectionManager = httpConnectionManager;
+ }
+
@Override
- protected Endpoint<HttpExchange> createEndpoint(String uri, String remaining, Map parameters) throws Exception {
+ protected Endpoint<HttpExchange> createEndpoint(String uri, String remaining, Map parameters)
+ throws Exception {
HttpClientParams params = new HttpClientParams();
IntrospectionSupport.setProperties(params, parameters, "httpClient.");
return new HttpEndpoint(uri, this, new URI(uri), params, httpConnectionManager, httpClientConfigurer);
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java Tue Mar 25 00:49:12 2008
@@ -16,19 +16,20 @@
*/
package org.apache.camel.component.http;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.camel.ExchangePattern;
import org.apache.camel.PollingConsumer;
import org.apache.camel.Producer;
-import org.apache.camel.ExchangePattern;
import org.apache.camel.impl.DefaultPollingEndpoint;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpConnectionManager;
import org.apache.commons.httpclient.params.HttpClientParams;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.net.URI;
-import java.net.URISyntaxException;
-
/**
* Represents a <a href="http://activemq.apache.org/camel/http.html">HTTP
* endpoint</a>
@@ -48,7 +49,8 @@
this(endPointURI, component, httpURI, new HttpClientParams(), httpConnectionManager, null);
}
- public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientParams clientParams, HttpConnectionManager httpConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
+ public HttpEndpoint(String endPointURI, HttpComponent component, URI httpURI, HttpClientParams clientParams,
+ HttpConnectionManager httpConnectionManager, HttpClientConfigurer clientConfigurer) throws URISyntaxException {
super(endPointURI, component);
this.component = component;
this.httpUri = httpURI;
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpExchange.java Tue Mar 25 00:49:12 2008
@@ -19,12 +19,12 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.ExchangePattern;
+import org.apache.camel.impl.DefaultExchange;
/**
* Represents a HTTP exchange which exposes the underlying HTTP abtractions via
- * {@link #getRequest()} and {@link #getResponse()}
+ * {@link #getRequest()} and {@link #getResponse()}
*
* @version $Revision$
*/
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpPollingConsumer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpPollingConsumer.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpPollingConsumer.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,6 +16,8 @@
*/
package org.apache.camel.component.http;
+import java.io.IOException;
+
import org.apache.camel.Message;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.impl.PollingConsumerSupport;
@@ -25,8 +26,6 @@
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod;
-import java.io.IOException;
-
/**
* A polling HTTP consumer which by default performs a GET
*
@@ -71,8 +70,7 @@
message.setHeader("http.responseCode", responseCode);
return exchange;
- }
- catch (IOException e) {
+ } catch (IOException e) {
throw new RuntimeCamelException(e);
}
}
Modified: activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java (original)
+++ activemq/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpProducer.java Tue Mar 25 00:49:12 2008
@@ -36,7 +36,7 @@
public class HttpProducer extends DefaultProducer<HttpExchange> implements Producer<HttpExchange> {
public static final String HTTP_RESPONSE_CODE = "http.responseCode";
public static final String QUERY = "org.apache.camel.component.http.query";
-
+
private HttpClient httpClient;
public HttpProducer(HttpEndpoint endpoint) {
@@ -46,7 +46,7 @@
public void process(Exchange exchange) throws Exception {
HttpMethod method = createMethod(exchange);
-
+
HttpBinding binding = ((HttpEndpoint)getEndpoint()).getBinding();
// propagate headers as HTTP headers
for (String headerName : exchange.getIn().getHeaders().keySet()) {
@@ -55,7 +55,7 @@
method.addRequestHeader(headerName, headerValue);
}
}
-
+
int responseCode = httpClient.executeMethod(method);
// lets store the result in the output message.
@@ -87,7 +87,7 @@
RequestEntity requestEntity = createRequestEntity(exchange);
if (requestEntity == null) {
GetMethod method = new GetMethod(uri);
- if (exchange.getIn().getHeader(QUERY) != null){
+ if (exchange.getIn().getHeader(QUERY) != null) {
method.setQueryString(exchange.getIn().getHeader(QUERY, String.class));
}
return method;
Modified: activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetTest.java (original)
+++ activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetTest.java Tue Mar 25 00:49:12 2008
@@ -61,7 +61,8 @@
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
- from("direct:start").setHeader(HttpProducer.QUERY,constant("hl=en&q=activemq")).to("http://www.google.com/search").to("mock:results");
+ from("direct:start").setHeader(HttpProducer.QUERY, constant("hl=en&q=activemq"))
+ .to("http://www.google.com/search").to("mock:results");
}
};
}
Modified: activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithHeadersTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithHeadersTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithHeadersTest.java (original)
+++ activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithHeadersTest.java Tue Mar 25 00:49:12 2008
@@ -1,3 +1,20 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.camel.component.http;
import org.apache.camel.builder.RouteBuilder;
Modified: activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithQueryParamsTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithQueryParamsTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithQueryParamsTest.java (original)
+++ activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/HttpGetWithQueryParamsTest.java Tue Mar 25 00:49:12 2008
@@ -19,14 +19,14 @@
/**
* TODO Provide description for HttpGetWithQueryParamsTest.
- *
+ *
* @author <a href="mailto:nsandhu@raleys.com">nsandhu</a>
*
*/
-public class HttpGetWithQueryParamsTest extends HttpGetTest{
+public class HttpGetWithQueryParamsTest extends HttpGetTest {
protected void setUp() throws Exception {
super.setUp();
expectedText = "activemq.apache.org";
}
-
+
}
Modified: activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java (original)
+++ activemq/camel/trunk/components/camel-http/src/test/java/org/apache/camel/component/http/MultiThreadedHttpGetTest.java Tue Mar 25 00:49:12 2008
@@ -30,80 +30,74 @@
public class MultiThreadedHttpGetTest extends ContextTestSupport {
public void testHttpGetWithConversion() throws Exception {
-
- // In this scenario response stream is converted to String
- // so the stream has to be read to the end. When this happens
- // the associated connection is released automatically.
-
- String endpointName = "seda:withConversion";
+
+ // In this scenario response stream is converted to String
+ // so the stream has to be read to the end. When this happens
+ // the associated connection is released automatically.
+
+ String endpointName = "seda:withConversion";
sendMessagesTo(endpointName, 5);
}
-
+
public void testHttpGetWithoutConversion() throws Exception {
-
- // This is needed as by default there are 2 parallel
- // connections to some host and there is nothing that
- // closes the http connection here.
-
- context.getComponent("http", HttpComponent.class)
- .getHttpConnectionManager().getParams()
- .setDefaultMaxConnectionsPerHost(5);
-
- String endpointName = "seda:withoutConversion";
+
+ // This is needed as by default there are 2 parallel
+ // connections to some host and there is nothing that
+ // closes the http connection here.
+
+ context.getComponent("http", HttpComponent.class).getHttpConnectionManager().getParams()
+ .setDefaultMaxConnectionsPerHost(5);
+
+ String endpointName = "seda:withoutConversion";
sendMessagesTo(endpointName, 5);
}
-
+
public void testHttpGetWithExplicitStreamClose() throws Exception {
-
- // We close connections explicitely at the very end of the flow
- // (camel doesn't know when the stream is not needed any more)
-
- MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
-
- for (int i = 0; i < 5; i++) {
- mockEndpoint.expectedMessageCount(1);
- template.sendBody("seda:withoutConversion", null);
- mockEndpoint.assertIsSatisfied();
- Object response = mockEndpoint.getReceivedExchanges().get(0)
- .getIn().getBody();
- InputStream responseStream = assertIsInstanceOf(InputStream.class,
- response);
- responseStream.close();
- mockEndpoint.reset();
- }
+
+ // We close connections explicitely at the very end of the flow
+ // (camel doesn't know when the stream is not needed any more)
+
+ MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
+
+ for (int i = 0; i < 5; i++) {
+ mockEndpoint.expectedMessageCount(1);
+ template.sendBody("seda:withoutConversion", null);
+ mockEndpoint.assertIsSatisfied();
+ Object response = mockEndpoint.getReceivedExchanges().get(0).getIn().getBody();
+ InputStream responseStream = assertIsInstanceOf(InputStream.class, response);
+ responseStream.close();
+ mockEndpoint.reset();
+ }
}
- protected void sendMessagesTo(String endpointName, int count) throws InterruptedException {
- MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
+ protected void sendMessagesTo(String endpointName, int count) throws InterruptedException {
+ MockEndpoint mockEndpoint = resolveMandatoryEndpoint("mock:results", MockEndpoint.class);
mockEndpoint.expectedMessageCount(count);
for (int i = 0; i < count; i++) {
- template.sendBody(endpointName, null);
+ template.sendBody(endpointName, null);
}
-
+
mockEndpoint.assertIsSatisfied();
List<Exchange> list = mockEndpoint.getReceivedExchanges();
for (Exchange exchange : list) {
- String body = exchange.getIn().getBody(String.class);
+ String body = exchange.getIn().getBody(String.class);
log.debug("Body: " + body);
assertNotNull("Should have a body!", body);
assertTrue("body should contain: <html", body.contains("<html"));
}
- }
+ }
-
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
- from("seda:withConversion").thread(5)
- .to("http://www.google.com/search")
- .convertBodyTo(String.class).to("mock:results");
-
- from("seda:withoutConversion").thread(5)
- .to("http://www.google.com/search")
- .to("mock:results");
+ from("seda:withConversion").thread(5).to("http://www.google.com/search")
+ .convertBodyTo(String.class).to("mock:results");
+
+ from("seda:withoutConversion").thread(5).to("http://www.google.com/search")
+ .to("mock:results");
}
};
}
Modified: activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java (original)
+++ activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcComponent.java Tue Mar 25 00:49:12 2008
@@ -16,6 +16,10 @@
*/
package org.apache.camel.component.irc;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.camel.CamelContext;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.impl.DefaultComponent;
@@ -23,14 +27,10 @@
import org.apache.commons.logging.LogFactory;
import org.schwering.irc.lib.IRCConnection;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* Defines the <a href="http://activemq.apache.org/camel/irc.html">IRC Component</a>
- *
- * @version $Revision:$
+ *
+ * @version $Revision$
*/
public class IrcComponent extends DefaultComponent<IrcExchange> {
private static final transient Log LOG = LogFactory.getLog(IrcComponent.class);
Modified: activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-irc/src/main/java/org/apache/camel/component/irc/IrcEndpoint.java Tue Mar 25 00:49:12 2008
@@ -16,8 +16,8 @@
*/
package org.apache.camel.component.irc;
-import org.apache.camel.Processor;
import org.apache.camel.ExchangePattern;
+import org.apache.camel.Processor;
import org.apache.camel.impl.DefaultEndpoint;
import org.schwering.irc.lib.IRCModeParser;
import org.schwering.irc.lib.IRCUser;
@@ -25,7 +25,7 @@
/**
* Defines the <a href="http://activemq.apache.org/camel/irc.html">IRC Endpoint</a>
*
- * @version $Revision:$
+ * @version $Revision$
*/
public class IrcEndpoint extends DefaultEndpoint<IrcExchange> {
private IrcBinding binding;
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ExchangeType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ExchangeType.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ExchangeType.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ExchangeType.java Tue Mar 25 00:49:12 2008
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,13 +16,14 @@
*/
package org.apache.camel.converter.jaxb;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/FallbackTypeConverter.java Tue Mar 25 00:49:12 2008
@@ -16,11 +16,10 @@
*/
package org.apache.camel.converter.jaxb;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.TypeConverter;
-import org.apache.camel.spi.TypeConverterAware;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
@@ -29,10 +28,12 @@
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.util.JAXBSource;
import javax.xml.transform.Source;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.TypeConverter;
+import org.apache.camel.spi.TypeConverterAware;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* @version $Revision$
@@ -65,8 +66,7 @@
}
}
return null;
- }
- catch (JAXBException e) {
+ } catch (JAXBException e) {
throw new RuntimeCamelException(e);
}
}
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/HeaderType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/HeaderType.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/HeaderType.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/HeaderType.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,12 +16,12 @@
*/
package org.apache.camel.converter.jaxb;
-import org.apache.camel.Message;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
+
+import org.apache.camel.Message;
/**
* Represents a JAXB2 representation of a Camel {@link Message} header
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/IntegerHeader.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/IntegerHeader.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/IntegerHeader.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/IntegerHeader.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,10 +16,10 @@
*/
package org.apache.camel.converter.jaxb;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
/**
* @version $Revision$
@@ -55,8 +54,7 @@
if (value instanceof Number) {
Number n = (Number) value;
setNumber(n.intValue());
- }
- else {
+ } else {
throw new IllegalArgumentException("Value must be an Integer");
}
}
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbConverter.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbConverter.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbConverter.java Tue Mar 25 00:49:12 2008
@@ -16,19 +16,22 @@
*/
package org.apache.camel.converter.jaxb;
-import org.apache.camel.Converter;
-import org.apache.camel.Exchange;
-import org.apache.camel.Message;
-import org.apache.camel.converter.HasAnnotation;
-import org.apache.camel.converter.jaxp.XmlConverter;
-import org.w3c.dom.Document;
-
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.util.JAXBSource;
import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+
+import org.apache.camel.Converter;
+import org.apache.camel.Exchange;
+import org.apache.camel.Message;
+import org.apache.camel.converter.HasAnnotation;
+import org.apache.camel.converter.jaxp.XmlConverter;
+
+
/**
* @version $Revision$
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,8 +30,8 @@
import org.apache.camel.util.IOHelper;
/**
- * A <a href="http://activemq.apache.org/camel/data-format.html">data format</a>
- * ({@link DataFormat}) using JAXB2 to marshal to and from XML
+ * A <a href="http://activemq.apache.org/camel/data-format.html">data format</a> ({@link DataFormat})
+ * using JAXB2 to marshal to and from XML
*
* @version $Revision$
*/
@@ -57,8 +56,7 @@
public void marshal(Exchange exchange, Object graph, OutputStream stream) throws IOException {
try {
getMarshaller().marshal(graph, stream);
- }
- catch (JAXBException e) {
+ } catch (JAXBException e) {
throw IOHelper.createIOException(e);
}
}
@@ -66,14 +64,13 @@
public Object unmarshal(Exchange exchange, InputStream stream) throws IOException, ClassNotFoundException {
try {
return getUnmarshaller().unmarshal(stream);
- }
- catch (JAXBException e) {
+ } catch (JAXBException e) {
throw IOHelper.createIOException(e);
}
}
// Properties
- //-------------------------------------------------------------------------
+ // -------------------------------------------------------------------------
public JAXBContext getContext() throws JAXBException {
if (context == null) {
context = createContext();
@@ -126,8 +123,7 @@
protected JAXBContext createContext() throws JAXBException {
if (contextPath != null) {
return JAXBContext.newInstance(contextPath);
- }
- else {
+ } else {
return JAXBContext.newInstance();
}
}
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/LongHeader.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/LongHeader.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/LongHeader.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/LongHeader.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,10 +16,10 @@
*/
package org.apache.camel.converter.jaxb;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
/**
* @version $Revision$
@@ -53,10 +52,9 @@
public void setValue(Object value) {
if (value instanceof Number) {
- Number n = (Number) value;
+ Number n = (Number)value;
setNumber(n.longValue());
- }
- else {
+ } else {
throw new IllegalArgumentException("Value must be a Long");
}
}
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/MessageType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/MessageType.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/MessageType.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/MessageType.java Tue Mar 25 00:49:12 2008
@@ -1,4 +1,4 @@
-/*
+/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -16,7 +16,11 @@
*/
package org.apache.camel.converter.jaxb;
-import org.apache.camel.Message;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@@ -25,11 +29,8 @@
import javax.xml.bind.annotation.XmlMixed;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+
+import org.apache.camel.Message;
/**
* Represents a JAXB2 representation of a Camel {@link Message}
@@ -52,8 +53,7 @@
if (content != null) {
if (content.size() == 1) {
return content.get(0);
- }
- else {
+ } else {
return content;
}
}
@@ -64,9 +64,8 @@
public void setBody(Object body) {
this.body = body;
if (body instanceof List) {
- content = (List) body;
- }
- else {
+ content = (List)body;
+ } else {
content = new ArrayList();
content.add(body);
}
@@ -117,15 +116,12 @@
protected HeaderType createHeader(String key, Object value) {
if (value instanceof String) {
- return new StringHeader(key, (String) value);
- }
- else if (value instanceof Integer) {
- return new IntegerHeader(key, (Integer) value);
- }
- else if (value instanceof Long) {
- return new LongHeader(key, (Long) value);
- }
- else {
+ return new StringHeader(key, (String)value);
+ } else if (value instanceof Integer) {
+ return new IntegerHeader(key, (Integer)value);
+ } else if (value instanceof Long) {
+ return new LongHeader(key, (Long)value);
+ } else {
// lets convert to a String
return new StringHeader(key, value.toString());
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ObjectHeader.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ObjectHeader.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ObjectHeader.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/ObjectHeader.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/PropertyType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/PropertyType.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/PropertyType.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/PropertyType.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Modified: activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/StringHeader.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/StringHeader.java?rev=640731&r1=640730&r2=640731&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/StringHeader.java (original)
+++ activemq/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/StringHeader.java Tue Mar 25 00:49:12 2008
@@ -1,5 +1,4 @@
/**
- *
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,10 +16,10 @@
*/
package org.apache.camel.converter.jaxb;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlAccessType;
/**
* @version $Revision$
@@ -54,8 +53,7 @@
public void setValue(Object value) {
if (value instanceof String) {
setText((String) value);
- }
- else {
+ } else {
throw new IllegalArgumentException("Value must be a String");
}
}