You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2010/05/28 10:43:45 UTC

svn commit: r949131 - in /camel/trunk/components: camel-osgi/src/main/java/org/apache/camel/osgi/ camel-spring/src/main/java/org/apache/camel/spring/

Author: gnodet
Date: Fri May 28 08:43:44 2010
New Revision: 949131

URL: http://svn.apache.org/viewvc?rev=949131&view=rev
Log:
CAMEL-2702: Extract base classes for camel-spring into a new module so that they can be shared with camel-blueprint

Added:
    camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/package-info.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java
    camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerType.java

Added: camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/package-info.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/package-info.java?rev=949131&view=auto
==============================================================================
--- camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/package-info.java (added)
+++ camel/trunk/components/camel-osgi/src/main/java/org/apache/camel/osgi/package-info.java Fri May 28 08:43:44 2010
@@ -0,0 +1,18 @@
+/**
+ * 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.
+ */
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://camel.apache.org/schema/osgi", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.camel.osgi;

Added: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java?rev=949131&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java (added)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerDefinition.java Fri May 28 08:43:44 2010
@@ -0,0 +1,55 @@
+/**
+ * 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.spring;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.model.IdentifiedType;
+import org.apache.camel.model.RedeliveryPolicyDefinition;
+
+/**
+ * The <errorHandler> tag element.
+ *
+ * @version $Revision: 938746 $
+ */
+@XmlRootElement(name = "errorHandler")
+@XmlAccessorType(XmlAccessType.FIELD)
+@SuppressWarnings("unused")
+public class ErrorHandlerDefinition extends IdentifiedType {    
+    @XmlAttribute
+    private ErrorHandlerType type = ErrorHandlerType.DefaultErrorHandler;
+    @XmlAttribute
+    private String deadLetterUri;
+    @XmlAttribute
+    private LoggingLevel level = LoggingLevel.ERROR;
+    @XmlAttribute
+    private Boolean useOriginalMessage;
+    @XmlAttribute
+    private String transactionTemplateRef;
+    @XmlAttribute
+    private String transactionManagerRef;
+    @XmlAttribute
+    private String onRedeliveryRef;
+    @XmlElement
+    private RedeliveryPolicyDefinition redeliveryPolicy;
+   
+}

Added: camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerType.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerType.java?rev=949131&view=auto
==============================================================================
--- camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerType.java (added)
+++ camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/ErrorHandlerType.java Fri May 28 08:43:44 2010
@@ -0,0 +1,61 @@
+/**
+ * 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.spring;
+
+import javax.xml.bind.annotation.XmlEnum;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.camel.builder.DeadLetterChannelBuilder;
+import org.apache.camel.builder.DefaultErrorHandlerBuilder;
+import org.apache.camel.builder.LoggingErrorHandlerBuilder;
+import org.apache.camel.builder.NoErrorHandlerBuilder;
+import org.apache.camel.spring.spi.TransactionErrorHandlerBuilder;
+
+/**
+ * Used to configure the errorHandler type
+ *
+ * @version $Revision: 932938 $
+ */
+@XmlType
+@XmlEnum(String.class)
+public enum ErrorHandlerType {
+
+    DefaultErrorHandler, DeadLetterChannel, LoggingErrorHandler, NoErrorHandler, TransactionErrorHandler;
+
+    /**
+     * Get the type as class.
+     *
+     * @return the class which represents the selected type.
+     */
+    public Class getTypeAsClass() {
+        switch (this) {
+        case DefaultErrorHandler:
+            return DefaultErrorHandlerBuilder.class;
+        case DeadLetterChannel:
+            return DeadLetterChannelBuilder.class;
+        case LoggingErrorHandler:
+            return LoggingErrorHandlerBuilder.class;
+        case NoErrorHandler:
+            return NoErrorHandlerBuilder.class;
+        case TransactionErrorHandler:
+            return TransactionErrorHandlerBuilder.class;
+        default:
+            throw new IllegalArgumentException("Unknown error handler: " + this);
+        }
+    }
+
+}