Added: incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/SpringTestBean.java URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/SpringTestBean.java?rev=407499&view=auto ============================================================================== --- incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/SpringTestBean.java (added) +++ incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/SpringTestBean.java Thu May 18 01:18:34 2006 @@ -0,0 +1,56 @@ +/* +* Copyright 2004,2005 The Apache Software Foundation. +* +* Licensed 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.synapse.spring; + +import org.apache.synapse.api.Mediator; +import org.apache.synapse.MessageContext; + +public class SpringTestBean implements Mediator { + + private int testProperty; + + private TestMediateHandler handler = null; + + public SpringTestBean() { + } + + public boolean mediate(MessageContext synCtx) { + if (handler != null) { + handler.handle(synCtx); + } + return true; + } + + public TestMediateHandler getHandler() { + return handler; + } + + public void setHandler(TestMediateHandler handlerTest) { + this.handler = handlerTest; + } + + public String getType() { + return "SpringTestBean"; + } + + public void setTestProperty(int i) { + this.testProperty = i; + } + + public int getTestProperty() { + return testProperty; + } +}
Added: incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandler.java URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandler.java?rev=407499&view=auto ============================================================================== --- incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandler.java (added) +++ incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandler.java Thu May 18 01:18:34 2006 @@ -0,0 +1,23 @@ +/* +* Copyright 2004,2005 The Apache Software Foundation. +* +* Licensed 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.synapse.spring; + +import org.apache.synapse.MessageContext; + +public interface TestMediateHandler { + + public void handle(MessageContext synCtx); +} Added: incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandlerImpl.java URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandlerImpl.java?rev=407499&view=auto ============================================================================== --- incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandlerImpl.java (added) +++ incubator/synapse/trunk/java/modules/extensions/test/org/apache/synapse/spring/TestMediateHandlerImpl.java Thu May 18 01:18:34 2006 @@ -0,0 +1,27 @@ +/* +* Copyright 2004,2005 The Apache Software Foundation. +* +* Licensed 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.synapse.spring; + +import org.apache.synapse.MessageContext; + +public class TestMediateHandlerImpl implements TestMediateHandler { + + public static int invokeCount = 0; + + public void handle(MessageContext synCtx) { + invokeCount++; + } +} Modified: incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java?rev=407499&r1=407498&r2=407499&view=diff ============================================================================== --- incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java (original) +++ incubator/synapse/trunk/java/modules/samples/src/samples/mediation/AdvancedQuoteClient.java Thu May 18 01:18:34 2006 @@ -26,13 +26,12 @@ public static void main(String[] args) { - String symbol = "MSFT"; String xurl = "http://ws.invesbot.com/stockquotes.asmx"; String turl = "http://localhost:8080/StockQuote"; - testStandardQuote(symbol, xurl, turl); - testAdvancedQuote(symbol, xurl, turl); - testErroneousQuote(symbol, xurl, turl); + testStandardQuote("IBM", xurl, turl); + testAdvancedQuote("SUN", xurl, turl); + testErroneousQuote("MSFT", xurl, turl); } private static void testAdvancedQuote(String symbol, String xurl, String turl) { Added: incubator/synapse/trunk/java/repository/conf/sample/springsample.xml URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/springsample.xml?rev=407499&view=auto ============================================================================== --- incubator/synapse/trunk/java/repository/conf/sample/springsample.xml (added) +++ incubator/synapse/trunk/java/repository/conf/sample/springsample.xml Thu May 18 01:18:34 2006 @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" + "http://www.springframework.org/dtd/spring-beans.dtd"> + +<beans> + + <bean id="springtest" class="org.apache.synapse.spring.SpringTestBean" singleton="false"> + <property name="testProperty"><value>1</value></property> + <property name="handler"><ref bean="handler"/></property> + </bean> + + <bean id="handler" class="org.apache.synapse.spring.TestMediateHandlerImpl" singleton="true"/> + +</beans> \ No newline at end of file Added: incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml URL: http://svn.apache.org/viewvc/incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml?rev=407499&view=auto ============================================================================== --- incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml (added) +++ incubator/synapse/trunk/java/repository/conf/sample/synapse_sample_3.xml Thu May 18 01:18:34 2006 @@ -0,0 +1,16 @@ +<synapse xmlns="http://ws.apache.org/ns/synapse"> + + <definitions> + + <configuration name="springconfig" type="spring"> + <property name="config_name" value="./../../repository/conf/sample/springsample.xml"/> + </configuration> + + </definitions> + + <rules> + <spring ref_bean="springtest" config_name="springconfig"/> + <spring ref_bean="springtest" config_src="./../../repository/conf/sample/springsample.xml"/> + </rules> + +</synapse> \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
