You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2009/12/17 11:06:33 UTC
svn commit: r891619 - in /camel/trunk:
camel-core/src/main/java/org/apache/camel/
camel-core/src/test/java/org/apache/camel/impl/
components/camel-guice/src/main/java/org/apache/camel/guice/impl/
components/camel-spring/src/main/java/org/apache/camel/s...
Author: davsclaus
Date: Thu Dec 17 10:06:31 2009
New Revision: 891619
URL: http://svn.apache.org/viewvc?rev=891619&view=rev
Log:
CAMEL-2300: Renamed name attribute on @EndpointInject to ref.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointInject.java
camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
camel/trunk/components/camel-guice/src/main/java/org/apache/camel/guice/impl/EndpointInjector.java
camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/InjectedBean.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyRouteBuilder.java
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/file/SpringFileAntPathMatcherFileFilterTest.java
camel/trunk/examples/camel-example-axis/src/main/java/org/apache/camel/example/axis/ReportIncidentService.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFileAntPathMatcherRemoteFileFilterTest.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFtpEndpointTest.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpRoute.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXTest.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionAndNoTransactionErrorHandlerConfiguredTest.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionTest.java
camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithRollbackTest.java
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointInject.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointInject.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointInject.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/EndpointInject.java Thu Dec 17 10:06:31 2009
@@ -30,7 +30,7 @@
* can be specified on this annotation, or a name can be specified which is resolved in the
* {@link org.apache.camel.spi.Registry} such as in your Spring ApplicationContext.
*
- * If no name or uri is specified then the name is defaulted from the field, property or method name.
+ * If no ref or uri is specified then the ref is defaulted from the field, property or method name.
*
* @version $Revision$
*/
@@ -39,6 +39,6 @@
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR })
public @interface EndpointInject {
String uri() default "";
- String name() default "";
+ String ref() default "";
String context() default "";
}
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java Thu Dec 17 10:06:31 2009
@@ -79,7 +79,7 @@
Class<?>[] parameterTypes = method.getParameterTypes();
for (Class type : parameterTypes) {
String propertyName = ObjectHelper.getPropertyName(method);
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
ObjectHelper.invokeMethod(method, bean, value);
}
@@ -102,7 +102,7 @@
Class<?>[] parameterTypes = method.getParameterTypes();
for (Class type : parameterTypes) {
String propertyName = ObjectHelper.getPropertyName(method);
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
ObjectHelper.invokeMethod(method, bean, value);
}
@@ -129,7 +129,7 @@
Class<?>[] parameterTypes = method.getParameterTypes();
for (Class type : parameterTypes) {
String propertyName = ObjectHelper.getPropertyName(method);
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
ObjectHelper.invokeMethod(method, bean, value);
}
@@ -155,7 +155,7 @@
EndpointInject endpointInject = field.getAnnotation(EndpointInject.class);
Class<?> type = field.getType();
String propertyName = "producer";
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
field.set(bean, value);
@@ -179,7 +179,7 @@
EndpointInject endpointInject = field.getAnnotation(EndpointInject.class);
Class<?> type = field.getType();
String propertyName = "producer";
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
field.set(bean, value);
@@ -205,7 +205,7 @@
String propertyName = "producer";
try {
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
fail("Should throw exception");
} catch (IllegalArgumentException e) {
assertEquals("registry entry called unknown of type org.apache.camel.Endpoint must be specified", e.getMessage());
@@ -223,7 +223,7 @@
String propertyName = "producer";
try {
- Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.name(), propertyName);
+ Object value = helper.getInjectionValue(type, endpointInject.uri(), endpointInject.ref(), propertyName);
fail("Should throw exception");
} catch (ResolveEndpointFailedException e) {
assertEquals("Failed to resolve endpoint: xxx://foo due to: No component found with scheme: xxx", e.getMessage());
@@ -319,7 +319,7 @@
public class MyEndpointInjectProducerTemplateNameUnknown {
- @EndpointInject(name = "unknown")
+ @EndpointInject(ref = "unknown")
public ProducerTemplate producer;
public void send(Exchange exchange) throws Exception {
Modified: camel/trunk/components/camel-guice/src/main/java/org/apache/camel/guice/impl/EndpointInjector.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-guice/src/main/java/org/apache/camel/guice/impl/EndpointInjector.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-guice/src/main/java/org/apache/camel/guice/impl/EndpointInjector.java (original)
+++ camel/trunk/components/camel-guice/src/main/java/org/apache/camel/guice/impl/EndpointInjector.java Thu Dec 17 10:06:31 2009
@@ -46,7 +46,7 @@
Class<?> type = field.getType();
String injectionPointName = field.getName();
String uri = inject.uri();
- String endpointRef = inject.name();
+ String endpointRef = inject.ref();
return getInjectionValue(type, uri, endpointRef, injectionPointName);
}
@@ -56,7 +56,7 @@
Class<?>[] parameterTypes = method.getParameterTypes();
Class<?> type = parameterTypes[index];
String injectionPointName = ObjectHelper.getPropertyName(method);
- String endpointRef = inject.name();
+ String endpointRef = inject.ref();
String uri = inject.uri();
return getInjectionValue(type, uri, endpointRef, injectionPointName);
Modified: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java (original)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/CamelBeanPostProcessor.java Thu Dec 17 10:06:31 2009
@@ -200,7 +200,7 @@
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
EndpointInject endpointInject = field.getAnnotation(EndpointInject.class);
if (endpointInject != null && postProcessor.matchContext(endpointInject.context())) {
- injectField(field, endpointInject.uri(), endpointInject.name(), bean);
+ injectField(field, endpointInject.uri(), endpointInject.ref(), bean);
}
Produce produce = field.getAnnotation(Produce.class);
@@ -228,7 +228,7 @@
protected void setterInjection(Method method, Object bean) {
EndpointInject endpointInject = method.getAnnotation(EndpointInject.class);
if (endpointInject != null && postProcessor.matchContext(endpointInject.context())) {
- setterInjection(method, bean, endpointInject.uri(), endpointInject.name());
+ setterInjection(method, bean, endpointInject.uri(), endpointInject.ref());
}
Produce produce = method.getAnnotation(Produce.class);
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/InjectedBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/InjectedBean.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/InjectedBean.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/InjectedBean.java Thu Dec 17 10:06:31 2009
@@ -53,7 +53,7 @@
return propertyInjectedEndpoint;
}
- @EndpointInject(name = "namedEndpoint1")
+ @EndpointInject(ref = "namedEndpoint1")
public void setPropertyInjectedEndpoint(Endpoint propertyInjectedEndpoint) {
this.propertyInjectedEndpoint = propertyInjectedEndpoint;
}
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/NodeIdReferenceTest.java Thu Dec 17 10:06:31 2009
@@ -34,7 +34,7 @@
@Autowired
protected ProducerTemplate producer;
- @EndpointInject(name = "foo")
+ @EndpointInject(ref = "foo")
protected Endpoint start;
@EndpointInject(uri = "mock:result")
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/SpringConsumerTemplateTest.java Thu Dec 17 10:06:31 2009
@@ -39,7 +39,7 @@
@Autowired
private ConsumerTemplate consumer;
- @EndpointInject(name = "result")
+ @EndpointInject(ref = "result")
private MockEndpoint mock;
public void testConsumeTemplate() throws Exception {
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyRouteBuilder.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyRouteBuilder.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/scan/route/MyRouteBuilder.java Thu Dec 17 10:06:31 2009
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.apache.camel.spring.config.scan.route;
import org.apache.camel.Endpoint;
@@ -27,10 +26,10 @@
MyProcessor component;
- @EndpointInject(name = "start")
+ @EndpointInject(ref = "start")
Endpoint startEndpoint;
- @EndpointInject(name = "result")
+ @EndpointInject(ref = "result")
Endpoint resultEndpoint;
@Override
Modified: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/file/SpringFileAntPathMatcherFileFilterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/file/SpringFileAntPathMatcherFileFilterTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/file/SpringFileAntPathMatcherFileFilterTest.java (original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/file/SpringFileAntPathMatcherFileFilterTest.java Thu Dec 17 10:06:31 2009
@@ -34,7 +34,7 @@
protected String expectedBody = "Godday World";
@Autowired
protected ProducerTemplate template;
- @EndpointInject(name = "myFileEndpoint")
+ @EndpointInject(ref = "myFileEndpoint")
protected Endpoint inputFile;
@EndpointInject(uri = "mock:result")
protected MockEndpoint result;
Modified: camel/trunk/examples/camel-example-axis/src/main/java/org/apache/camel/example/axis/ReportIncidentService.java
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-axis/src/main/java/org/apache/camel/example/axis/ReportIncidentService.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-axis/src/main/java/org/apache/camel/example/axis/ReportIncidentService.java (original)
+++ camel/trunk/examples/camel-example-axis/src/main/java/org/apache/camel/example/axis/ReportIncidentService.java Thu Dec 17 10:06:31 2009
@@ -26,7 +26,7 @@
*/
public class ReportIncidentService {
- @EndpointInject(name = "backup")
+ @EndpointInject(ref = "backup")
private ProducerTemplate template;
public OutputReportIncident reportIncident(InputReportIncident parameters) {
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFileAntPathMatcherRemoteFileFilterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFileAntPathMatcherRemoteFileFilterTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFileAntPathMatcherRemoteFileFilterTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFileAntPathMatcherRemoteFileFilterTest.java Thu Dec 17 10:06:31 2009
@@ -48,7 +48,7 @@
protected String expectedBody = "Godday World";
@Autowired
protected ProducerTemplate template;
- @EndpointInject(name = "myFTPEndpoint")
+ @EndpointInject(ref = "myFTPEndpoint")
protected Endpoint inputFTP;
@EndpointInject(uri = "mock:result")
protected MockEndpoint result;
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFtpEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFtpEndpointTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFtpEndpointTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/ftp/SpringFtpEndpointTest.java Thu Dec 17 10:06:31 2009
@@ -47,7 +47,7 @@
@Autowired
protected ProducerTemplate template;
- @EndpointInject(name = "myFTPEndpoint")
+ @EndpointInject(ref = "myFTPEndpoint")
protected Endpoint inputFTP;
@EndpointInject(uri = "mock:result")
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpRoute.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpRoute.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpRoute.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpRoute.java Thu Dec 17 10:06:31 2009
@@ -40,7 +40,7 @@
@Resource(name = "PROPAGATION_REQUIRED")
protected SpringTransactionPolicy required;
- @EndpointInject(name = "data")
+ @EndpointInject(ref = "data")
protected Endpoint data;
protected String nok = "<?xml version=\"1.0\"?><reply><status>nok</status></reply>";
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXTest.java Thu Dec 17 10:06:31 2009
@@ -42,8 +42,8 @@
// use the spring id to refer to the endpoint we should send data to
// notice using this id we can setup the actual endpoint in spring XML
- // and we can even use spring ${ } propertiy in the spring XML
- @EndpointInject(name = "data")
+ // and we can even use spring ${ } property in the spring XML
+ @EndpointInject(ref = "data")
private ProducerTemplate template;
// the ok response to expect
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionAndNoTransactionErrorHandlerConfiguredTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionAndNoTransactionErrorHandlerConfiguredTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionAndNoTransactionErrorHandlerConfiguredTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionAndNoTransactionErrorHandlerConfiguredTest.java Thu Dec 17 10:06:31 2009
@@ -45,7 +45,7 @@
@Autowired
private ProducerTemplate template;
- @EndpointInject(name = "data")
+ @EndpointInject(ref = "data")
private Endpoint data;
@EndpointInject(uri = "mock:rollback")
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithOnExceptionTest.java Thu Dec 17 10:06:31 2009
@@ -46,7 +46,7 @@
@Autowired
private ProducerTemplate template;
- @EndpointInject(name = "data")
+ @EndpointInject(ref = "data")
private Endpoint data;
@EndpointInject(uri = "mock:rollback")
Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithRollbackTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithRollbackTest.java?rev=891619&r1=891618&r2=891619&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithRollbackTest.java (original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/tx/JmsToHttpTXWithRollbackTest.java Thu Dec 17 10:06:31 2009
@@ -43,8 +43,8 @@
// use the spring id to refer to the endpoint we should send data to
// notice using this id we can setup the actual endpoint in spring XML
- // and we can even use spring ${ } propertiy in the spring XML
- @EndpointInject(name = "data")
+ // and we can even use spring ${ } property in the spring XML
+ @EndpointInject(ref = "data")
private ProducerTemplate template;
// the ok response to expect