Author: davsclaus Date: Wed Apr 24 09:19:32 2013 New Revision: 1471315 URL: http://svn.apache.org/r1471315 Log: Fixed CS
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ComponentConfiguration.java camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanComponent.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/AnnotatedParameterConfiguration.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentConfiguration.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledBatchPollingConsumer.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriComponentConfiguration.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointComponent.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointConfiguration.java camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ComponentConfigurationTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ComponentConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ComponentConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/ComponentConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/ComponentConfiguration.java Wed Apr 24 09:19:32 2013 @@ -16,12 +16,12 @@ */ package org.apache.camel; -import org.apache.camel.impl.ParameterConfiguration; - import java.net.URISyntaxException; import java.util.Map; import java.util.SortedMap; +import org.apache.camel.impl.ParameterConfiguration; + /** * Represents a set of configuration values for an endpoint URI which can be created from a URI string * or a base URI string and a set of parameter names and values. @@ -29,7 +29,7 @@ import java.util.SortedMap; * The configuration values can then be introspected, modified and converted back into a URI string * or Endpoint. * - * For @{link UriEndpointComponent} implementations created for Endpoints annotated with {@link UriEndpoint} and the + * For @{link UriEndpointComponent} implementations created for Endpoints annotated with {@link org.apache.camel.spi.UriEndpoint} and the * associated annotations then all the parameter values can be introspected and the parameter values are converted to their * correct type. * @@ -48,7 +48,6 @@ public interface ComponentConfiguration */ void setBaseUri(String baseUri); - /** * Returns the current parameters of the configuration (usually encoded as ?foo=bar&whatnot=something URI query parameters) */ @@ -100,10 +99,9 @@ public interface ComponentConfiguration */ SortedMap<String, ParameterConfiguration> getParameterConfigurationMap(); - /** * Converts the configuration into a URI and then looks up the endpoint in the {@link CamelContext} - * which typically results in a new {@link Endpoint} instance being creatd. + * which typically results in a new {@link Endpoint} instance being created. */ Endpoint createEndpoint() throws Exception; @@ -116,7 +114,6 @@ public interface ComponentConfiguration */ void configureEndpoint(Endpoint endpoint); - /** * Gets the named URI parameter value on the given endpoint * Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanComponent.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanComponent.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanComponent.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanComponent.java Wed Apr 24 09:19:32 2013 @@ -16,6 +16,8 @@ */ package org.apache.camel.component.bean; +import java.util.Map; + import org.apache.camel.Endpoint; import org.apache.camel.Processor; import org.apache.camel.impl.ProcessorEndpoint; @@ -24,8 +26,6 @@ import org.apache.camel.util.LRUSoftCach import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Map; - /** * The <a href="http://camel.apache.org/bean.html">Bean Component</a> * will look up the URI in the {@link org.apache.camel.spi.Registry} and use that to handle message dispatching. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/AnnotatedParameterConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/AnnotatedParameterConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/AnnotatedParameterConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/AnnotatedParameterConfiguration.java Wed Apr 24 09:19:32 2013 @@ -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: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java Wed Apr 24 09:19:32 2013 @@ -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, @@ -172,5 +171,4 @@ public abstract class ComponentConfigura return value; } - } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultComponentConfiguration.java Wed Apr 24 09:19:32 2013 @@ -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, @@ -33,6 +32,7 @@ import org.apache.camel.util.Introspecti * do not have Endpoint classes annotated with {@link org.apache.camel.spi.UriEndpoint} */ public class DefaultComponentConfiguration extends ComponentConfigurationSupport { + public DefaultComponentConfiguration(Component component) { super(component); } @@ -42,21 +42,18 @@ public class DefaultComponentConfigurati try { return IntrospectionSupport.getProperty(endpoint, name); } catch (Exception e) { - throw new RuntimeCamelException( - "Failed to get property " + name + " on endpoint " + endpoint + " due to " + e, e); + throw new RuntimeCamelException("Failed to get property " + name + " on endpoint " + endpoint + " due to " + e.getMessage(), e); } } @Override - public void setEndpointParameter(Endpoint endpoint, String name, Object value) - throws RuntimeCamelException { - boolean answer = false; + public void setEndpointParameter(Endpoint endpoint, String name, Object value) throws RuntimeCamelException { + boolean answer; try { answer = IntrospectionSupport.setProperty(endpoint, name, value); } catch (Exception e) { throw new RuntimeCamelException( - "Failed to set property " + name + " with value " + value + " on endpoint " + endpoint - + " due to " + e, e); + "Failed to set property " + name + " with value " + value + " on endpoint " + endpoint + " due to " + e.getMessage(), e); } if (!answer) { throw new InvalidPropertyException(endpoint, name); @@ -81,4 +78,5 @@ public class DefaultComponentConfigurati } return answer; } + } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java Wed Apr 24 09:19:32 2013 @@ -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, @@ -41,8 +40,6 @@ public class ParameterConfiguration { /** * Returns the name of the parameter value - * - * @return */ public String getName() { return name; @@ -61,4 +58,5 @@ public class ParameterConfiguration { public static ParameterConfiguration newInstance(String name, Field field, UriParam uriParam) { return new AnnotatedParameterConfiguration(name, field.getType(), field); } + } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledBatchPollingConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledBatchPollingConsumer.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledBatchPollingConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledBatchPollingConsumer.java Wed Apr 24 09:19:32 2013 @@ -23,8 +23,8 @@ import org.apache.camel.Endpoint; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.ShutdownRunningTask; -import org.apache.camel.spi.UriParam; import org.apache.camel.spi.ShutdownAware; +import org.apache.camel.spi.UriParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ScheduledPollConsumer.java Wed Apr 24 09:19:32 2013 @@ -27,8 +27,8 @@ import org.apache.camel.LoggingLevel; import org.apache.camel.PollingConsumerPollingStrategy; import org.apache.camel.Processor; import org.apache.camel.SuspendableService; -import org.apache.camel.spi.UriParam; import org.apache.camel.spi.PollingConsumerPollStrategy; +import org.apache.camel.spi.UriParam; import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.ServiceHelper; import org.slf4j.Logger; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriComponentConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriComponentConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriComponentConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriComponentConfiguration.java Wed Apr 24 09:19:32 2013 @@ -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,7 +30,7 @@ import org.slf4j.LoggerFactory; /** * Implements {@link org.apache.camel.EndpointConfiguration} for Endpoint implementations - * which are annotated with {@link UriEndpoint} + * which are annotated with {@link org.apache.camel.spi.UriEndpoint} * to use the {@link org.apache.camel.spi.UriParam} and {@link org.apache.camel.spi.UriParams} annotations * to denote its parameters which can be specified via URI query parameters. */ @@ -78,8 +77,7 @@ public class UriComponentConfiguration e } @Override - public void setEndpointParameter(Endpoint endpoint, String name, Object value) - throws RuntimeCamelException { + public void setEndpointParameter(Endpoint endpoint, String name, Object value) throws RuntimeCamelException { ParameterConfiguration config = getParameterConfiguration(name); // lets try set the property regardless of if this maps to a valid property name @@ -88,9 +86,8 @@ public class UriComponentConfiguration e try { IntrospectionSupport.setProperty(endpoint, name, value); } catch (Exception e) { - throw new RuntimeCamelException( - "Failed to set property '" + name + "' on " + endpoint + " to value " + value + " due " - + e.getMessage(), e); + throw new RuntimeCamelException("Failed to set property '" + name + "' on " + endpoint + " to value " + + value + " due " + e.getMessage(), e); } if (config == null) { unknownPropertyName(name); @@ -150,8 +147,8 @@ public class UriComponentConfiguration e throw new InvalidPropertyException(this, name, endpointClass); } else { LOG.warn("Using parameter " + name + " on endpoint " + getEndpointClass().getName() - + " which does not have a @UriParam annotation! " + - "Please add the @UriParam annotation to the " + name + "field"); + + " which does not have a @UriParam annotation! " + + "Please add the @UriParam annotation to the " + name + " field"); } } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointComponent.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointComponent.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointComponent.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointComponent.java Wed Apr 24 09:19:32 2013 @@ -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: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointConfiguration.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointConfiguration.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointConfiguration.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/UriEndpointConfiguration.java Wed Apr 24 09:19:32 2013 @@ -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, @@ -34,7 +33,7 @@ import org.slf4j.LoggerFactory; /** * Implements {@link EndpointConfiguration} for Endpoint implementations - * which are annotated with {@link UriEndpoint} to use the {@link UriParam} and {@link UriParams} annotations + * which are annotated with {@link org.apache.camel.spi.UriEndpoint} to use the {@link UriParam} and {@link UriParams} annotations * to denote its parameters which can be specified via URI query parameters. */ public class UriEndpointConfiguration implements EndpointConfiguration { @@ -92,8 +91,8 @@ public class UriEndpointConfiguration im protected void warnMissingUriParamOnProperty(String name) { LOG.warn("Using property " + name + " on endpoint " + getEndpointClass().getName() - + " which does not have a @UriParam annotation! " + - "Please add the @UriParam annotation to the " + name + "field"); + + " which does not have a @UriParam annotation! " + + "Please add the @UriParam annotation to the " + name + " field"); } @Override Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ComponentConfigurationTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ComponentConfigurationTest.java?rev=1471315&r1=1471314&r2=1471315&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ComponentConfigurationTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/ComponentConfigurationTest.java Wed Apr 24 09:19:32 2013 @@ -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, @@ -370,9 +369,9 @@ public class ComponentConfigurationTest } public static class NonUriComponent extends DefaultComponent { + @Override - protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) - throws Exception { + protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { return new NonUriEndpoint(uri, this); }