camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r603611 - in /activemq/camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/transport/spring/ test/resources/ test/resources/org/apache/camel/component/cxf/transport/
Date Wed, 12 Dec 2007 13:36:02 GMT
Author: hadrian
Date: Wed Dec 12 05:36:00 2007
New Revision: 603611

URL: http://svn.apache.org/viewvc?rev=603611&view=rev
Log:
New files missed from patch to CAMEL-258.

Added:
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties   (with
props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml
  (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml
  (with props)

Added: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,68 @@
+/**
+ * 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.transport.spring;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+
+public class AbstractCamelContextBeanDefinitionParser extends AbstractBeanDefinitionParser
{
+    private static final String DEFAULT_CAMEL_CONTEXT_NAME = "camelContext";
+    
+    private String getContextId(String contextId) {
+        if (ObjectHelper.isNullOrBlank(contextId)) {
+            //set the contextId default value here
+            return DEFAULT_CAMEL_CONTEXT_NAME;                        
+        } else {
+            return contextId;
+        }
+    }
+    
+    protected void wireCamelContext(BeanDefinitionBuilder bean, String camelContextId) {
+        bean.addPropertyReference("camelContext", camelContextId);
+    }
+    
+    protected void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean)
{
+        // paser the id attribute
+        bean.setAbstract(true);
+        NodeList children = element.getChildNodes();
+        for (int i = 0; i < children.getLength(); i++) {
+            Node n = children.item(i);
+            if (n.getNodeType() == Node.ELEMENT_NODE) {
+                String name = n.getLocalName();
+                if ("camelContext".equals(name)) {
+                    // paraser the camel context
+                    BeanDefinition bd = ctx.getDelegate().parseCustomElement((Element)n);
+                    // get the inner camel context id
+                    String contextId = (String)bd.getPropertyValues().getPropertyValue("id").getValue();
                   
+                    bean.addPropertyReference("camelContext", getContextId(contextId)); 
                 
+                } else if ("camelContextRef".equals(name)){
+                    String contextId = n.getTextContent();                    
+                    bean.addPropertyReference("camelContext", getContextId(contextId));
+                } 
+            }
+        }    
+    }   
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/AbstractCamelContextBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,43 @@
+/**
+ * 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.transport.spring;
+
+import org.w3c.dom.Element;
+
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.apache.camel.component.cxf.transport.CamelConduit;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+
+public class CamelConduitDefinitionParser extends AbstractCamelContextBeanDefinitionParser
{
+        
+    public CamelConduitDefinitionParser() {
+        super();
+        setBeanClass(CamelConduit.class);
+    }
+       
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelConduitDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,35 @@
+/**
+ * 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.transport.spring;
+
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+
+import org.w3c.dom.Element;
+
+import org.apache.camel.component.cxf.transport.CamelConduit;
+import org.apache.camel.component.cxf.transport.CamelDestination;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+
+public class CamelDestinationDefinitionParser extends AbstractCamelContextBeanDefinitionParser
{
+    public CamelDestinationDefinitionParser() {
+        super();
+        setBeanClass(CamelDestination.class);
+    }  
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/CamelDestinationDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,29 @@
+/**
+ * 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.transport.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport{
+    public void init() {
+        registerBeanDefinitionParser("conduit", new CamelConduitDefinitionParser());
+        registerBeanDefinitionParser("destination", new CamelDestinationDefinitionParser());
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/transport/spring/NamespaceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties Wed Dec
12 05:36:00 2007
@@ -0,0 +1,74 @@
+#
+#
+#    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.
+#
+#
+############################################################
+#  	Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.  
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the INFO and above levels.
+#handlers= java.util.logging.ConsoleHandler
+
+# To also add the FileHandler, use the following line instead.
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overriden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to INFO and above.
+java.util.logging.ConsoleHandler.level = WARNING
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#com.xyz.foo.level = SEVERE

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/logging.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://cxf.apache.org/transports/camel"         
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
+       http://activemq.apache.org/camel/schema/cxfEndpoint http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+    
+   <camelContext id="conduit_context" xmlns="http://activemq.apache.org/camel/schema/spring">
+       <route>
+      	   <from uri="direct:EndpointA" />
+      	   <to uri="direct:EndpointB" /> 
+       </route>
+   </camelContext>
+ 
+   <camel:conduit name="{http://activemq.apache.org/camel-test}portA.camel-conduit">
+       <camel:camelContextRef>conduit_context</camel:camelContextRef>
+   </camel:conduit>
+   
+    <camel:conduit name="{http://activemq.apache.org/camel-test}portB.camel-conduit">
+       <camelContext id="context" xmlns="http://activemq.apache.org/camel/schema/spring">
+         <route>
+      	   <from uri="direct:EndpointC" />
+      	   <to uri="direct:EndpointD" /> 
+         </route>
+   	   </camelContext>
+   </camel:conduit>    
+ 
+</beans>
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelConduit.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml?rev=603611&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml
(added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml
Wed Dec 12 05:36:00 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:camel="http://cxf.apache.org/transports/camel"         
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd
+       http://activemq.apache.org/camel/schema/cxfEndpoint http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+    
+    
+   <camel:destination name="{http://activemq.apache.org/camel-test}port.camel-destination">
+        <camelContext id="dest_context" xmlns="http://activemq.apache.org/camel/schema/spring">
+    	  <route>
+      		<from uri="direct:EndpointA" />
+      		<to uri="direct:EndpointB" /> 
+    	  </route>
+    	  <route>
+    	    <from uri="direct:EndpointC" />
+    	    <to uri="mock:EndpiontB" />
+    	  </route>
+        </camelContext> 
+   </camel:destination>
+
+</beans>
\ No newline at end of file

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/transport/CamelDestination.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message