You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by pd...@apache.org on 2006/10/03 23:21:31 UTC

svn commit: r452627 - in /incubator/servicemix/trunk/servicemix-script: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/servicemix/ src/main/java/org/apache/servicemix/script/ src/test/ src/test/ja...

Author: pdodds
Date: Tue Oct  3 14:21:30 2006
New Revision: 452627

URL: http://svn.apache.org/viewvc?view=rev&rev=452627
Log:
Initial cut at full JBI component scripting service engine

Added:
    incubator/servicemix/trunk/servicemix-script/   (with props)
    incubator/servicemix/trunk/servicemix-script/pom.xml
    incubator/servicemix/trunk/servicemix-script/src/
    incubator/servicemix/trunk/servicemix-script/src/main/
    incubator/servicemix/trunk/servicemix-script/src/main/java/
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptComponent.java
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessor.java
    incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessorEndpoint.java
    incubator/servicemix/trunk/servicemix-script/src/test/
    incubator/servicemix/trunk/servicemix-script/src/test/java/
    incubator/servicemix/trunk/servicemix-script/src/test/java/org/
    incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/
    incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/
    incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/
    incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/ScriptComponentTest.java
    incubator/servicemix/trunk/servicemix-script/src/test/resources/
    incubator/servicemix/trunk/servicemix-script/src/test/resources/GroovyExchangeProcessor.groovy
    incubator/servicemix/trunk/servicemix-script/src/test/resources/RubyExchangeProcessor.rb
    incubator/servicemix/trunk/servicemix-script/src/test/resources/log4j.properties
    incubator/servicemix/trunk/servicemix-script/src/test/resources/spring.xml

Propchange: incubator/servicemix/trunk/servicemix-script/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct  3 14:21:30 2006
@@ -0,0 +1 @@
+target

Added: incubator/servicemix/trunk/servicemix-script/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/pom.xml?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/pom.xml (added)
+++ incubator/servicemix/trunk/servicemix-script/pom.xml Tue Oct  3 14:21:30 2006
@@ -0,0 +1,98 @@
+<?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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.apache.servicemix</groupId>
+    <artifactId>servicemix</artifactId>
+    <version>3.1-incubating-SNAPSHOT</version>
+  </parent>
+  
+  <groupId>org.apache.servicemix</groupId>
+  <artifactId>servicemix-script</artifactId>
+  <packaging>jbi-component</packaging>
+  
+  <name>ServiceMix :: Scripting Service Engine</name>    
+	
+  <dependencies>
+  
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-shared</artifactId>           
+    </dependency>
+    <dependency>
+      <groupId>org.apache.servicemix</groupId>
+      <artifactId>servicemix-core</artifactId>      
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring</artifactId>      
+    </dependency>
+    <dependency>
+      <groupId>groovy</groupId>
+      <artifactId>groovy-all-1.0-jsr</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <!-- <dependency>
+      <groupId>org.jruby</groupId>
+      <artifactId>jruby</artifactId>
+      <version>0.8.9</version>
+    </dependency> -->
+    
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.servicemix.tooling</groupId>
+        <artifactId>jbi-maven-plugin</artifactId>   
+        <version>${servicemix-version}</version>     
+        <extensions>true</extensions>
+        <configuration>
+          <type>service-engine</type>
+          <component>org.apache.servicemix.MyComponent</component>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.xbean</groupId>
+        <artifactId>maven-xbean-plugin</artifactId>
+        <version>${xbean-version}</version>
+        <executions>
+          <execution>
+            <configuration>
+              <namespace>http://org.apache.servicemix/script/1.0</namespace>
+            </configuration>
+            <goals>
+              <goal>mapping</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptComponent.java?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptComponent.java (added)
+++ incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptComponent.java Tue Oct  3 14:21:30 2006
@@ -0,0 +1,31 @@
+/*
+ * 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.servicemix.script;
+
+import org.apache.servicemix.common.DefaultComponent;
+
+/**
+ * @org.apache.xbean.XBean element="component"
+ *                  description="ServiceMix Scripting Component"
+ */
+public class ScriptComponent extends DefaultComponent {
+
+    protected Class[] getEndpointClasses() {
+        return new Class[] { ScriptExchangeProcessorEndpoint.class };
+    }
+
+}

