[jboss-svn-commits] JBL Code SVN: r33942 - labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jul 16 08:51:08 EDT 2010


Author: mark.proctor at jboss.com
Date: 2010-07-16 08:51:08 -0400 (Fri, 16 Jul 2010)
New Revision: 33942

Added:
   labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/beans.xml
   labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/camel.xml
   labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/knowledge-services.xml
   labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/test.drl
   labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/web.xml
Log:
JBRULES-2347 Camel
-migrating drools-server to camel

Copied: labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/beans.xml (from rev 33939, labs/jbossrules/trunk/drools-server/drools-server-app/src/main/resources/WEB-INF/beans.xml)
===================================================================
--- labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/beans.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/beans.xml	2010-07-16 12:51:08 UTC (rev 33942)
@@ -0,0 +1,33 @@
+<?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:context="http://www.springframework.org/schema/context"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"
+    default-autowire="byName">
+
+
+	<!-- loads the kbases and ksessions into the ApplicationContext -->
+	<import resource="classpath:services-test.xml" />
+	
+	<!-- Builds the routes that makes the ksessesions available as services -->
+	<import resource="classpath:knowledge-services.xml" />
+
+
+</beans>
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/camel.xml (from rev 33939, labs/jbossrules/trunk/drools-server/drools-server-app/src/main/resources/WEB-INF/camel.xml)
===================================================================
--- labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/camel.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/camel.xml	2010-07-16 12:51:08 UTC (rev 33942)
@@ -0,0 +1,64 @@
+<?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:cxf="http://camel.apache.org/schema/cxf"
+       xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
+       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!--
+   !   Define the server end point.
+   !   Copy and paste this element, changing id and the path for the address to expose services on different urls.
+   !   Different Camel routes can handle different end point paths.
+    --> 
+  <cxf:rsServer id="rsServer"  
+                address="/"
+                serviceClass="org.drools.jax.rs.CommandExecutorImpl">
+       <cxf:providers>
+           <bean class="org.drools.jax.rs.CommandMessageBodyReader"/>
+       </cxf:providers>
+  </cxf:rsServer>  
+  
+  <!-- Leave this, as it's needed to make Camel "drools" aware -->
+  <bean id="droolsPolicy" class="org.drools.camel.component.DroolsPolicy" />  
+    
+  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+    
+    <!-- 
+     ! Routes incoming messages from end point id="rsServer"
+     ! Example route unmarshals the messages with xstream and executes against ksession1
+     ! Copy and paste this element, changing marsalls and the to uri, to target different sessions, as needed
+     !-->
+     
+    <route>
+       <from uri="cxfrs://bean://rsServer"/>
+       <policy ref="droolsPolicy">
+	       <unmarshal ref="xstream" />       
+	       <to uri="drools:node1/ksession1" />
+	       <marshal ref="xstream" />
+       </policy>
+    </route>    
+        
+  </camelContext>
+  
+</beans>

Copied: labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/knowledge-services.xml (from rev 33939, labs/jbossrules/trunk/drools-server/drools-server-app/src/main/resources/WEB-INF/knowledge-services.xml)
===================================================================
--- labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/knowledge-services.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/knowledge-services.xml	2010-07-16 12:51:08 UTC (rev 33942)
@@ -0,0 +1,35 @@
+<?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:drools="http://drools.org/schema/drools-spring"       
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://drools.org/schema/drools-spring http://drools.org/schema/drools-spring.xsd">
+	
+	<drools:execution-node id="node1" />
+
+	<drools:kbase id="kbase1" node="node1">
+	    <drools:resources>
+            <drools:resource  type="DRL" source="classpath:test.drl"/>
+		</drools:resources>						
+	</drools:kbase>
+	
+	<drools:ksession id="ksession1" type="stateless" kbase="kbase1" node="node1"/>	
+
+</beans>
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/test.drl (from rev 33939, labs/jbossrules/trunk/drools-server/drools-server-app/src/main/resources/WEB-INF/test.drl)
===================================================================
--- labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/test.drl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/test.drl	2010-07-16 12:51:08 UTC (rev 33942)
@@ -0,0 +1,13 @@
+package  org.test
+
+declare Message
+    text : String
+end
+    
+
+rule "echo" dialect "mvel"
+when
+    $m : Message();
+then
+    $m.text = "echo:" + $m.text;
+end
\ No newline at end of file

Copied: labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/web.xml (from rev 33892, labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/web.xml)
===================================================================
--- labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossrules/trunk/drools-server/drools-server-app/src/main/webapp/WEB-INF/web.xml	2010-07-16 12:51:08 UTC (rev 33942)
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+	<display-name>JBoss Drools Execution Server</display-name>
+
+	<context-param>
+		<param-name>contextConfigLocation</param-name>
+		<param-value>/WEB-INF/configuration.xml</param-value>
+	</context-param>
+	
+	<listener>
+		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+	</listener>
+	
+	<servlet>
+		<servlet-name>CXFServlet</servlet-name>
+		<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+	</servlet>
+	
+	<servlet-mapping>
+		<servlet-name>CXFServlet</servlet-name>
+		<url-pattern>/services/*</url-pattern>
+	</servlet-mapping>
+
+	<session-config>
+		<session-timeout>10</session-timeout>
+	</session-config>
+
+</web-app>



More information about the jboss-svn-commits mailing list