You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/12/02 18:03:50 UTC
svn commit: r1209585 [8/22] - in /camel/trunk: ./ apache-camel/
buildingtools/ camel-core/ camel-core/src/main/java/org/apache/camel/
camel-core/src/main/java/org/apache/camel/api/management/
camel-core/src/main/java/org/apache/camel/builder/ camel-cor...
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/OsgiPackageScanClassResolverTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/ServiceRegistryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/test/MockTypeConverterRegistry.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/test/MyRouteBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/test/MyService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-osgi/src/test/java/org/apache/camel/core/osgi/test/MyTypeConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelConsumerTemplateFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelContextFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelEndpointFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelProducerTemplateFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelRedeliveryPolicyFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/AbstractCamelThreadPoolFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelJMXAgentDefinition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelPropertyPlaceholderDefinition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelProxyFactoryDefinition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/CamelServiceExporterDefinition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/scan/AntPathMatcher.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-core-xml/src/main/java/org/apache/camel/core/xml/scan/PatternBasedPackageScanFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-crypto/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/AbstractPGPDataFormatTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-crypto/src/test/java/org/apache/camel/converter/crypto/SpringPGPDataFormatTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-csv/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,8 +1,13 @@
-.project
.pmd
.checkstyle
-.classpath
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
Propchange: camel/trunk/components/camel-csv/src/test/java/org/apache/camel/dataformat/csv/CsvRouteCharsetTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.checkstyle
.pmd
-eclipse-classes
+.checkstyle
+.ruleset
target
+.settings
.classpath
.project
-.settings
-*.i??
-write
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
+eclipse-classes
Propchange: camel/trunk/components/camel-cxf-transport/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,4 +1,13 @@
+.pmd
+.checkstyle
+.ruleset
+target
+.settings
.classpath
.project
-.settings
-target
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
+eclipse-classes
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfBlueprintEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfOperationException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/AbstractBeanDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/BlueprintSupport.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/CxfNamespaceHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/EndpointDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsClientDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/blueprint/RsServerDefinitionParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/interceptors/SetSoapVersionInterceptor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java Fri Dec 2 17:03:07 2011
@@ -1,99 +1,99 @@
-/**
- * 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.cxf.spring;
-
-import java.util.List;
-
-import org.apache.camel.component.cxf.jaxrs.BeanIdAware;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.feature.LoggingFeature;
-import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
-import org.apache.cxf.version.Version;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-public class SpringJAXRSClientFactoryBean extends JAXRSClientFactoryBean
- implements ApplicationContextAware, BeanIdAware {
- private String beanId;
- private boolean loggingFeatureEnabled;
- private int loggingSizeLimit;
-
- public SpringJAXRSClientFactoryBean() {
- super();
- }
-
- public boolean isLoggingFeatureEnabled() {
- return loggingFeatureEnabled;
- }
-
- public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
- this.loggingFeatureEnabled = loggingFeatureEnabled;
- }
-
- public int getLoggingSizeLimit() {
- return loggingSizeLimit;
- }
-
- public void setLoggingSizeLimit(int loggingSizeLimit) {
- this.loggingSizeLimit = loggingSizeLimit;
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void setApplicationContext(ApplicationContext ctx) throws BeansException {
- if (bus == null) {
- if (Version.getCurrentVersion().startsWith("2.3")) {
- // Don't relate on the DefaultBus
- BusFactory factory = new SpringBusFactory(ctx);
- bus = factory.createBus();
- BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
- setBus(bus);
- } else {
- setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
- }
- }
- }
-
- public String getBeanId() {
- return beanId;
- }
-
- public void setBeanId(String id) {
- beanId = id;
- }
-
- // add this mothod for testing
- List<String> getSchemaLocations() {
- return schemaLocations;
- }
-
- public List<AbstractFeature> getFeatures() {
- List<AbstractFeature> answer = super.getFeatures();
- if (isLoggingFeatureEnabled()) {
- if (getLoggingSizeLimit() > 0) {
- answer.add(new LoggingFeature(getLoggingSizeLimit()));
- } else {
- answer.add(new LoggingFeature());
- }
- }
- return answer;
- }
+/**
+ * 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.cxf.spring;
+
+import java.util.List;
+
+import org.apache.camel.component.cxf.jaxrs.BeanIdAware;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
+import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.apache.cxf.version.Version;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class SpringJAXRSClientFactoryBean extends JAXRSClientFactoryBean
+ implements ApplicationContextAware, BeanIdAware {
+ private String beanId;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
+
+ public SpringJAXRSClientFactoryBean() {
+ super();
+ }
+
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+ if (bus == null) {
+ if (Version.getCurrentVersion().startsWith("2.3")) {
+ // Don't relate on the DefaultBus
+ BusFactory factory = new SpringBusFactory(ctx);
+ bus = factory.createBus();
+ BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
+ setBus(bus);
+ } else {
+ setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
+ }
+ }
+ }
+
+ public String getBeanId() {
+ return beanId;
+ }
+
+ public void setBeanId(String id) {
+ beanId = id;
+ }
+
+ // add this mothod for testing
+ List<String> getSchemaLocations() {
+ return schemaLocations;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
}
\ No newline at end of file
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSClientFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java Fri Dec 2 17:03:07 2011
@@ -1,108 +1,108 @@
-/**
- * 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.cxf.spring;
-
-import java.util.List;
-
-import org.apache.camel.component.cxf.jaxrs.BeanIdAware;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.feature.LoggingFeature;
-import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
-import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
-import org.apache.cxf.version.Version;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-
-public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean implements
- ApplicationContextAware, BeanIdAware {
- private String beanId;
- private boolean loggingFeatureEnabled;
- private int loggingSizeLimit;
-
- public SpringJAXRSServerFactoryBean() {
- super();
- }
-
- public SpringJAXRSServerFactoryBean(JAXRSServiceFactoryBean sf) {
- super(sf);
- }
-
- @SuppressWarnings("deprecation")
- public void setApplicationContext(ApplicationContext ctx) throws BeansException {
- if (bus == null) {
- if (Version.getCurrentVersion().startsWith("2.3")) {
- // Don't relate on the DefaultBus
- BusFactory factory = new SpringBusFactory(ctx);
- bus = factory.createBus();
- setBus(bus);
- BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
- } else {
- setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
- }
- }
- }
-
- public String getBeanId() {
- return beanId;
- }
-
- public void setBeanId(String id) {
- beanId = id;
- }
-
- // to walk round the issue of setting the serviceClass in CXF
- public void setServiceClass(Class clazz) {
- setResourceClasses(clazz);
- }
-
- // add this mothod for testing
- List<String> getSchemaLocations() {
- return schemaLocations;
- }
-
- public boolean isLoggingFeatureEnabled() {
- return loggingFeatureEnabled;
- }
-
- public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
- this.loggingFeatureEnabled = loggingFeatureEnabled;
- }
-
- public int getLoggingSizeLimit() {
- return loggingSizeLimit;
- }
-
- public void setLoggingSizeLimit(int loggingSizeLimit) {
- this.loggingSizeLimit = loggingSizeLimit;
- }
-
- public List<AbstractFeature> getFeatures() {
- List<AbstractFeature> answer = super.getFeatures();
- if (isLoggingFeatureEnabled()) {
- if (getLoggingSizeLimit() > 0) {
- answer.add(new LoggingFeature(getLoggingSizeLimit()));
- } else {
- answer.add(new LoggingFeature());
- }
- }
- return answer;
- }
+/**
+ * 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.cxf.spring;
+
+import java.util.List;
+
+import org.apache.camel.component.cxf.jaxrs.BeanIdAware;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.feature.LoggingFeature;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
+import org.apache.cxf.version.Version;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class SpringJAXRSServerFactoryBean extends JAXRSServerFactoryBean implements
+ ApplicationContextAware, BeanIdAware {
+ private String beanId;
+ private boolean loggingFeatureEnabled;
+ private int loggingSizeLimit;
+
+ public SpringJAXRSServerFactoryBean() {
+ super();
+ }
+
+ public SpringJAXRSServerFactoryBean(JAXRSServiceFactoryBean sf) {
+ super(sf);
+ }
+
+ @SuppressWarnings("deprecation")
+ public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+ if (bus == null) {
+ if (Version.getCurrentVersion().startsWith("2.3")) {
+ // Don't relate on the DefaultBus
+ BusFactory factory = new SpringBusFactory(ctx);
+ bus = factory.createBus();
+ setBus(bus);
+ BusWiringBeanFactoryPostProcessor.updateBusReferencesInContext(bus, ctx);
+ } else {
+ setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
+ }
+ }
+ }
+
+ public String getBeanId() {
+ return beanId;
+ }
+
+ public void setBeanId(String id) {
+ beanId = id;
+ }
+
+ // to walk round the issue of setting the serviceClass in CXF
+ public void setServiceClass(Class clazz) {
+ setResourceClasses(clazz);
+ }
+
+ // add this mothod for testing
+ List<String> getSchemaLocations() {
+ return schemaLocations;
+ }
+
+ public boolean isLoggingFeatureEnabled() {
+ return loggingFeatureEnabled;
+ }
+
+ public void setLoggingFeatureEnabled(boolean loggingFeatureEnabled) {
+ this.loggingFeatureEnabled = loggingFeatureEnabled;
+ }
+
+ public int getLoggingSizeLimit() {
+ return loggingSizeLimit;
+ }
+
+ public void setLoggingSizeLimit(int loggingSizeLimit) {
+ this.loggingSizeLimit = loggingSizeLimit;
+ }
+
+ public List<AbstractFeature> getFeatures() {
+ List<AbstractFeature> answer = super.getFeatures();
+ if (isLoggingFeatureEnabled()) {
+ if (getLoggingSizeLimit() > 0) {
+ answer.add(new LoggingFeature(getLoggingSizeLimit()));
+ } else {
+ answer.add(new LoggingFeature());
+ }
+ }
+ return answer;
+ }
}
\ No newline at end of file
Propchange: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/spring/SpringJAXRSServerFactoryBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/resources/OSGI-INF/blueprint/camel-cxf.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/main/resources/schema/blueprint/camel-cxf.xsd
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfProducerSynchronousFalseTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfOperationExceptionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java (original)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java Fri Dec 2 17:03:07 2011
@@ -1,48 +1,48 @@
-/**
- * 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.cxf.jaxrs.testbean;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.PUT;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-/**
- *
- * @version
- */
-// START SNIPPET: example
-@Path("/customerservice/")
-public class CustomerServiceResource {
-
- public CustomerServiceResource() {
- }
-
- @GET
- @Path("/customers/{id}/")
- public Customer getCustomer(@PathParam("id") String id) {
- return null;
- }
-
- @PUT
- @Path("/customers/")
- public Response updateCustomer(Customer customer) {
- return null;
- }
-}
-// END SNIPPET: example
+/**
+ * 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.cxf.jaxrs.testbean;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+
+/**
+ *
+ * @version
+ */
+// START SNIPPET: example
+@Path("/customerservice/")
+public class CustomerServiceResource {
+
+ public CustomerServiceResource() {
+ }
+
+ @GET
+ @Path("/customers/{id}/")
+ public Customer getCustomer(@PathParam("id") String id) {
+ return null;
+ }
+
+ @PUT
+ @Path("/customers/")
+ public Response updateCustomer(Customer customer) {
+ return null;
+ }
+}
+// END SNIPPET: example
Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/spring/FileToCxfMessageDataFormatTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanWithWsdlLocationInBeanAndIoCTest-context.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanWithWsdlLocationInBeanTest-context.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest1.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsProducerClientFactoryCacheTest2.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-dns/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsDigEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsIpEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/DnsLookupEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/WikipediaEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/types/DnsConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/main/java/org/apache/camel/component/dns/types/DnsRecordConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointSpringTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsDigEndpointTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointSpringTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpEndpointTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsIpHeaderTransferTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointSpringTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/DnsLookupEndpointTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointSpringTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/java/org/apache/camel/component/dns/WikipediaEndpointTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/DNSDig.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/DNSDig.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/src/test/resources/DNSLookup.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/DNSLookup.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/src/test/resources/IPCheck.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/IPCheck.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/src/test/resources/Wikipedia.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/Wikipedia.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: camel/trunk/components/camel-dns/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dns/src/test/resources/log4j.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Propchange: camel/trunk/components/camel-dozer/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/main/java/org/apache/camel/converter/dozer/DozerTypeConverterLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/CustomerProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerTestArtifactsFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerTypeConverterDTOTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/DozerTypeConverterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/SpringDozerTypeConverterTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/Address.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/model/Customer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-dozer/src/test/java/org/apache/camel/converter/dozer/service/Customer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eclipse/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-ejb/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,8 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
Propchange: camel/trunk/components/camel-eventadmin/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/Activator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminComponentResolver.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminConsumer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-eventadmin/src/main/java/org/apache/camel/component/eventadmin/EventAdminServiceFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-exec/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Dec 2 17:03:07 2011
@@ -1,9 +1,13 @@
-.project
-.checkstyle
.pmd
-.classpath
+.checkstyle
+.ruleset
target
.settings
+.classpath
+.project
+.wtpmodules
+prj.el
+.jdee_classpath
+.jdee_sources
+velocity.log
eclipse-classes
-*.i??
-classes
Propchange: camel/trunk/components/camel-exec/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/components/camel-exec/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecBinding.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecBinding.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecBinding.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecBinding.java Fri Dec 2 17:03:07 2011
@@ -1,113 +1,113 @@
-/**
- * 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.exec;
-
-import java.io.InputStream;
-
-import org.apache.camel.Exchange;
-
-/**
- * Represents the binding of input and output types of a
- * {@link ExecCommandExecutor} to an {@link Exchange}. The input of the executor
- * is an {@link ExecCommand} and the output is an {@link ExecResult}.
- */
-public interface ExecBinding {
-
- /**
- * The header value overrides the executable of the command, configured in
- * the exec endpoint URI. As executable is considered the remaining of the
- * {@link ExecEndpoint} URI; <br>
- * <br>
- * e.g. in the URI <i> <code>exec:C:/Program Files/jdk/java.exe</code> </i>,
- * <code>C:/Program Files/jdk/java.exe<code> is the executable.
- */
- String EXEC_COMMAND_EXECUTABLE = "CamelExecCommandExecutable";
-
- /**
- * The header value overrides the existing command arguments in the
- * {@link ExecEndpoint} URI. The arguments may be a
- * <code>List<String></code>. In this case no parsing of the arguments is
- * necessary.
- *
- * @see {@link #EXEC_COMMAND_EXECUTABLE}
- */
- String EXEC_COMMAND_ARGS = "CamelExecCommandArgs";
-
- /**
- * Specifies the file name of a file, created by the executable, that should
- * be considered as output of the executable, e.g. a log file.
- *
- * @see ExecResultConverter#toInputStream(ExecResult)
- */
- String EXEC_COMMAND_OUT_FILE = "CamelExecCommandOutFile";
-
- /**
- * Sets the working directory of the {@link #EXEC_COMMAND_EXECUTABLE}. The
- * header value overrides any existing command in the endpoint URI. If this
- * is not configured, the working directory of the current process will be
- * used.
- */
- String EXEC_COMMAND_WORKING_DIR = "CamelExecCommandWorkingDir";
-
- /**
- * Specifies the amount of time, in milliseconds, after which the process of
- * the executable should be terminated. The default value is
- * {@link Long#MAX_VALUE}.
- */
- String EXEC_COMMAND_TIMEOUT = "CamelExecCommandTimeout";
-
- /**
- * The value of this header is a {@link InputStream} with the standard error
- * stream of the executable.
- */
- String EXEC_STDERR = "CamelExecStderr";
-
- /**
- * The value of this header is the exit value that is returned, after the
- * execution. By convention a non-zero status exit value indicates abnormal
- * termination. <br>
- * <b>Note that the exit value is OS dependent.</b>
- */
- String EXEC_EXIT_VALUE = "CamelExecExitValue";
-
- /**
- * The value of this header is a boolean which indicates whether or not
- * to fallback and use stderr when stdout is empty.
- */
- String EXEC_USE_STDERR_ON_EMPTY_STDOUT = "CamelExecUseStderrOnEmptyStdout";
-
- /**
- * Creates a {@link ExecCommand} from the headers in the
- * <code>exchange</code> and the settings of the <code>endpoint</code>.
- *
- * @param exchange a Camel {@link Exchange}
- * @param endpoint an {@link ExecEndpoint} instance
- * @return an {@link ExecCommand} object
- * @see ExecCommandExecutor
- */
- ExecCommand readInput(Exchange exchange, ExecEndpoint endpoint);
-
- /**
- * Populates the exchange form the {@link ExecResult}.
- *
- * @param exchange a Camel {@link Exchange}, in which to write the
- * <code>result</code>
- * @param result the result of a command execution
- * @see ExecCommandExecutor
- */
- void writeOutput(Exchange exchange, ExecResult result);
-}
+/**
+ * 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.exec;
+
+import java.io.InputStream;
+
+import org.apache.camel.Exchange;
+
+/**
+ * Represents the binding of input and output types of a
+ * {@link ExecCommandExecutor} to an {@link Exchange}. The input of the executor
+ * is an {@link ExecCommand} and the output is an {@link ExecResult}.
+ */
+public interface ExecBinding {
+
+ /**
+ * The header value overrides the executable of the command, configured in
+ * the exec endpoint URI. As executable is considered the remaining of the
+ * {@link ExecEndpoint} URI; <br>
+ * <br>
+ * e.g. in the URI <i> <code>exec:C:/Program Files/jdk/java.exe</code> </i>,
+ * <code>C:/Program Files/jdk/java.exe<code> is the executable.
+ */
+ String EXEC_COMMAND_EXECUTABLE = "CamelExecCommandExecutable";
+
+ /**
+ * The header value overrides the existing command arguments in the
+ * {@link ExecEndpoint} URI. The arguments may be a
+ * <code>List<String></code>. In this case no parsing of the arguments is
+ * necessary.
+ *
+ * @see {@link #EXEC_COMMAND_EXECUTABLE}
+ */
+ String EXEC_COMMAND_ARGS = "CamelExecCommandArgs";
+
+ /**
+ * Specifies the file name of a file, created by the executable, that should
+ * be considered as output of the executable, e.g. a log file.
+ *
+ * @see ExecResultConverter#toInputStream(ExecResult)
+ */
+ String EXEC_COMMAND_OUT_FILE = "CamelExecCommandOutFile";
+
+ /**
+ * Sets the working directory of the {@link #EXEC_COMMAND_EXECUTABLE}. The
+ * header value overrides any existing command in the endpoint URI. If this
+ * is not configured, the working directory of the current process will be
+ * used.
+ */
+ String EXEC_COMMAND_WORKING_DIR = "CamelExecCommandWorkingDir";
+
+ /**
+ * Specifies the amount of time, in milliseconds, after which the process of
+ * the executable should be terminated. The default value is
+ * {@link Long#MAX_VALUE}.
+ */
+ String EXEC_COMMAND_TIMEOUT = "CamelExecCommandTimeout";
+
+ /**
+ * The value of this header is a {@link InputStream} with the standard error
+ * stream of the executable.
+ */
+ String EXEC_STDERR = "CamelExecStderr";
+
+ /**
+ * The value of this header is the exit value that is returned, after the
+ * execution. By convention a non-zero status exit value indicates abnormal
+ * termination. <br>
+ * <b>Note that the exit value is OS dependent.</b>
+ */
+ String EXEC_EXIT_VALUE = "CamelExecExitValue";
+
+ /**
+ * The value of this header is a boolean which indicates whether or not
+ * to fallback and use stderr when stdout is empty.
+ */
+ String EXEC_USE_STDERR_ON_EMPTY_STDOUT = "CamelExecUseStderrOnEmptyStdout";
+
+ /**
+ * Creates a {@link ExecCommand} from the headers in the
+ * <code>exchange</code> and the settings of the <code>endpoint</code>.
+ *
+ * @param exchange a Camel {@link Exchange}
+ * @param endpoint an {@link ExecEndpoint} instance
+ * @return an {@link ExecCommand} object
+ * @see ExecCommandExecutor
+ */
+ ExecCommand readInput(Exchange exchange, ExecEndpoint endpoint);
+
+ /**
+ * Populates the exchange form the {@link ExecResult}.
+ *
+ * @param exchange a Camel {@link Exchange}, in which to write the
+ * <code>result</code>
+ * @param result the result of a command execution
+ * @see ExecCommandExecutor
+ */
+ void writeOutput(Exchange exchange, ExecResult result);
+}
Propchange: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecBinding.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommand.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommand.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommand.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommand.java Fri Dec 2 17:03:07 2011
@@ -1,119 +1,119 @@
-/**
- * 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.exec;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import static org.apache.camel.util.ObjectHelper.notNull;
-
-/**
- * Value object that describes the command to be executed.
- */
-public class ExecCommand implements Serializable {
-
- private static final long serialVersionUID = 1755094616849607573L;
-
- /**
- * @see ExecBinding#EXEC_COMMAND_EXECUTABLE
- */
- private final String executable;
-
- /**
- * @see ExecBinding#EXEC_COMMAND_ARGS
- */
- private final List<String> args;
-
- /**
- * @see ExecBinding#EXEC_COMMAND_WORKING_DIR
- */
- private final String workingDir;
-
- /**
- * @see ExecBinding#EXEC_COMMAND_TIMEOUT
- */
- private final long timeout;
-
- /**
- * @see ExecBinding#EXEC_COMMAND_OUT_FILE
- */
- private final File outFile;
-
- /**
- * The input of the executable
- */
- private final InputStream input;
-
- private final boolean useStderrOnEmptyStdout;
-
- public ExecCommand(String executable, List<String> args, String workingDir, Long timeout,
- InputStream input, File outFile, boolean useStderrOnEmptyStdout) {
- notNull(executable, "command executable");
- this.executable = executable;
- this.args = unmodifiableOrEmptyList(args);
- this.workingDir = workingDir;
- this.timeout = timeout;
- this.input = input;
- this.outFile = outFile;
- this.useStderrOnEmptyStdout = useStderrOnEmptyStdout;
- }
-
- public List<String> getArgs() {
- return args;
- }
-
- public String getExecutable() {
- return executable;
- }
-
- public InputStream getInput() {
- return input;
- }
-
- public File getOutFile() {
- return outFile;
- }
-
- public long getTimeout() {
- return timeout;
- }
-
- public String getWorkingDir() {
- return workingDir;
- }
-
- public boolean isUseStderrOnEmptyStdout() {
- return useStderrOnEmptyStdout;
- }
-
- @Override
- public String toString() {
- String dirToPrint = workingDir == null ? "null" : workingDir;
- String outFileToPrint = outFile == null ? "null" : outFile.getPath();
- return "ExecCommand [args=" + args + ", executable=" + executable + ", timeout=" + timeout + ", outFile="
- + outFileToPrint + ", workingDir=" + dirToPrint + ", useStderrOnEmptyStdout=" + useStderrOnEmptyStdout + "]";
- }
-
- private <T> List<T> unmodifiableOrEmptyList(List<T> list) {
- return Collections.unmodifiableList(list == null ? new ArrayList<T>() : list);
- }
-
-}
+/**
+ * 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.exec;
+
+import java.io.File;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import static org.apache.camel.util.ObjectHelper.notNull;
+
+/**
+ * Value object that describes the command to be executed.
+ */
+public class ExecCommand implements Serializable {
+
+ private static final long serialVersionUID = 1755094616849607573L;
+
+ /**
+ * @see ExecBinding#EXEC_COMMAND_EXECUTABLE
+ */
+ private final String executable;
+
+ /**
+ * @see ExecBinding#EXEC_COMMAND_ARGS
+ */
+ private final List<String> args;
+
+ /**
+ * @see ExecBinding#EXEC_COMMAND_WORKING_DIR
+ */
+ private final String workingDir;
+
+ /**
+ * @see ExecBinding#EXEC_COMMAND_TIMEOUT
+ */
+ private final long timeout;
+
+ /**
+ * @see ExecBinding#EXEC_COMMAND_OUT_FILE
+ */
+ private final File outFile;
+
+ /**
+ * The input of the executable
+ */
+ private final InputStream input;
+
+ private final boolean useStderrOnEmptyStdout;
+
+ public ExecCommand(String executable, List<String> args, String workingDir, Long timeout,
+ InputStream input, File outFile, boolean useStderrOnEmptyStdout) {
+ notNull(executable, "command executable");
+ this.executable = executable;
+ this.args = unmodifiableOrEmptyList(args);
+ this.workingDir = workingDir;
+ this.timeout = timeout;
+ this.input = input;
+ this.outFile = outFile;
+ this.useStderrOnEmptyStdout = useStderrOnEmptyStdout;
+ }
+
+ public List<String> getArgs() {
+ return args;
+ }
+
+ public String getExecutable() {
+ return executable;
+ }
+
+ public InputStream getInput() {
+ return input;
+ }
+
+ public File getOutFile() {
+ return outFile;
+ }
+
+ public long getTimeout() {
+ return timeout;
+ }
+
+ public String getWorkingDir() {
+ return workingDir;
+ }
+
+ public boolean isUseStderrOnEmptyStdout() {
+ return useStderrOnEmptyStdout;
+ }
+
+ @Override
+ public String toString() {
+ String dirToPrint = workingDir == null ? "null" : workingDir;
+ String outFileToPrint = outFile == null ? "null" : outFile.getPath();
+ return "ExecCommand [args=" + args + ", executable=" + executable + ", timeout=" + timeout + ", outFile="
+ + outFileToPrint + ", workingDir=" + dirToPrint + ", useStderrOnEmptyStdout=" + useStderrOnEmptyStdout + "]";
+ }
+
+ private <T> List<T> unmodifiableOrEmptyList(List<T> list) {
+ return Collections.unmodifiableList(list == null ? new ArrayList<T>() : list);
+ }
+
+}
Propchange: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommandExecutor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommandExecutor.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommandExecutor.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommandExecutor.java Fri Dec 2 17:03:07 2011
@@ -1,38 +1,38 @@
-/**
- * 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.exec;
-
-import java.io.IOException;
-
-/**
- * Executes {@link ExecCommand} instances.
- */
-public interface ExecCommandExecutor {
-
- /**
- * Executes the <code>command</code> and returns a not-<code>null</code>
- * {@link ExecResult} instance.
- *
- * @param execCommand The command object, that describes the executable application
- * @return the result
- * @throws ExecException if the execution failed
- * @throws IOException if there is an invalid path in the working directory,
- * or if the absolute path of the command executable is invalid,
- * or if the executable does not exist
- */
- ExecResult execute(ExecCommand execCommand) throws ExecException, IOException;
-}
+/**
+ * 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.exec;
+
+import java.io.IOException;
+
+/**
+ * Executes {@link ExecCommand} instances.
+ */
+public interface ExecCommandExecutor {
+
+ /**
+ * Executes the <code>command</code> and returns a not-<code>null</code>
+ * {@link ExecResult} instance.
+ *
+ * @param execCommand The command object, that describes the executable application
+ * @return the result
+ * @throws ExecException if the execution failed
+ * @throws IOException if there is an invalid path in the working directory,
+ * or if the absolute path of the command executable is invalid,
+ * or if the executable does not exist
+ */
+ ExecResult execute(ExecCommand execCommand) throws ExecException, IOException;
+}
Propchange: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecCommandExecutor.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecComponent.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecComponent.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecComponent.java Fri Dec 2 17:03:07 2011
@@ -1,38 +1,38 @@
-/**
- * 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.exec;
-
-import java.net.URLDecoder;
-import java.util.Map;
-
-import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
-
-/**
- * Represents the component that manages {@link ExecEndpoint}. With the
- * component it is possible to execute system commands.
- */
-public class ExecComponent extends DefaultComponent {
-
- @Override
- protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
- ExecEndpoint endpoint = new ExecEndpoint(uri, this);
- setProperties(endpoint, parameters);
- endpoint.setExecutable(URLDecoder.decode(remaining, "UTF-8"));
- return endpoint;
- }
-}
+/**
+ * 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.exec;
+
+import java.net.URLDecoder;
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.impl.DefaultComponent;
+
+/**
+ * Represents the component that manages {@link ExecEndpoint}. With the
+ * component it is possible to execute system commands.
+ */
+public class ExecComponent extends DefaultComponent {
+
+ @Override
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ ExecEndpoint endpoint = new ExecEndpoint(uri, this);
+ setProperties(endpoint, parameters);
+ endpoint.setExecutable(URLDecoder.decode(remaining, "UTF-8"));
+ return endpoint;
+ }
+}
Propchange: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecComponent.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java?rev=1209585&r1=1209584&r2=1209585&view=diff
==============================================================================
--- camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java (original)
+++ camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java Fri Dec 2 17:03:07 2011
@@ -1,222 +1,222 @@
-/**
- * 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.exec;
-
-import org.apache.camel.Consumer;
-import org.apache.camel.Processor;
-import org.apache.camel.Producer;
-import org.apache.camel.component.exec.impl.DefaultExecBinding;
-import org.apache.camel.component.exec.impl.DefaultExecCommandExecutor;
-import org.apache.camel.component.exec.impl.ExecParseUtils;
-import org.apache.camel.impl.DefaultEndpoint;
-import org.apache.camel.util.ObjectHelper;
-
-/**
- * The endpoint utilizes an {@link ExecCommandExecutor} to execute a system
- * command when it receives message exchanges.
- *
- * @see ExecBinding
- * @see ExecCommandExecutor
- * @see ExecCommand
- * @see ExecResult
- */
-public class ExecEndpoint extends DefaultEndpoint {
-
- /**
- * Indicates that no {@link #timeout} is used.
- */
- public static final long NO_TIMEOUT = Long.MAX_VALUE;
-
- private String executable;
-
- private String args;
-
- private String workingDir;
-
- private long timeout;
-
- private String outFile;
-
- private ExecCommandExecutor commandExecutor;
-
- private ExecBinding binding;
-
- private boolean useStderrOnEmptyStdout;
-
- public ExecEndpoint(String uri, ExecComponent component) {
- super(uri, component);
- this.timeout = NO_TIMEOUT;
- this.binding = new DefaultExecBinding();
- this.commandExecutor = new DefaultExecCommandExecutor();
- }
-
- public Producer createProducer() throws Exception {
- return new ExecProducer(this);
- }
-
- public Consumer createConsumer(Processor processor) throws Exception {
- throw new UnsupportedOperationException("Consumer not supported for ExecEndpoint!");
- }
-
- public boolean isSingleton() {
- return true;
- }
-
- /**
- * @return the executable to be executed; that is the remaining part of the
- * endpoint URI
- * @see ExecBinding#EXEC_COMMAND_EXECUTABLE
- */
- public String getExecutable() {
- return executable;
- }
-
- /**
- * Sets the executable to be executed. The executable must not be empty or
- * <code>null</code>.
- *
- * @param executable Sets the executable to be executed.
- */
- public void setExecutable(String executable) {
- ObjectHelper.notEmpty(executable, "executable");
- this.executable = executable;
- }
-
- /**
- * The arguments may be one or many whitespace-separated tokens, that can be
- * quoted with ", e.g. <code>args="arg 1" arg2"</code> will use two arguments
- * <code>arg 1</code> and <code>arg2</code>. To include the quotes use
- * <code>""</code><br>
- * , e.g. <code>args=""arg 1"" arg2</code> will use the arguments
- * <code>"arg 1"</code> and <code>arg2</code>.
- *
- * @return the arguments of the executable application, as configured from
- * the endpoint URI.
- * @see ExecBinding#EXEC_COMMAND_ARGS
- * @see ExecParseUtils#splitToWhiteSpaceSeparatedTokens(String)
- */
- public String getArgs() {
- return args;
- }
-
- /**
- * Sets the arguments of the executable application
- *
- * @param args Returns <code>null</code> value if no arguments are
- * configured in the endpoint URI
- * @see #getArgs()
- * @see ExecBinding#EXEC_COMMAND_ARGS
- */
- public void setArgs(String args) {
- this.args = args;
- }
-
- /**
- * @return the working directory of the executable, or <code>null</code> is
- * such is not set.
- * @see ExecBinding#EXEC_COMMAND_WORKING_DIR
- */
- public String getWorkingDir() {
- return workingDir;
- }
-
- /**
- * Sets the working directory of the executable.
- *
- * @param dir the working directory of the executable. <code>null</code>
- * values indicates that the current working directory will be
- * used.
- */
- public void setWorkingDir(String dir) {
- this.workingDir = dir;
- }
-
- /**
- * @return The returned value is always a positive <code>long</code>. The
- * default value is {@link ExecEndpoint#NO_TIMEOUT}
- * @see ExecBinding#EXEC_COMMAND_TIMEOUT
- */
- public long getTimeout() {
- return timeout;
- }
-
- /**
- * Sets the timeout.
- *
- * @param timeout The <code>timeout</code> must be a positive long
- * @see ExecBinding#EXEC_COMMAND_TIMEOUT
- */
- public void setTimeout(long timeout) {
- if (timeout <= 0) {
- throw new IllegalArgumentException("The timeout must be a positive long!");
- }
- this.timeout = timeout;
- }
-
- /**
- * @return <code>null</code> if no out file is set, otherwise returns the
- * value of the outFile
- * @see ExecBinding#EXEC_COMMAND_OUT_FILE
- */
- public String getOutFile() {
- return outFile;
- }
-
- /**
- * @param outFile a not-empty file path
- * @see ExecBinding#EXEC_COMMAND_OUT_FILE
- */
- public void setOutFile(String outFile) {
- ObjectHelper.notEmpty(outFile, "outFile");
- this.outFile = outFile;
- }
-
- /**
- * @return The command executor used to execute commands. Defaults to
- * {@link org.apache.camel.component.exec.impl.DefaultExecCommandExecutor}
- */
- public ExecCommandExecutor getCommandExecutor() {
- return commandExecutor;
- }
-
- /**
- * Sets a custom executor to execute commands.
- *
- * @param commandExecutor a not-null instance of {@link ExecCommandExecutor}
- */
- public void setCommandExecutor(ExecCommandExecutor commandExecutor) {
- ObjectHelper.notNull(commandExecutor, "commandExecutor");
- this.commandExecutor = commandExecutor;
- }
-
- public ExecBinding getBinding() {
- return binding;
- }
-
- public void setBinding(ExecBinding binding) {
- ObjectHelper.notNull(binding, "binding");
- this.binding = binding;
- }
-
- public boolean isUseStderrOnEmptyStdout() {
- return useStderrOnEmptyStdout;
- }
-
- public void setUseStderrOnEmptyStdout(boolean useStderrOnEmptyStdout) {
- this.useStderrOnEmptyStdout = useStderrOnEmptyStdout;
- }
-}
+/**
+ * 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.exec;
+
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.component.exec.impl.DefaultExecBinding;
+import org.apache.camel.component.exec.impl.DefaultExecCommandExecutor;
+import org.apache.camel.component.exec.impl.ExecParseUtils;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.util.ObjectHelper;
+
+/**
+ * The endpoint utilizes an {@link ExecCommandExecutor} to execute a system
+ * command when it receives message exchanges.
+ *
+ * @see ExecBinding
+ * @see ExecCommandExecutor
+ * @see ExecCommand
+ * @see ExecResult
+ */
+public class ExecEndpoint extends DefaultEndpoint {
+
+ /**
+ * Indicates that no {@link #timeout} is used.
+ */
+ public static final long NO_TIMEOUT = Long.MAX_VALUE;
+
+ private String executable;
+
+ private String args;
+
+ private String workingDir;
+
+ private long timeout;
+
+ private String outFile;
+
+ private ExecCommandExecutor commandExecutor;
+
+ private ExecBinding binding;
+
+ private boolean useStderrOnEmptyStdout;
+
+ public ExecEndpoint(String uri, ExecComponent component) {
+ super(uri, component);
+ this.timeout = NO_TIMEOUT;
+ this.binding = new DefaultExecBinding();
+ this.commandExecutor = new DefaultExecCommandExecutor();
+ }
+
+ public Producer createProducer() throws Exception {
+ return new ExecProducer(this);
+ }
+
+ public Consumer createConsumer(Processor processor) throws Exception {
+ throw new UnsupportedOperationException("Consumer not supported for ExecEndpoint!");
+ }
+
+ public boolean isSingleton() {
+ return true;
+ }
+
+ /**
+ * @return the executable to be executed; that is the remaining part of the
+ * endpoint URI
+ * @see ExecBinding#EXEC_COMMAND_EXECUTABLE
+ */
+ public String getExecutable() {
+ return executable;
+ }
+
+ /**
+ * Sets the executable to be executed. The executable must not be empty or
+ * <code>null</code>.
+ *
+ * @param executable Sets the executable to be executed.
+ */
+ public void setExecutable(String executable) {
+ ObjectHelper.notEmpty(executable, "executable");
+ this.executable = executable;
+ }
+
+ /**
+ * The arguments may be one or many whitespace-separated tokens, that can be
+ * quoted with ", e.g. <code>args="arg 1" arg2"</code> will use two arguments
+ * <code>arg 1</code> and <code>arg2</code>. To include the quotes use
+ * <code>""</code><br>
+ * , e.g. <code>args=""arg 1"" arg2</code> will use the arguments
+ * <code>"arg 1"</code> and <code>arg2</code>.
+ *
+ * @return the arguments of the executable application, as configured from
+ * the endpoint URI.
+ * @see ExecBinding#EXEC_COMMAND_ARGS
+ * @see ExecParseUtils#splitToWhiteSpaceSeparatedTokens(String)
+ */
+ public String getArgs() {
+ return args;
+ }
+
+ /**
+ * Sets the arguments of the executable application
+ *
+ * @param args Returns <code>null</code> value if no arguments are
+ * configured in the endpoint URI
+ * @see #getArgs()
+ * @see ExecBinding#EXEC_COMMAND_ARGS
+ */
+ public void setArgs(String args) {
+ this.args = args;
+ }
+
+ /**
+ * @return the working directory of the executable, or <code>null</code> is
+ * such is not set.
+ * @see ExecBinding#EXEC_COMMAND_WORKING_DIR
+ */
+ public String getWorkingDir() {
+ return workingDir;
+ }
+
+ /**
+ * Sets the working directory of the executable.
+ *
+ * @param dir the working directory of the executable. <code>null</code>
+ * values indicates that the current working directory will be
+ * used.
+ */
+ public void setWorkingDir(String dir) {
+ this.workingDir = dir;
+ }
+
+ /**
+ * @return The returned value is always a positive <code>long</code>. The
+ * default value is {@link ExecEndpoint#NO_TIMEOUT}
+ * @see ExecBinding#EXEC_COMMAND_TIMEOUT
+ */
+ public long getTimeout() {
+ return timeout;
+ }
+
+ /**
+ * Sets the timeout.
+ *
+ * @param timeout The <code>timeout</code> must be a positive long
+ * @see ExecBinding#EXEC_COMMAND_TIMEOUT
+ */
+ public void setTimeout(long timeout) {
+ if (timeout <= 0) {
+ throw new IllegalArgumentException("The timeout must be a positive long!");
+ }
+ this.timeout = timeout;
+ }
+
+ /**
+ * @return <code>null</code> if no out file is set, otherwise returns the
+ * value of the outFile
+ * @see ExecBinding#EXEC_COMMAND_OUT_FILE
+ */
+ public String getOutFile() {
+ return outFile;
+ }
+
+ /**
+ * @param outFile a not-empty file path
+ * @see ExecBinding#EXEC_COMMAND_OUT_FILE
+ */
+ public void setOutFile(String outFile) {
+ ObjectHelper.notEmpty(outFile, "outFile");
+ this.outFile = outFile;
+ }
+
+ /**
+ * @return The command executor used to execute commands. Defaults to
+ * {@link org.apache.camel.component.exec.impl.DefaultExecCommandExecutor}
+ */
+ public ExecCommandExecutor getCommandExecutor() {
+ return commandExecutor;
+ }
+
+ /**
+ * Sets a custom executor to execute commands.
+ *
+ * @param commandExecutor a not-null instance of {@link ExecCommandExecutor}
+ */
+ public void setCommandExecutor(ExecCommandExecutor commandExecutor) {
+ ObjectHelper.notNull(commandExecutor, "commandExecutor");
+ this.commandExecutor = commandExecutor;
+ }
+
+ public ExecBinding getBinding() {
+ return binding;
+ }
+
+ public void setBinding(ExecBinding binding) {
+ ObjectHelper.notNull(binding, "binding");
+ this.binding = binding;
+ }
+
+ public boolean isUseStderrOnEmptyStdout() {
+ return useStderrOnEmptyStdout;
+ }
+
+ public void setUseStderrOnEmptyStdout(boolean useStderrOnEmptyStdout) {
+ this.useStderrOnEmptyStdout = useStderrOnEmptyStdout;
+ }
+}
Propchange: camel/trunk/components/camel-exec/src/main/java/org/apache/camel/component/exec/ExecEndpoint.java
------------------------------------------------------------------------------
svn:eol-style = native