Added: incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessor.java?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessor.java (added)
+++ incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessor.java Tue Oct  3 14:21:30 2006
@@ -0,0 +1,34 @@
+package org.apache.servicemix.script;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+
+import org.apache.servicemix.common.ExchangeProcessor;
+
+public abstract class ScriptExchangeProcessor implements ExchangeProcessor {
+
+	private ScriptExchangeProcessorEndpoint endpoint;
+
+	protected void setScriptExchangeProcessorEndpoint(
+			ScriptExchangeProcessorEndpoint endpoint) {
+		this.endpoint = endpoint;
+	}
+
+	public void fail(MessageExchange exchange, String error)
+			throws MessagingException {
+		endpoint.fail(exchange, new Exception(error));
+	}
+
+	public void fail(MessageExchange exchange, Exception exception)
+			throws MessagingException {
+		endpoint.fail(exchange, exception);
+	}
+
+	public void done(MessageExchange exchange) throws MessagingException {
+		endpoint.done(exchange);
+	}
+	
+	public void send(MessageExchange exchange) throws MessagingException {
+		endpoint.send(exchange);
+	}
+}

Added: incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessorEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessorEndpoint.java?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessorEndpoint.java (added)
+++ incubator/servicemix/trunk/servicemix-script/src/main/java/org/apache/servicemix/script/ScriptExchangeProcessorEndpoint.java Tue Oct  3 14:21:30 2006
@@ -0,0 +1,137 @@
+/*
+ * 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.servicemix.script;
+
+import javax.jbi.component.ComponentContext;
+import javax.jbi.management.DeploymentException;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessageExchangeFactory;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.MessageExchange.Role;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.jbi.servicedesc.ServiceEndpoint;
+
+import org.apache.servicemix.common.BaseLifeCycle;
+import org.apache.servicemix.common.Endpoint;
+import org.apache.servicemix.common.ExchangeProcessor;
+
+/**
+ * @org.apache.xbean.XBean element="exchangeProcessor"
+ */
+public class ScriptExchangeProcessorEndpoint extends Endpoint implements
+		ExchangeProcessor {
+
+	private ServiceEndpoint activated;
+
+	private DeliveryChannel channel;
+
+	private MessageExchangeFactory exchangeFactory;
+
+	private ScriptExchangeProcessor script;
+
+	public void activate() throws Exception {
+		logger = this.serviceUnit.getComponent().getLogger();
+		ComponentContext ctx = getServiceUnit().getComponent()
+				.getComponentContext();
+		channel = ctx.getDeliveryChannel();
+		exchangeFactory = channel.createExchangeFactory();
+		activated = ctx.activateEndpoint(service, endpoint);
+		start();
+	}
+
+	public void deactivate() throws Exception {
+		stop();
+		ServiceEndpoint ep = activated;
+		activated = null;
+		ComponentContext ctx = getServiceUnit().getComponent()
+				.getComponentContext();
+		ctx.deactivateEndpoint(ep);
+	}
+
+	protected void done(MessageExchange me) throws MessagingException {
+		me.setStatus(ExchangeStatus.DONE);
+		send(me);
+	}
+
+	protected void fail(MessageExchange me, Exception error)
+			throws MessagingException {
+		me.setError(error);
+		send(me);
+	}
+
+	public ExchangeProcessor getProcessor() {
+		return this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.servicemix.common.Endpoint#getRole()
+	 */
+	public Role getRole() {
+		return Role.PROVIDER;
+	}
+
+	public ScriptExchangeProcessor getScript() {
+		return script;
+	}
+
+	public void process(MessageExchange exchange) throws Exception {
+		if (script != null)
+			script.process(exchange);
+
+	}
+
+	protected void send(MessageExchange me) throws MessagingException {
+		if (me.getRole() == MessageExchange.Role.CONSUMER
+				&& me.getStatus() == ExchangeStatus.ACTIVE) {
+			BaseLifeCycle lf = (BaseLifeCycle) getServiceUnit().getComponent()
+					.getLifeCycle();
+			lf.sendConsumerExchange(me, (Endpoint) this);
+		} else {
+			channel.send(me);
+		}
+	}
+
+	public void setScript(ScriptExchangeProcessor script) {
+		this.script = script;
+		script.setScriptExchangeProcessorEndpoint(this);
+	}
+
+	public void start() throws Exception {
+		if (script != null)
+			script.start();
+	}
+
+	public void stop() {
+		if (script != null) {
+			try {
+				script.stop();
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+
+	}
+
+	public void validate() throws DeploymentException {
+	}
+
+}

Added: incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/ScriptComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/ScriptComponentTest.java?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/ScriptComponentTest.java (added)
+++ incubator/servicemix/trunk/servicemix-script/src/test/java/org/apache/servicemix/script/ScriptComponentTest.java Tue Oct  3 14:21:30 2006
@@ -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.
+ */
+package org.apache.servicemix.script;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class ScriptComponentTest extends SpringTestSupport {
+
+    public void testGroovy() throws Exception {
+        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+        InOut me = client.createInOutExchange();
+        me.setService(new QName("urn:test", "groovy"));
+        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
+        client.sendSync(me);
+        if (me.getStatus() == ExchangeStatus.ERROR) {
+            if (me.getError() != null) {
+                throw me.getError();
+            } else {
+                fail("Received ERROR status");
+            }
+        } else if (me.getFault() != null) {
+            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+        }
+        System.err.println(new SourceTransformer().toString(me.getOutMessage().getContent()));
+        client.done(me);
+    }
+    
+    /*public void testRuby() throws Exception {
+        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
+        InOut me = client.createInOutExchange();
+        me.setService(new QName("urn:test", "ruby"));
+        me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
+        client.sendSync(me);
+        if (me.getStatus() == ExchangeStatus.ERROR) {
+            if (me.getError() != null) {
+                throw me.getError();
+            } else {
+                fail("Received ERROR status");
+            }
+        } else if (me.getFault() != null) {
+            fail("Received fault: " + new SourceTransformer().toString(me.getFault().getContent()));
+        }
+        System.err.println(new SourceTransformer().toString(me.getOutMessage().getContent()));
+        client.done(me);
+    }*/
+    
+    protected AbstractXmlApplicationContext createBeanFactory() {
+        return new ClassPathXmlApplicationContext("spring.xml");
+    }
+    
+}

Added: incubator/servicemix/trunk/servicemix-script/src/test/resources/GroovyExchangeProcessor.groovy
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/test/resources/GroovyExchangeProcessor.groovy?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/test/resources/GroovyExchangeProcessor.groovy (added)
+++ incubator/servicemix/trunk/servicemix-script/src/test/resources/GroovyExchangeProcessor.groovy Tue Oct  3 14:21:30 2006
@@ -0,0 +1,25 @@
+import org.apache.servicemix.script.ScriptExchangeProcessor;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.NormalizedMessage;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+
+class GroovyExchangeProcessor extends ScriptExchangeProcessor {
+
+	def void start() {
+	    println "Starting";
+	}
+
+    def void process(javax.jbi.messaging.MessageExchange exchange) {
+    	def inputMessage = new SourceTransformer().toString(exchange.getInMessage().getContent());
+    	println "Hello, I got an input message "+inputMessage;
+    	NormalizedMessage out = exchange.createMessage();
+        out.setContent(new StringSource("<world>hello</world>"));
+        exchange.setMessage(out, "out");
+        send(exchange);    	
+    }
+    
+    def void stop() {
+    	println "Stopping";
+    }
+}
\ No newline at end of file

Added: incubator/servicemix/trunk/servicemix-script/src/test/resources/RubyExchangeProcessor.rb
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/test/resources/RubyExchangeProcessor.rb?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/test/resources/RubyExchangeProcessor.rb (added)
+++ incubator/servicemix/trunk/servicemix-script/src/test/resources/RubyExchangeProcessor.rb Tue Oct  3 14:21:30 2006
@@ -0,0 +1,23 @@
+require 'java'
+
+include_class 'org.apache.servicemix.script.ScriptExchangeProcessor'
+include_class 'javax.jbi.messaging.MessageExchange'
+include_class 'javax.jbi.messaging.NormalizedMessage'
+include_class 'org.apache.servicemix.jbi.jaxp.StringSource'
+include_class 'org.apache.servicemix.jbi.jaxp.SourceTransformer'
+
+class RubyExchangeProcessor < org.apache.servicemix.script.ScriptExchangeProcessor
+
+ def start()
+   print "Starting"
+ end
+ 
+ def process(javax.jbi.messaging.MessageExchange me)
+   print "Processing "+me
+ end
+
+ def stop()
+   print "Stopping"
+ end
+
+end
\ No newline at end of file

Added: incubator/servicemix/trunk/servicemix-script/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/test/resources/log4j.properties?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/test/resources/log4j.properties (added)
+++ incubator/servicemix/trunk/servicemix-script/src/test/resources/log4j.properties Tue Oct  3 14:21:30 2006
@@ -0,0 +1,40 @@
+# 
+# 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.
+#
+#
+
+#
+# The logging properties used during tests..
+#
+log4j.rootLogger=INFO, out
+
+log4j.logger.org.springframework=INFO
+log4j.logger.org.apache.activemq=INFO
+log4j.logger.org.apache.activemq.spring=WARN
+
+# CONSOLE appender 
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+# File appender
+log4j.appender.out=org.apache.log4j.FileAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+log4j.appender.out.file=target/servicemix-test.log
+log4j.appender.out.append=true

Added: incubator/servicemix/trunk/servicemix-script/src/test/resources/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-script/src/test/resources/spring.xml?view=auto&rev=452627
==============================================================================
--- incubator/servicemix/trunk/servicemix-script/src/test/resources/spring.xml (added)
+++ incubator/servicemix/trunk/servicemix-script/src/test/resources/spring.xml Tue Oct  3 14:21:30 2006
@@ -0,0 +1,59 @@
+<?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:sm="http://servicemix.apache.org/config/1.0"
+	xmlns:script="http://org.apache.servicemix/script/1.0"
+	xmlns:lang="http://www.springframework.org/schema/lang"
+	xmlns:test="urn:test">
+
+	<sm:container id="jbi" embedded="true" createMBeanServer="false">
+		<sm:activationSpecs>
+			<sm:activationSpec>
+				<sm:component>
+					<script:component>						
+						<script:endpoints>
+							<!-- Groovy Endpoint  -->
+							<script:exchangeProcessor
+								service="test:groovy" endpoint="endpoint">
+								<property name="script" ref="groovyExchangeProcessor"/>
+							</script:exchangeProcessor>
+							
+							<!-- JRuby Endpoint  -->
+							<!-- <script:exchangeProcessor
+								service="test:jruby" endpoint="endpoint">
+								<property name="script" ref="rubyExchangeProcessor"/>
+							</script:exchangeProcessor>-->
+						</script:endpoints>						
+					</script:component>
+				</sm:component>
+			</sm:activationSpec>
+		</sm:activationSpecs>
+	</sm:container>
+
+	<lang:groovy
+		id="groovyExchangeProcessor"
+		script-source="classpath:GroovyExchangeProcessor.groovy">
+	</lang:groovy>
+	
+	<!-- <lang:jruby
+		id="rubyExchangeProcessor"
+		script-source="classpath:RubyExchangeProcessor.rb">
+	</lang:jruby> -->
+
+</beans>