You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by pz...@apache.org on 2005/11/11 18:43:18 UTC

svn commit: r332618 - in /incubator/synapse/trunk/scratch/yomsp2: ./ src/ src/org/ src/org/apache/ src/org/apache/synapse/ src/org/apache/synapse/axis2/ src/org/apache/synapse/mediators/ src/org/apache/synapse/ruleEngines/

Author: pzf
Date: Fri Nov 11 09:41:11 2005
New Revision: 332618

URL: http://svn.apache.org/viewcvs?rev=332618&view=rev
Log:
multiple edits... getting close to running in Axis2

Added:
    incubator/synapse/trunk/scratch/yomsp2/
    incubator/synapse/trunk/scratch/yomsp2/src/
    incubator/synapse/trunk/scratch/yomsp2/src/org/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class   (with props)
    incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,6 @@
+package org.apache.synapse;
+
+public interface ConfigurationAware {
+	public void setMediationConfiguration(MediatorConfiguration mc);
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,71 @@
+/*
+ * 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;
+
+import javax.xml.namespace.QName;
+
+public class Constants {
+	public static final String SPRINGMEDIATOR = "springmediator";
+
+	public static final String SYNAPSE_MEDIATOR_SPRING_BEAN_FACTORY = "synapse.mediator.spring.beanFactory";
+
+	public static final String SYNAPSE_SPRING_MEDIATOR_NAME = "synapse.spring.mediatorName";
+
+	public static final String CLASSMEDIATOR = "classmediator";
+
+	public static final String SYNAPSE_MEDIATOR_CLASS = "synapse.mediator.class";
+
+	public static final String MEDIATE_OPERATION_NAME = "mediate";
+
+
+
+	
+	public static final String SYNAPSE_MEDIATOR_XML_BYTES = "synapse.mediator.xml.bytes";
+
+	public static final String BPELMEDIATOR = "bpelmediator";
+
+	public static final String SYNAPSE_NAMESPACE = "http://ws.apache.org/ns/synapse";
+
+	public static final String SYNAPSE = "synapse";
+
+	public static final String MEDIATOR = "mediator";
+
+	public static final String RULESET = "ruleset";
+
+	public static final String TYPE = "type";
+
+	public static final QName RULESET_Q = new QName(SYNAPSE_NAMESPACE, RULESET);
+	public static final QName MEDIATOR_Q = new QName(SYNAPSE_NAMESPACE, MEDIATOR);
+
+	
+	public static final QName TYPE_ATT_Q = new QName(SYNAPSE_NAMESPACE,
+			TYPE);
+	public static final QName RULESET_NAME_ATT_Q = new QName(SYNAPSE_NAMESPACE,
+			"name");
+
+	public static final QName PHASE_ORDER_ATTR_Q = new QName(SYNAPSE_NAMESPACE,
+			"order");
+
+	public static final String INPHASE = "inphase";
+
+	public static final String OUTPHASE = "outphase";
+
+	public static final String MEDIATOR_CONFIGURATION = "synapse.mediator.configuration";
+
+	public static final String RESPONSE_PROPERTY = "synapse.mediator.response";
+
+	public static final String ISRESPONSE_PROPERTY = "synapse.isresponse";
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,6 @@
+package org.apache.synapse;
+
+public interface EnvironmentAware {
+	public void setSynapseEnvironment(SynapseEnvironment se);
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,22 @@
+/*
+ * 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;
+
+import org.apache.axis2.context.SOAPMessageContext;
+
+public interface Mediator {
+    public boolean mediate(SOAPMessageContext smc);
+}
\ No newline at end of file

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,9 @@
+package org.apache.synapse;
+
+import org.apache.axis2.om.OMElement;
+
+public interface MediatorConfiguration {
+	OMElement getMediatorElement();
+	String getMediatorName();
+	int getMediatorType();
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java Fri Nov 11 09:41:11 2005
@@ -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;
+
+import org.apache.axis2.om.OMElement;
+
+public interface MediatorConfigurator {
+	    MediatorConfiguration parse(OMElement el);
+	
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,55 @@
+/*
+ * 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;
+
+import org.apache.synapse.mediators.ClassMediatorConfigurator;
+import org.apache.synapse.mediators.E4XMediatorConfigurator;
+import org.apache.synapse.mediators.ServiceMediatorConfigurator;
+import org.apache.synapse.mediators.SpringMediatorConfigurator;
+
+public class MediatorTypes {
+	
+	public static final int SERVICE=0, SPRING=1, E4X=2, CLASS=3;
+	public static final String STRSERVICE = "service", STRCLASS = "class", STRSPRING = "spring", STRE4X = "e4x";
+
+	
+	public static MediatorConfigurator getMediatorConfigurator(String attributeValue) {
+		String type = attributeValue.toLowerCase().trim();
+		if (type.equals(STRSPRING))  
+			return new SpringMediatorConfigurator();
+		else if (type.equals(STRSERVICE)) 
+			return new ServiceMediatorConfigurator();
+		else if (type.equals(STRE4X))
+			return new E4XMediatorConfigurator();
+		else if (type.equals(STRCLASS)) 
+			return new ClassMediatorConfigurator();
+		else return null;
+	}
+
+	public static int getType(String attributeValue) {
+		String type = attributeValue.toLowerCase().trim();
+		if (type.equals("spring"))  
+			return SPRING;
+		else if (type.equals("service")) 
+			return SERVICE;
+		else if (type.equals("e4x"))
+			return E4X;
+		else if (type.equals("class")) 
+			return CLASS;
+		else return -1;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,20 @@
+package org.apache.synapse;
+
+import org.apache.axis2.context.SOAPMessageContext;
+
+public class ResponseIdentifier {
+
+	public static boolean isResponse(SOAPMessageContext smc) {
+		Boolean bool = (Boolean)smc.getProperty(Constants.ISRESPONSE_PROPERTY);
+		if (bool==null) {
+			// TODO figure it out
+			return false;
+		}
+		else
+			return bool.booleanValue();
+	}
+	public static void setResponse(SOAPMessageContext smc, boolean b) {
+		smc.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(b));
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.om.OMElement;
+
+public interface RuleEngine {
+
+	public String getRulesetType();
+
+	public void init(OMElement om); // gets passed the <synapse:ruleset>
+									// element.
+
+	public boolean process(SynapseEnvironment sc, SOAPMessageContext smc); // stateless
+																	// per
+																	// invocation
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,68 @@
+/*
+ * 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;
+
+import org.apache.axis2.context.SOAPMessageContext;
+
+
+
+
+public class SynapseEngine {
+
+	private RuleEngine[] inphase = null, outphase = null;
+
+	private boolean inoutseparate = false;
+	
+	private SynapseEnvironment se = null;
+
+	public void processMessage(SOAPMessageContext smc) {
+		SynapseEnvironment se = getSynapseEnvironment();
+		if (inoutseparate && ResponseIdentifier.isResponse(smc)) {
+				for (int i=0; i<outphase.length;i++) {
+					boolean ret = outphase[i].process(se, smc);
+					if (ret) break;
+				}
+			
+		}else {
+			for (int i=0; i<inphase.length;i++) {
+				boolean ret = inphase[i].process(se, smc);
+				if (ret) break;
+			}
+		}
+	}
+	
+	
+	
+	public SynapseEnvironment getSynapseEnvironment() {
+		return se;
+	}
+
+	public void setInphase(RuleEngine[] inphase) {
+		this.inphase = inphase;
+	}
+
+
+	public void setOutphase(RuleEngine[] outphase) {
+		this.outphase = outphase;
+	}
+
+
+	void setInoutseparate(boolean inoutseparate) {
+		this.inoutseparate = inoutseparate;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,140 @@
+/*
+ * 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;
+
+
+import java.util.HashMap;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+
+import org.apache.axis2.om.OMNode;
+import org.apache.synapse.ruleEngines.RuleEngineTypes;
+
+
+public class SynapseEngineConfigurator {
+
+	
+	public static void parse(SynapseEngine se, OMElement om) {
+		List rulesets = new LinkedList();
+
+		RuleEngine[] inphase = null, outphase = null;
+
+		Map ruleSetNames = new HashMap();
+
+		boolean inoutseparate = false;
+		String inPhaseNames = null, outPhaseNames = null;
+		if (!om.getLocalName().equals(Constants.SYNAPSE)
+				|| !om.getNamespace().getName().equals(
+						Constants.SYNAPSE_NAMESPACE)) {
+			throw new SynapseException("OMElement is not of namespace "
+					+ Constants.SYNAPSE_NAMESPACE + "or not localname "
+					+ Constants.SYNAPSE);
+		}
+
+		OMNode node = om.getFirstOMChild();
+		while (node != null) {
+
+			if (node.getType() != OMNode.ELEMENT_NODE) {
+				node = node.getNextOMSibling();
+				continue;
+			} // loop thru Elements only
+
+			OMElement el = (OMElement) node;
+
+			if (el.getNamespace().getName().toLowerCase().equals(
+					Constants.SYNAPSE_NAMESPACE)) {
+				node = node.getNextOMSibling();
+				continue;
+			} // ignore non-synapse elements
+
+			if (el.getLocalName().toLowerCase().equals(Constants.RULESET)) {
+				OMAttribute attr = el
+						.getAttribute(Constants.TYPE_ATT_Q);
+				String type = attr.getAttributeValue();
+				RuleEngine re = RuleEngineTypes.getRuleEngine(type);
+				if (re != null) {
+					re.init(el);
+				}
+				rulesets.add(re);
+				OMAttribute name = el
+						.getAttribute(Constants.RULESET_NAME_ATT_Q);
+				if (name != null) {
+					ruleSetNames.put(name.getAttributeValue(), re);
+				}
+			} else if (el.getLocalName().toLowerCase()
+					.equals(Constants.INPHASE)) {
+				OMAttribute attr = el
+						.getAttribute(Constants.PHASE_ORDER_ATTR_Q);
+				if (attr != null) {
+					inPhaseNames = attr.getAttributeValue();
+				}
+			} else if (el.getLocalName().equals(Constants.OUTPHASE)) {
+				OMAttribute attr = el
+						.getAttribute(Constants.PHASE_ORDER_ATTR_Q);
+				if (attr != null) {
+					outPhaseNames = attr.getAttributeValue();
+				}
+
+			}
+		}
+		if (inPhaseNames != null || outPhaseNames != null) {
+			inoutseparate = true;
+			String inOrder[] = parsePhaseOrder(inPhaseNames);
+			inphase = new RuleEngine[inOrder.length];
+			for (int i = 0; i < inOrder.length; i++) {
+				RuleEngine r = (RuleEngine) ruleSetNames.get(inOrder[i]);
+				if (r == null) {
+					throw new SynapseException(
+							"missing ruleset specified in inPhase order: "
+									+ inOrder[i]);
+				} else
+					inphase[i] = r;
+			}
+			String outOrder[] = parsePhaseOrder(outPhaseNames);
+			outphase = new RuleEngine[outOrder.length];
+			for (int i = 0; i < outOrder.length; i++) {
+				RuleEngine r = (RuleEngine) ruleSetNames.get(outOrder[i]);
+				if (r == null) {
+					throw new SynapseException(
+							"missing ruleset specified in outPhase order: "
+									+ outOrder[i]);
+				} else
+					outphase[i] = r;
+			}
+		} else {
+			inphase = new RuleEngine[rulesets.size()];
+			for (int i=0;i<inphase.length;i++) {
+				inphase[i] = (RuleEngine)rulesets.get(i);
+			}
+			
+			
+		}
+		se.setInoutseparate(inoutseparate);
+		se.setInphase(inphase);
+		se.setOutphase(outphase);
+		
+	}	
+
+	private static String[] parsePhaseOrder(String order) {
+		return order.trim().toLowerCase().split("[ \t\n\f\r]+");
+	}
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+import org.apache.axis2.context.SOAPMessageContext;
+
+public interface SynapseEnvironment {
+	
+	public void injectMessage(SOAPMessageContext smc);
+	
+	public boolean executeMediator(MediatorConfiguration mc, SOAPMessageContext smc);
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+public class SynapseException extends RuntimeException {
+
+	private static final long serialVersionUID = -7244032125641596311L;
+
+	public SynapseException(String string) {
+		super(string);
+	}
+
+	public SynapseException(String msg, Throwable e) {
+		super(msg, e);
+	}
+
+	public SynapseException(Throwable t) {
+		super(t);
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,125 @@
+package org.apache.synapse.axis2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.OperationContext;
+import org.apache.axis2.context.OperationContextFactory;
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.util.Utils;
+import org.apache.synapse.Constants;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorTypes;
+
+import org.apache.synapse.SynapseEngine;
+import org.apache.synapse.SynapseEngineConfigurator;
+import org.apache.synapse.SynapseEnvironment;
+import org.apache.synapse.SynapseException;
+import org.apache.synapse.mediators.SpringMediatorConfiguration;
+
+
+public class Axis2SynapseEnvironment implements SynapseEnvironment {
+	private SynapseEngine se = new SynapseEngine();
+	
+	public Axis2SynapseEnvironment(OMElement synapseConfiguration) {
+		SynapseEngineConfigurator.parse(se, synapseConfiguration);
+	}
+	
+	public void injectMessage(SOAPMessageContext smc) {
+		
+		se.processMessage(smc);
+
+	}
+
+	
+
+	public boolean executeMediator(MediatorConfiguration mc,
+			SOAPMessageContext smc) {
+		MessageContext messageContext = null;
+		try {
+			messageContext= (MessageContext)smc;
+		}
+		catch (ClassCastException cce) {
+			throw new SynapseException("A non-Axis2 MC SOAPMessageContext has been passed to the Axis2 MediationExecutor",cce);
+		}
+		
+		ConfigurationContext cc = messageContext.getSystemContext();
+		AxisConfiguration ac = cc.getAxisConfiguration();
+		AxisEngine ae = new AxisEngine(cc);
+
+		AxisService as = null;
+		AxisOperation ao = null;
+		messageContext.setProperty(
+				Constants.MEDIATOR_CONFIGURATION, mc);
+		
+		try {
+			switch (mc.getMediatorType()) { 
+				case  MediatorTypes.SPRING: {
+
+					as = ac.getService(Constants.SPRINGMEDIATOR);
+					if (as == null) throw new SynapseException("cannot locate service " +Constants.SPRINGMEDIATOR);
+					((SpringMediatorConfiguration)mc).getApplicationContext().setClassLoader(as.getClassLoader());
+					((SpringMediatorConfiguration)mc).getApplicationContext().refresh();
+					
+					break;
+					
+				}
+				case MediatorTypes.SERVICE: {
+					as = ac.getService(mc.getMediatorName());
+					if (as == null) throw new SynapseException("cannot locate service " +mc.getMediatorName());
+					break;
+				}
+				case MediatorTypes.CLASS: {
+					as = ac.getService(Constants.CLASSMEDIATOR);
+					if (as==null) throw new SynapseException("cannot locate service "+Constants.CLASSMEDIATOR);
+					Class c = null;
+					try {
+						c = as.getClassLoader().loadClass(mc.getMediatorName());
+					} catch (ClassNotFoundException ce) {
+						throw new SynapseException(ce);
+					}
+
+					messageContext.setProperty(Constants.SYNAPSE_MEDIATOR_CLASS, c);
+					
+					break;
+					
+				}
+					
+			}
+			
+			
+
+			ao = as.getOperation(Constants.MEDIATE_OPERATION_NAME);
+			OperationContext oc = OperationContextFactory
+					.createOperationContext(ao.getAxisSpecifMEPConstant(), ao);
+			ao.registerOperationContext(messageContext, oc);
+
+			ServiceContext sc = Utils.fillContextInformation(ao, as, cc);
+			oc.setParent(sc);
+			messageContext.setOperationContext(oc);
+			messageContext.setServiceContext(sc);
+
+			messageContext.setAxisOperation(ao);
+			messageContext.setAxisService(as);
+			ae.receive(messageContext);
+
+		} catch (AxisFault e) {
+			throw new SynapseException(e);
+
+		}
+
+		return ((Boolean) messageContext
+				.getProperty(Constants.RESPONSE_PROPERTY))
+				.booleanValue();
+
+		
+	}
+
+	
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,61 @@
+package org.apache.synapse.axis2;
+
+import java.io.InputStream;
+
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.description.ParameterImpl;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
+
+import org.apache.synapse.SynapseEnvironment;
+import org.apache.synapse.SynapseException;
+
+public class Axis2SynapseEnvironmentFinder {
+
+	private static final String SYNAPSECONFIGURATION = "SynapseConfiguration";
+
+	public static final String SYNAPSE_ENVIRONMENT = "synapse.environment";
+
+	public static synchronized SynapseEnvironment getSynapseEnvironment(MessageContext mc) {
+		AxisConfiguration ac = mc.getSystemContext().getAxisConfiguration();
+		Parameter synapseEnvParam = ac.getParameter(SYNAPSE_ENVIRONMENT);
+		if (synapseEnvParam == null) {
+
+			Parameter param = ac.getParameter(SYNAPSECONFIGURATION);
+			if (param == null) {
+				throw new SynapseException("no parameter '" + SYNAPSECONFIGURATION
+						+ "' in axis2.xml");
+			}
+			String synapseConfig = (String) param.getValue();
+			InputStream is = mc.getAxisService().getClassLoader().getResourceAsStream(synapseConfig);
+			
+			StAXOMBuilder builder;
+			try {
+				builder =  new StAXOMBuilder(is);
+
+			} catch (XMLStreamException e1) {
+				throw new SynapseException("Trouble parsing Synapse Configuration ",e1);
+				
+			}		
+			OMElement config = builder.getDocumentElement();
+			Axis2SynapseEnvironment se = new Axis2SynapseEnvironment(config);
+		
+			synapseEnvParam = new ParameterImpl(SYNAPSE_ENVIRONMENT, null);
+			synapseEnvParam.setValue(se);
+			try {
+				ac.addParameter(synapseEnvParam);
+			} catch (AxisFault e) {
+				throw new SynapseException(e);
+			}
+		}
+		return (SynapseEnvironment) synapseEnvParam.getValue();
+		
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,16 @@
+package org.apache.synapse.axis2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.MessageReceiver;
+
+public class E4XMediatorMessageReceiver implements MessageReceiver {
+
+	public void receive(MessageContext arg0) throws AxisFault {
+		// TODO Auto-generated method stub
+		
+	}
+
+
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,38 @@
+package org.apache.synapse.axis2;
+
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.synapse.Constants;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.mediators.SpringMediatorConfiguration;
+
+import org.springframework.context.support.GenericApplicationContext;
+
+public class SpringMessageReceiver implements MessageReceiver {
+
+
+    
+	
+    public void receive(MessageContext mc) throws AxisFault {
+        Mediator mediator = (Mediator) makeNewServiceObject(mc);
+        boolean resp = mediator.mediate((SOAPMessageContext)mc);
+        mc.setProperty(Constants.RESPONSE_PROPERTY, Boolean.valueOf(resp));
+    }
+
+    
+    protected Object makeNewServiceObject(MessageContext msgContext) {
+    	
+        
+        SpringMediatorConfiguration medConfig = (SpringMediatorConfiguration)msgContext.getProperty(Constants.MEDIATOR_CONFIGURATION);
+        GenericApplicationContext ctx = medConfig.getApplicationContext();
+        
+        Object o = ctx.getBean(medConfig.getMediatorName());
+       	        
+        return o;
+    }
+	
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,33 @@
+/*
+ * 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.axis2;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.engine.MessageReceiver;
+
+
+import org.apache.synapse.SynapseEnvironment;
+
+public class SynapseMessageReceiver implements MessageReceiver {
+	
+	
+	public void receive(MessageContext mc) throws AxisFault {
+		SynapseEnvironment env = Axis2SynapseEnvironmentFinder.getSynapseEnvironment(mc);
+		env.injectMessage((SOAPMessageContext)mc);
+	}
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,16 @@
+package org.apache.synapse.mediators;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorConfigurator;
+
+public class ClassMediatorConfigurator implements MediatorConfigurator {
+
+	public MediatorConfiguration parse(OMElement el) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,15 @@
+package org.apache.synapse.mediators;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorConfigurator;
+
+public class E4XMediatorConfigurator implements MediatorConfigurator {
+
+	public MediatorConfiguration parse(OMElement el) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,14 @@
+package org.apache.synapse.mediators;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorConfigurator;
+
+public class ServiceMediatorConfigurator implements MediatorConfigurator {
+
+	public MediatorConfiguration parse(OMElement el) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,49 @@
+package org.apache.synapse.mediators;
+
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorTypes;
+
+import org.springframework.context.support.GenericApplicationContext;
+
+
+public class SpringMediatorConfiguration implements MediatorConfiguration {
+
+	private OMElement mediatorElement = null;
+	private GenericApplicationContext ctx = null;
+	private String name = null;
+	
+	public void setMediatorElement(OMElement me) {
+		this.mediatorElement = me;
+	}
+	
+	public OMElement getMediatorElement() {
+	
+		return mediatorElement;
+	}
+
+	public void setApplicationContext(GenericApplicationContext ctx) {
+		this.ctx = ctx;
+		
+	}
+	public GenericApplicationContext getApplicationContext() {
+		return ctx;
+	}
+
+	public String getMediatorName() {
+		
+		return name;
+		
+	}
+	public void setMediatorName(String name) {
+		this.name=name;
+	}
+
+	public int getMediatorType() {
+		
+		return MediatorTypes.SPRING;
+	}
+	
+
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,63 @@
+package org.apache.synapse.mediators;
+
+import java.io.ByteArrayOutputStream;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorConfigurator;
+import org.apache.synapse.SynapseException;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ByteArrayResource;
+
+public class SpringMediatorConfigurator implements MediatorConfigurator {
+	
+	
+	public MediatorConfiguration parse(OMElement el) {
+	    
+		OMAttribute name = el.getAttribute(new QName(el.getNamespace().getName(), "name"));
+		if (name == null) throw new SynapseException("missing name attribute on "+el.toString());
+		ByteArrayOutputStream baos = new ByteArrayOutputStream();
+		try {
+			baos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN//EN\" \"http://www.springframework.org/dtd/spring-beans.dtd\">"
+							.getBytes());
+			XMLStreamWriter xsw = XMLOutputFactory.newInstance().createXMLStreamWriter(baos);
+			OMElement beans = null;
+			Iterator it = el.getChildElements();
+			while (it.hasNext()) {
+				OMElement ths = (OMElement)it.next();
+				if (ths.getLocalName().toLowerCase().equals("beans")) {
+					beans = ths;
+					break;
+				}
+			}
+			if (beans==null) throw new SynapseException("<beans> element not found in "+el.toString());
+			xsw.setDefaultNamespace(beans.getNamespace().getName());
+			beans.serialize(xsw);
+		} catch (Exception e) {
+			throw new SynapseException(e);
+		} 
+				
+		GenericApplicationContext ctx = new GenericApplicationContext();
+		XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(
+				ctx);
+		xbdr.setValidating(false);
+		xbdr.loadBeanDefinitions(new ByteArrayResource(baos.toByteArray()));
+		
+		SpringMediatorConfiguration mc = new SpringMediatorConfiguration();
+		mc.setMediatorElement(el);
+		mc.setApplicationContext(ctx);
+		mc.setMediatorName(name.getAttributeValue());
+		return mc;
+	}
+
+
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine%241.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,33 @@
+package org.apache.synapse.ruleEngines;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.om.OMElement;
+
+
+public class AllRuleEngine extends OnceRuleEngine {
+	private static final QName ALL_RULE_Q = new QName(
+			"http://ws.apache.org/synapse/ns/allrule", "rule");
+
+	public static final RuleCondition always = new RuleCondition() {
+		public boolean matches(SOAPMessageContext smc) {
+			return true;
+		}
+
+	};
+
+	public RuleCondition getRuleCondition(OMElement om) {
+		return always;
+	}
+
+	public QName getRuleQName() {
+		return ALL_RULE_Q;
+	}
+
+	public String getRulesetType() {
+		return "all";
+		
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,73 @@
+/*
+ * 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.ruleEngines;
+
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.MediatorConfiguration;
+
+import org.apache.synapse.RuleEngine;
+
+
+import org.apache.synapse.SynapseEnvironment;
+
+// This implements a class of rule engine. These rule engines have a specific
+// behaviour which is to
+// 
+public abstract class OnceRuleEngine implements RuleEngine {
+
+	private List rules = new LinkedList();
+
+	public abstract RuleCondition getRuleCondition(OMElement om);
+
+	public abstract QName getRuleQName();
+
+	public void init(OMElement om) {
+		Iterator it = om.getChildrenWithName(getRuleQName());
+		while (it.hasNext()) {
+			OMElement rule = (OMElement) it.next();
+			Rule ra = new Rule();
+			ra.init(rule);
+			ra.setRuleCondition(getRuleCondition(om));
+			rules.add(ra);
+
+		}
+
+	}
+
+	public boolean process(SynapseEnvironment se, SOAPMessageContext smc) {
+		Iterator it = rules.iterator();
+		while (it.hasNext()) {
+
+			Rule ra = (Rule) it.next();
+			RuleCondition rc = ra.getRuleCondition();
+			if (rc.matches(smc)) {
+				MediatorConfiguration mc = ra.getMediatorConfiguration();
+				boolean ret = se.executeMediator(mc, smc);
+				if (!ret)
+					return false;
+			}
+		}
+		return true;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,44 @@
+/*
+ * 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.ruleEngines;
+
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.RuleEngine;
+
+
+import org.apache.synapse.SynapseEnvironment;
+
+public class RegexRuleEngine implements RuleEngine {
+
+	
+	// TBD
+	public String getRulesetType() {
+		return RuleEngineTypes.REGEX;
+	}
+
+	public void init(OMElement om) {
+		
+
+	}
+
+
+	public boolean process(SynapseEnvironment sc, SOAPMessageContext smc) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,50 @@
+package org.apache.synapse.ruleEngines;
+
+import java.util.Iterator;
+
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+import org.apache.synapse.Constants;
+import org.apache.synapse.MediatorConfiguration;
+import org.apache.synapse.MediatorConfigurator;
+import org.apache.synapse.MediatorTypes;
+import org.apache.synapse.SynapseException;
+
+public class Rule {
+	private RuleCondition rc = null;
+	private MediatorConfiguration mc = null;
+	private int mediatorType = 0; 
+	
+	public void init(OMElement ruleContainer) {
+		Iterator it = ruleContainer.getChildrenWithName(Constants.MEDIATOR_Q);
+		if (it.hasNext()) {
+			OMElement med = (OMElement)it.next(); // only use first mediator
+			OMAttribute type = med.getAttribute(Constants.TYPE_ATT_Q);
+			if (type==null) throw new SynapseException("no type declaration on "+med.toString());
+			MediatorConfigurator config = MediatorTypes.getMediatorConfigurator(type.getAttributeValue());
+			mc = config.parse(med);
+			mediatorType = MediatorTypes.getType(type.getAttributeValue());
+		}
+		// deal with QoS apply elements here TODO
+	}
+	
+	//public QoS getQoS();
+	
+	public MediatorConfiguration getMediatorConfiguration() {
+		return mc;
+	}
+	public int getMediatorType() { 
+		return mediatorType;
+	}
+	
+	
+	public RuleCondition getRuleCondition() {
+		return rc;
+	}
+	public void setRuleCondition(RuleCondition rc) {
+		this.rc = rc;
+	}
+	
+	
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,11 @@
+package org.apache.synapse.ruleEngines;
+
+import org.apache.axis2.context.SOAPMessageContext;
+
+
+
+public interface RuleCondition {
+
+	boolean matches(SOAPMessageContext smc);
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,35 @@
+/*
+ * 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.ruleEngines;
+
+import org.apache.synapse.RuleEngine;
+
+public class RuleEngineTypes {
+	// this class could be replaced with a dynamic registry bootstrapped using JAR services 
+	
+	public static final String XPATH="xpath";
+	public static final String REGEX="regex";
+	public static final String ALL="all";
+	
+	
+	public static RuleEngine getRuleEngine(String type) {
+		if (type.toLowerCase().equals(XPATH)) return new XPathRuleEngine();
+		else if (type.toLowerCase().equals(REGEX)) return new RegexRuleEngine();
+		else if (type.toLowerCase().equals(ALL)) return new AllRuleEngine();
+		return null;
+	}
+
+}

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine%24XPathRuleCondition.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class?rev=332618&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java?rev=332618&view=auto
==============================================================================
--- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java (added)
+++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java Fri Nov 11 09:41:11 2005
@@ -0,0 +1,62 @@
+package org.apache.synapse.ruleEngines;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.context.SOAPMessageContext;
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.xpath.AXIOMXPath;
+
+import org.apache.synapse.SynapseException;
+import org.jaxen.JaxenException;
+
+public class XPathRuleEngine extends OnceRuleEngine {
+	private static final String XPATH_NS = "http://ws.apache.org/synapse/ns/xpathrule";
+	private static final QName XPATH_RULE_Q = new QName(
+			XPATH_NS, "rule", "xpath");
+	private static final QName XPATH_CONDITION_ATT_Q = new QName(XPATH_NS, "xpath"); 
+
+	public RuleCondition getRuleCondition(OMElement om) {
+		OMAttribute xpath=om.getAttribute(XPATH_CONDITION_ATT_Q);
+		if (xpath==null) {
+			throw new SynapseException("rule must have xpath attribute: "+om.toString());
+		}
+		RuleCondition rc = null;
+		try {
+			rc = new XPathRuleCondition(om.getAllDeclaredNamespaces(), xpath.getAttributeValue().trim());
+		}
+		catch (JaxenException e) {
+			throw new SynapseException("Problem with xpath expression "+xpath.getAttributeValue(), e);
+		}
+		return rc;
+	}
+
+	public QName getRuleQName() {
+		return XPATH_RULE_Q;
+	}
+
+	protected class XPathRuleCondition implements RuleCondition {
+		private AXIOMXPath xp = null;
+		protected XPathRuleCondition(Iterator namespaces, String xpath) throws JaxenException {
+			
+			this.xp = new AXIOMXPath(xpath);
+		}
+		
+		public boolean matches(SOAPMessageContext smc) {
+			try {
+				return xp.booleanValueOf(smc.getEnvelope());
+			} catch (JaxenException e) {
+				throw new SynapseException ("Problem trying to evaluate "+xp.getRootExpr()+" on "+smc.getEnvelope().toString(),e);
+				
+			}
+		}
+	}
+
+	public String getRulesetType() {
+		
+		return "xpath";
+	}
+	
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Re: svn commit: r332618 - in /incubator/synapse/trunk/scratch/yomsp2: ./ src/ src/org/ src/org/apache/ src/org/apache/synapse/ src/org/apache/synapse/axis2/ src/org/apache/synapse/mediators/ src/org/apache/synapse/ruleEngines/

Posted by Paul Fremantle <pz...@gmail.com>.
Doh!

On 11/12/05, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
>
> Um you didn't mean to commit the .class files right? :).
>
> Sanjiva.
>
> On Fri, 2005-11-11 at 17:43 +0000, pzf@apache.org wrote:
> > Author: pzf
> > Date: Fri Nov 11 09:41:11 2005
> > New Revision: 332618
> >
> > URL: http://svn.apache.org/viewcvs?rev=332618&view=rev
> > Log:
> > multiple edits... getting close to running in Axis2
> >
> > Added:
> > incubator/synapse/trunk/scratch/yomsp2/
> > incubator/synapse/trunk/scratch/yomsp2/src/
> > incubator/synapse/trunk/scratch/yomsp2/src/org/
> > incubator/synapse/trunk/scratch/yomsp2/src/org/apache/
> > incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
> > incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
> > incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
> (with props)
> >
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,6 @@
> > +package org.apache.synapse;
> > +
> > +public interface ConfigurationAware {
> > + public void setMediationConfiguration(MediatorConfiguration mc);
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,71 @@
> > +/*
> > + * 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;
> > +
> > +import javax.xml.namespace.QName;
> > +
> > +public class Constants {
> > + public static final String SPRINGMEDIATOR = "springmediator";
> > +
> > + public static final String SYNAPSE_MEDIATOR_SPRING_BEAN_FACTORY = "
> synapse.mediator.spring.beanFactory";
> > +
> > + public static final String SYNAPSE_SPRING_MEDIATOR_NAME = "
> synapse.spring.mediatorName";
> > +
> > + public static final String CLASSMEDIATOR = "classmediator";
> > +
> > + public static final String SYNAPSE_MEDIATOR_CLASS = "
> synapse.mediator.class";
> > +
> > + public static final String MEDIATE_OPERATION_NAME = "mediate";
> > +
> > +
> > +
> > +
> > + public static final String SYNAPSE_MEDIATOR_XML_BYTES = "
> synapse.mediator.xml.bytes";
> > +
> > + public static final String BPELMEDIATOR = "bpelmediator";
> > +
> > + public static final String SYNAPSE_NAMESPACE = "
> http://ws.apache.org/ns/synapse";
> > +
> > + public static final String SYNAPSE = "synapse";
> > +
> > + public static final String MEDIATOR = "mediator";
> > +
> > + public static final String RULESET = "ruleset";
> > +
> > + public static final String TYPE = "type";
> > +
> > + public static final QName RULESET_Q = new QName(SYNAPSE_NAMESPACE,
> RULESET);
> > + public static final QName MEDIATOR_Q = new QName(SYNAPSE_NAMESPACE,
> MEDIATOR);
> > +
> > +
> > + public static final QName TYPE_ATT_Q = new QName(SYNAPSE_NAMESPACE,
> > + TYPE);
> > + public static final QName RULESET_NAME_ATT_Q = new
> QName(SYNAPSE_NAMESPACE,
> > + "name");
> > +
> > + public static final QName PHASE_ORDER_ATTR_Q = new
> QName(SYNAPSE_NAMESPACE,
> > + "order");
> > +
> > + public static final String INPHASE = "inphase";
> > +
> > + public static final String OUTPHASE = "outphase";
> > +
> > + public static final String MEDIATOR_CONFIGURATION = "
> synapse.mediator.configuration";
> > +
> > + public static final String RESPONSE_PROPERTY = "
> synapse.mediator.response";
> > +
> > + public static final String ISRESPONSE_PROPERTY = "synapse.isresponse";
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,6 @@
> > +package org.apache.synapse;
> > +
> > +public interface EnvironmentAware {
> > + public void setSynapseEnvironment(SynapseEnvironment se);
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,22 @@
> > +/*
> > + * 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;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +
> > +public interface Mediator {
> > + public boolean mediate(SOAPMessageContext smc);
> > +}
> > \ No newline at end of file
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,9 @@
> > +package org.apache.synapse;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +
> > +public interface MediatorConfiguration {
> > + OMElement getMediatorElement();
> > + String getMediatorName();
> > + int getMediatorType();
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -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;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +
> > +public interface MediatorConfigurator {
> > + MediatorConfiguration parse(OMElement el);
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,55 @@
> > +/*
> > + * 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;
> > +
> > +import org.apache.synapse.mediators.ClassMediatorConfigurator;
> > +import org.apache.synapse.mediators.E4XMediatorConfigurator;
> > +import org.apache.synapse.mediators.ServiceMediatorConfigurator;
> > +import org.apache.synapse.mediators.SpringMediatorConfigurator;
> > +
> > +public class MediatorTypes {
> > +
> > + public static final int SERVICE=0, SPRING=1, E4X=2, CLASS=3;
> > + public static final String STRSERVICE = "service", STRCLASS = "class",
> STRSPRING = "spring", STRE4X = "e4x";
> > +
> > +
> > + public static MediatorConfigurator getMediatorConfigurator(String
> attributeValue) {
> > + String type = attributeValue.toLowerCase().trim();
> > + if (type.equals(STRSPRING))
> > + return new SpringMediatorConfigurator();
> > + else if (type.equals(STRSERVICE))
> > + return new ServiceMediatorConfigurator();
> > + else if (type.equals(STRE4X))
> > + return new E4XMediatorConfigurator();
> > + else if (type.equals(STRCLASS))
> > + return new ClassMediatorConfigurator();
> > + else return null;
> > + }
> > +
> > + public static int getType(String attributeValue) {
> > + String type = attributeValue.toLowerCase().trim();
> > + if (type.equals("spring"))
> > + return SPRING;
> > + else if (type.equals("service"))
> > + return SERVICE;
> > + else if (type.equals("e4x"))
> > + return E4X;
> > + else if (type.equals("class"))
> > + return CLASS;
> > + else return -1;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,20 @@
> > +package org.apache.synapse;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +
> > +public class ResponseIdentifier {
> > +
> > + public static boolean isResponse(SOAPMessageContext smc) {
> > + Boolean bool = (Boolean)smc.getProperty(Constants.ISRESPONSE_PROPERTY
> );
> > + if (bool==null) {
> > + // TODO figure it out
> > + return false;
> > + }
> > + else
> > + return bool.booleanValue();
> > + }
> > + public static void setResponse(SOAPMessageContext smc, boolean b) {
> > + smc.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(b));
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,32 @@
> > +/*
> > + * 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;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.om.OMElement;
> > +
> > +public interface RuleEngine {
> > +
> > + public String getRulesetType();
> > +
> > + public void init(OMElement om); // gets passed the <synapse:ruleset>
> > + // element.
> > +
> > + public boolean process(SynapseEnvironment sc, SOAPMessageContext smc);
> // stateless
> > + // per
> > + // invocation
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,68 @@
> > +/*
> > + * 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;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +
> > +
> > +
> > +
> > +public class SynapseEngine {
> > +
> > + private RuleEngine[] inphase = null, outphase = null;
> > +
> > + private boolean inoutseparate = false;
> > +
> > + private SynapseEnvironment se = null;
> > +
> > + public void processMessage(SOAPMessageContext smc) {
> > + SynapseEnvironment se = getSynapseEnvironment();
> > + if (inoutseparate && ResponseIdentifier.isResponse(smc)) {
> > + for (int i=0; i<outphase.length;i++) {
> > + boolean ret = outphase[i].process(se, smc);
> > + if (ret) break;
> > + }
> > +
> > + }else {
> > + for (int i=0; i<inphase.length;i++) {
> > + boolean ret = inphase[i].process(se, smc);
> > + if (ret) break;
> > + }
> > + }
> > + }
> > +
> > +
> > +
> > + public SynapseEnvironment getSynapseEnvironment() {
> > + return se;
> > + }
> > +
> > + public void setInphase(RuleEngine[] inphase) {
> > + this.inphase = inphase;
> > + }
> > +
> > +
> > + public void setOutphase(RuleEngine[] outphase) {
> > + this.outphase = outphase;
> > + }
> > +
> > +
> > + void setInoutseparate(boolean inoutseparate) {
> > + this.inoutseparate = inoutseparate;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,140 @@
> > +/*
> > + * 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;
> > +
> > +
> > +import java.util.HashMap;
> > +
> > +import java.util.LinkedList;
> > +import java.util.List;
> > +import java.util.Map;
> > +
> > +import org.apache.axis2.om.OMAttribute;
> > +import org.apache.axis2.om.OMElement;
> > +
> > +import org.apache.axis2.om.OMNode;
> > +import org.apache.synapse.ruleEngines.RuleEngineTypes;
> > +
> > +
> > +public class SynapseEngineConfigurator {
> > +
> > +
> > + public static void parse(SynapseEngine se, OMElement om) {
> > + List rulesets = new LinkedList();
> > +
> > + RuleEngine[] inphase = null, outphase = null;
> > +
> > + Map ruleSetNames = new HashMap();
> > +
> > + boolean inoutseparate = false;
> > + String inPhaseNames = null, outPhaseNames = null;
> > + if (!om.getLocalName().equals(Constants.SYNAPSE)
> > + || !om.getNamespace().getName().equals(
> > + Constants.SYNAPSE_NAMESPACE)) {
> > + throw new SynapseException("OMElement is not of namespace "
> > + + Constants.SYNAPSE_NAMESPACE + "or not localname "
> > + + Constants.SYNAPSE);
> > + }
> > +
> > + OMNode node = om.getFirstOMChild();
> > + while (node != null) {
> > +
> > + if (node.getType() != OMNode.ELEMENT_NODE) {
> > + node = node.getNextOMSibling();
> > + continue;
> > + } // loop thru Elements only
> > +
> > + OMElement el = (OMElement) node;
> > +
> > + if (el.getNamespace().getName().toLowerCase().equals(
> > + Constants.SYNAPSE_NAMESPACE)) {
> > + node = node.getNextOMSibling();
> > + continue;
> > + } // ignore non-synapse elements
> > +
> > + if (el.getLocalName().toLowerCase().equals(Constants.RULESET)) {
> > + OMAttribute attr = el
> > + .getAttribute(Constants.TYPE_ATT_Q);
> > + String type = attr.getAttributeValue();
> > + RuleEngine re = RuleEngineTypes.getRuleEngine(type);
> > + if (re != null) {
> > + re.init(el);
> > + }
> > + rulesets.add(re);
> > + OMAttribute name = el
> > + .getAttribute(Constants.RULESET_NAME_ATT_Q);
> > + if (name != null) {
> > + ruleSetNames.put(name.getAttributeValue(), re);
> > + }
> > + } else if (el.getLocalName().toLowerCase()
> > + .equals(Constants.INPHASE)) {
> > + OMAttribute attr = el
> > + .getAttribute(Constants.PHASE_ORDER_ATTR_Q);
> > + if (attr != null) {
> > + inPhaseNames = attr.getAttributeValue();
> > + }
> > + } else if (el.getLocalName().equals(Constants.OUTPHASE)) {
> > + OMAttribute attr = el
> > + .getAttribute(Constants.PHASE_ORDER_ATTR_Q);
> > + if (attr != null) {
> > + outPhaseNames = attr.getAttributeValue();
> > + }
> > +
> > + }
> > + }
> > + if (inPhaseNames != null || outPhaseNames != null) {
> > + inoutseparate = true;
> > + String inOrder[] = parsePhaseOrder(inPhaseNames);
> > + inphase = new RuleEngine[inOrder.length];
> > + for (int i = 0; i < inOrder.length; i++) {
> > + RuleEngine r = (RuleEngine) ruleSetNames.get(inOrder[i]);
> > + if (r == null) {
> > + throw new SynapseException(
> > + "missing ruleset specified in inPhase order: "
> > + + inOrder[i]);
> > + } else
> > + inphase[i] = r;
> > + }
> > + String outOrder[] = parsePhaseOrder(outPhaseNames);
> > + outphase = new RuleEngine[outOrder.length];
> > + for (int i = 0; i < outOrder.length; i++) {
> > + RuleEngine r = (RuleEngine) ruleSetNames.get(outOrder[i]);
> > + if (r == null) {
> > + throw new SynapseException(
> > + "missing ruleset specified in outPhase order: "
> > + + outOrder[i]);
> > + } else
> > + outphase[i] = r;
> > + }
> > + } else {
> > + inphase = new RuleEngine[rulesets.size()];
> > + for (int i=0;i<inphase.length;i++) {
> > + inphase[i] = (RuleEngine)rulesets.get(i);
> > + }
> > +
> > +
> > + }
> > + se.setInoutseparate(inoutseparate);
> > + se.setInphase(inphase);
> > + se.setOutphase(outphase);
> > +
> > + }
> > +
> > + private static String[] parsePhaseOrder(String order) {
> > + return order.trim().toLowerCase().split("[ \t\n\f\r]+");
> > + }
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,26 @@
> > +/*
> > + * 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;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +
> > +public interface SynapseEnvironment {
> > +
> > + public void injectMessage(SOAPMessageContext smc);
> > +
> > + public boolean executeMediator(MediatorConfiguration mc,
> SOAPMessageContext smc);
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,34 @@
> > +/*
> > + * 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;
> > +
> > +public class SynapseException extends RuntimeException {
> > +
> > + private static final long serialVersionUID = -7244032125641596311L;
> > +
> > + public SynapseException(String string) {
> > + super(string);
> > + }
> > +
> > + public SynapseException(String msg, Throwable e) {
> > + super(msg, e);
> > + }
> > +
> > + public SynapseException(Throwable t) {
> > + super(t);
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,125 @@
> > +package org.apache.synapse.axis2;
> > +
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.context.ConfigurationContext;
> > +import org.apache.axis2.context.MessageContext;
> > +import org.apache.axis2.context.OperationContext;
> > +import org.apache.axis2.context.OperationContextFactory;
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.context.ServiceContext;
> > +import org.apache.axis2.description.AxisOperation;
> > +import org.apache.axis2.description.AxisService;
> > +import org.apache.axis2.engine.AxisConfiguration;
> > +import org.apache.axis2.engine.AxisEngine;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.axis2.util.Utils;
> > +import org.apache.synapse.Constants;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorTypes;
> > +
> > +import org.apache.synapse.SynapseEngine;
> > +import org.apache.synapse.SynapseEngineConfigurator;
> > +import org.apache.synapse.SynapseEnvironment;
> > +import org.apache.synapse.SynapseException;
> > +import org.apache.synapse.mediators.SpringMediatorConfiguration;
> > +
> > +
> > +public class Axis2SynapseEnvironment implements SynapseEnvironment {
> > + private SynapseEngine se = new SynapseEngine();
> > +
> > + public Axis2SynapseEnvironment(OMElement synapseConfiguration) {
> > + SynapseEngineConfigurator.parse(se, synapseConfiguration);
> > + }
> > +
> > + public void injectMessage(SOAPMessageContext smc) {
> > +
> > + se.processMessage(smc);
> > +
> > + }
> > +
> > +
> > +
> > + public boolean executeMediator(MediatorConfiguration mc,
> > + SOAPMessageContext smc) {
> > + MessageContext messageContext = null;
> > + try {
> > + messageContext= (MessageContext)smc;
> > + }
> > + catch (ClassCastException cce) {
> > + throw new SynapseException("A non-Axis2 MC SOAPMessageContext has been
> passed to the Axis2 MediationExecutor",cce);
> > + }
> > +
> > + ConfigurationContext cc = messageContext.getSystemContext();
> > + AxisConfiguration ac = cc.getAxisConfiguration();
> > + AxisEngine ae = new AxisEngine(cc);
> > +
> > + AxisService as = null;
> > + AxisOperation ao = null;
> > + messageContext.setProperty(
> > + Constants.MEDIATOR_CONFIGURATION, mc);
> > +
> > + try {
> > + switch (mc.getMediatorType()) {
> > + case MediatorTypes.SPRING: {
> > +
> > + as = ac.getService(Constants.SPRINGMEDIATOR);
> > + if (as == null) throw new SynapseException("cannot locate service "
> +Constants.SPRINGMEDIATOR);
> > +
> ((SpringMediatorConfiguration)mc).getApplicationContext().setClassLoader(
> as.getClassLoader());
> > + ((SpringMediatorConfiguration)mc).getApplicationContext().refresh();
> > +
> > + break;
> > +
> > + }
> > + case MediatorTypes.SERVICE: {
> > + as = ac.getService(mc.getMediatorName());
> > + if (as == null) throw new SynapseException("cannot locate service "
> +mc.getMediatorName());
> > + break;
> > + }
> > + case MediatorTypes.CLASS: {
> > + as = ac.getService(Constants.CLASSMEDIATOR);
> > + if (as==null) throw new SynapseException("cannot locate service
> "+Constants.CLASSMEDIATOR);
> > + Class c = null;
> > + try {
> > + c = as.getClassLoader().loadClass(mc.getMediatorName());
> > + } catch (ClassNotFoundException ce) {
> > + throw new SynapseException(ce);
> > + }
> > +
> > + messageContext.setProperty(Constants.SYNAPSE_MEDIATOR_CLASS, c);
> > +
> > + break;
> > +
> > + }
> > +
> > + }
> > +
> > +
> > +
> > + ao = as.getOperation(Constants.MEDIATE_OPERATION_NAME);
> > + OperationContext oc = OperationContextFactory
> > + .createOperationContext(ao.getAxisSpecifMEPConstant(), ao);
> > + ao.registerOperationContext(messageContext, oc);
> > +
> > + ServiceContext sc = Utils.fillContextInformation(ao, as, cc);
> > + oc.setParent(sc);
> > + messageContext.setOperationContext(oc);
> > + messageContext.setServiceContext(sc);
> > +
> > + messageContext.setAxisOperation(ao);
> > + messageContext.setAxisService(as);
> > + ae.receive(messageContext);
> > +
> > + } catch (AxisFault e) {
> > + throw new SynapseException(e);
> > +
> > + }
> > +
> > + return ((Boolean) messageContext
> > + .getProperty(Constants.RESPONSE_PROPERTY))
> > + .booleanValue();
> > +
> > +
> > + }
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,61 @@
> > +package org.apache.synapse.axis2;
> > +
> > +import java.io.InputStream;
> > +
> > +
> > +import javax.xml.stream.XMLStreamException;
> > +
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.context.MessageContext;
> > +import org.apache.axis2.description.Parameter;
> > +import org.apache.axis2.description.ParameterImpl;
> > +import org.apache.axis2.engine.AxisConfiguration;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
> > +
> > +import org.apache.synapse.SynapseEnvironment;
> > +import org.apache.synapse.SynapseException;
> > +
> > +public class Axis2SynapseEnvironmentFinder {
> > +
> > + private static final String SYNAPSECONFIGURATION =
> "SynapseConfiguration";
> > +
> > + public static final String SYNAPSE_ENVIRONMENT = "synapse.environment
> ";
> > +
> > + public static synchronized SynapseEnvironment
> getSynapseEnvironment(MessageContext mc) {
> > + AxisConfiguration ac = mc.getSystemContext().getAxisConfiguration();
> > + Parameter synapseEnvParam = ac.getParameter(SYNAPSE_ENVIRONMENT);
> > + if (synapseEnvParam == null) {
> > +
> > + Parameter param = ac.getParameter(SYNAPSECONFIGURATION);
> > + if (param == null) {
> > + throw new SynapseException("no parameter '" + SYNAPSECONFIGURATION
> > + + "' in axis2.xml");
> > + }
> > + String synapseConfig = (String) param.getValue();
> > + InputStream is = mc.getAxisService
> ().getClassLoader().getResourceAsStream(synapseConfig);
> > +
> > + StAXOMBuilder builder;
> > + try {
> > + builder = new StAXOMBuilder(is);
> > +
> > + } catch (XMLStreamException e1) {
> > + throw new SynapseException("Trouble parsing Synapse Configuration
> ",e1);
> > +
> > + }
> > + OMElement config = builder.getDocumentElement();
> > + Axis2SynapseEnvironment se = new Axis2SynapseEnvironment(config);
> > +
> > + synapseEnvParam = new ParameterImpl(SYNAPSE_ENVIRONMENT, null);
> > + synapseEnvParam.setValue(se);
> > + try {
> > + ac.addParameter(synapseEnvParam);
> > + } catch (AxisFault e) {
> > + throw new SynapseException(e);
> > + }
> > + }
> > + return (SynapseEnvironment) synapseEnvParam.getValue();
> > +
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,16 @@
> > +package org.apache.synapse.axis2;
> > +
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.context.MessageContext;
> > +import org.apache.axis2.engine.MessageReceiver;
> > +
> > +public class E4XMediatorMessageReceiver implements MessageReceiver {
> > +
> > + public void receive(MessageContext arg0) throws AxisFault {
> > + // TODO Auto-generated method stub
> > +
> > + }
> > +
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,38 @@
> > +package org.apache.synapse.axis2;
> > +
> > +
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.context.MessageContext;
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.engine.MessageReceiver;
> > +import org.apache.synapse.Constants;
> > +import org.apache.synapse.Mediator;
> > +import org.apache.synapse.mediators.SpringMediatorConfiguration;
> > +
> > +import org.springframework.context.support.GenericApplicationContext;
> > +
> > +public class SpringMessageReceiver implements MessageReceiver {
> > +
> > +
> > +
> > +
> > + public void receive(MessageContext mc) throws AxisFault {
> > + Mediator mediator = (Mediator) makeNewServiceObject(mc);
> > + boolean resp = mediator.mediate((SOAPMessageContext)mc);
> > + mc.setProperty(Constants.RESPONSE_PROPERTY, Boolean.valueOf(resp));
> > + }
> > +
> > +
> > + protected Object makeNewServiceObject(MessageContext msgContext) {
> > +
> > +
> > + SpringMediatorConfiguration medConfig =
> (SpringMediatorConfiguration)msgContext.getProperty(
> Constants.MEDIATOR_CONFIGURATION);
> > + GenericApplicationContext ctx = medConfig.getApplicationContext();
> > +
> > + Object o = ctx.getBean(medConfig.getMediatorName());
> > +
> > + return o;
> > + }
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,33 @@
> > +/*
> > + * 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.axis2;
> > +
> > +import org.apache.axis2.AxisFault;
> > +import org.apache.axis2.context.MessageContext;
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.engine.MessageReceiver;
> > +
> > +
> > +import org.apache.synapse.SynapseEnvironment;
> > +
> > +public class SynapseMessageReceiver implements MessageReceiver {
> > +
> > +
> > + public void receive(MessageContext mc) throws AxisFault {
> > + SynapseEnvironment env =
> Axis2SynapseEnvironmentFinder.getSynapseEnvironment(mc);
> > + env.injectMessage((SOAPMessageContext)mc);
> > + }
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,16 @@
> > +package org.apache.synapse.mediators;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorConfigurator;
> > +
> > +public class ClassMediatorConfigurator implements MediatorConfigurator
> {
> > +
> > + public MediatorConfiguration parse(OMElement el) {
> > + // TODO Auto-generated method stub
> > + return null;
> > + }
> > +
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,15 @@
> > +package org.apache.synapse.mediators;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorConfigurator;
> > +
> > +public class E4XMediatorConfigurator implements MediatorConfigurator {
> > +
> > + public MediatorConfiguration parse(OMElement el) {
> > + // TODO Auto-generated method stub
> > + return null;
> > + }
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,14 @@
> > +package org.apache.synapse.mediators;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorConfigurator;
> > +
> > +public class ServiceMediatorConfigurator implements
> MediatorConfigurator {
> > +
> > + public MediatorConfiguration parse(OMElement el) {
> > + // TODO Auto-generated method stub
> > + return null;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,49 @@
> > +package org.apache.synapse.mediators;
> > +
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorTypes;
> > +
> > +import org.springframework.context.support.GenericApplicationContext;
> > +
> > +
> > +public class SpringMediatorConfiguration implements
> MediatorConfiguration {
> > +
> > + private OMElement mediatorElement = null;
> > + private GenericApplicationContext ctx = null;
> > + private String name = null;
> > +
> > + public void setMediatorElement(OMElement me) {
> > + this.mediatorElement = me;
> > + }
> > +
> > + public OMElement getMediatorElement() {
> > +
> > + return mediatorElement;
> > + }
> > +
> > + public void setApplicationContext(GenericApplicationContext ctx) {
> > + this.ctx = ctx;
> > +
> > + }
> > + public GenericApplicationContext getApplicationContext() {
> > + return ctx;
> > + }
> > +
> > + public String getMediatorName() {
> > +
> > + return name;
> > +
> > + }
> > + public void setMediatorName(String name) {
> > + this.name=name;
> > + }
> > +
> > + public int getMediatorType() {
> > +
> > + return MediatorTypes.SPRING;
> > + }
> > +
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,63 @@
> > +package org.apache.synapse.mediators;
> > +
> > +import java.io.ByteArrayOutputStream;
> > +
> > +import java.util.Iterator;
> > +
> > +import javax.xml.namespace.QName;
> > +import javax.xml.stream.XMLOutputFactory;
> > +import javax.xml.stream.XMLStreamWriter;
> > +
> > +import org.apache.axis2.om.OMAttribute;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorConfigurator;
> > +import org.apache.synapse.SynapseException;
> > +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
> > +import org.springframework.context.support.GenericApplicationContext;
> > +import org.springframework.core.io.ByteArrayResource;
> > +
> > +public class SpringMediatorConfigurator implements MediatorConfigurator
> {
> > +
> > +
> > + public MediatorConfiguration parse(OMElement el) {
> > +
> > + OMAttribute name = el.getAttribute(new QName(el.getNamespace().getName(),
> "name"));
> > + if (name == null) throw new SynapseException("missing name attribute
> on "+el.toString());
> > + ByteArrayOutputStream baos = new ByteArrayOutputStream();
> > + try {
> > + baos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE beans
> PUBLIC \"-//SPRING//DTD BEAN//EN\" \"
> http://www.springframework.org/dtd/spring-beans.dtd\">"
> > + .getBytes());
> > + XMLStreamWriter xsw = XMLOutputFactory.newInstance
> ().createXMLStreamWriter(baos);
> > + OMElement beans = null;
> > + Iterator it = el.getChildElements();
> > + while (it.hasNext()) {
> > + OMElement ths = (OMElement)it.next();
> > + if (ths.getLocalName().toLowerCase().equals("beans")) {
> > + beans = ths;
> > + break;
> > + }
> > + }
> > + if (beans==null) throw new SynapseException("<beans> element not found
> in "+el.toString());
> > + xsw.setDefaultNamespace(beans.getNamespace().getName());
> > + beans.serialize(xsw);
> > + } catch (Exception e) {
> > + throw new SynapseException(e);
> > + }
> > +
> > + GenericApplicationContext ctx = new GenericApplicationContext();
> > + XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(
> > + ctx);
> > + xbdr.setValidating(false);
> > + xbdr.loadBeanDefinitions(new ByteArrayResource(baos.toByteArray()));
> > +
> > + SpringMediatorConfiguration mc = new SpringMediatorConfiguration();
> > + mc.setMediatorElement(el);
> > + mc.setApplicationContext(ctx);
> > + mc.setMediatorName(name.getAttributeValue());
> > + return mc;
> > + }
> > +
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine%241.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,33 @@
> > +package org.apache.synapse.ruleEngines;
> > +
> > +import javax.xml.namespace.QName;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.om.OMElement;
> > +
> > +
> > +public class AllRuleEngine extends OnceRuleEngine {
> > + private static final QName ALL_RULE_Q = new QName(
> > + "http://ws.apache.org/synapse/ns/allrule", "rule");
> > +
> > + public static final RuleCondition always = new RuleCondition() {
> > + public boolean matches(SOAPMessageContext smc) {
> > + return true;
> > + }
> > +
> > + };
> > +
> > + public RuleCondition getRuleCondition(OMElement om) {
> > + return always;
> > + }
> > +
> > + public QName getRuleQName() {
> > + return ALL_RULE_Q;
> > + }
> > +
> > + public String getRulesetType() {
> > + return "all";
> > +
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,73 @@
> > +/*
> > + * 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.ruleEngines;
> > +
> > +import java.util.Iterator;
> > +import java.util.LinkedList;
> > +import java.util.List;
> > +
> > +import javax.xml.namespace.QName;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.MediatorConfiguration;
> > +
> > +import org.apache.synapse.RuleEngine;
> > +
> > +
> > +import org.apache.synapse.SynapseEnvironment;
> > +
> > +// This implements a class of rule engine. These rule engines have a
> specific
> > +// behaviour which is to
> > +//
> > +public abstract class OnceRuleEngine implements RuleEngine {
> > +
> > + private List rules = new LinkedList();
> > +
> > + public abstract RuleCondition getRuleCondition(OMElement om);
> > +
> > + public abstract QName getRuleQName();
> > +
> > + public void init(OMElement om) {
> > + Iterator it = om.getChildrenWithName(getRuleQName());
> > + while (it.hasNext()) {
> > + OMElement rule = (OMElement) it.next();
> > + Rule ra = new Rule();
> > + ra.init(rule);
> > + ra.setRuleCondition(getRuleCondition(om));
> > + rules.add(ra);
> > +
> > + }
> > +
> > + }
> > +
> > + public boolean process(SynapseEnvironment se, SOAPMessageContext smc)
> {
> > + Iterator it = rules.iterator();
> > + while (it.hasNext()) {
> > +
> > + Rule ra = (Rule) it.next();
> > + RuleCondition rc = ra.getRuleCondition();
> > + if (rc.matches(smc)) {
> > + MediatorConfiguration mc = ra.getMediatorConfiguration();
> > + boolean ret = se.executeMediator(mc, smc);
> > + if (!ret)
> > + return false;
> > + }
> > + }
> > + return true;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,44 @@
> > +/*
> > + * 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.ruleEngines;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.RuleEngine;
> > +
> > +
> > +import org.apache.synapse.SynapseEnvironment;
> > +
> > +public class RegexRuleEngine implements RuleEngine {
> > +
> > +
> > + // TBD
> > + public String getRulesetType() {
> > + return RuleEngineTypes.REGEX;
> > + }
> > +
> > + public void init(OMElement om) {
> > +
> > +
> > + }
> > +
> > +
> > + public boolean process(SynapseEnvironment sc, SOAPMessageContext smc)
> {
> > + // TODO Auto-generated method stub
> > + return false;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,50 @@
> > +package org.apache.synapse.ruleEngines;
> > +
> > +import java.util.Iterator;
> > +
> > +import org.apache.axis2.om.OMAttribute;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.synapse.Constants;
> > +import org.apache.synapse.MediatorConfiguration;
> > +import org.apache.synapse.MediatorConfigurator;
> > +import org.apache.synapse.MediatorTypes;
> > +import org.apache.synapse.SynapseException;
> > +
> > +public class Rule {
> > + private RuleCondition rc = null;
> > + private MediatorConfiguration mc = null;
> > + private int mediatorType = 0;
> > +
> > + public void init(OMElement ruleContainer) {
> > + Iterator it = ruleContainer.getChildrenWithName(Constants.MEDIATOR_Q);
> > + if (it.hasNext()) {
> > + OMElement med = (OMElement)it.next(); // only use first mediator
> > + OMAttribute type = med.getAttribute(Constants.TYPE_ATT_Q);
> > + if (type==null) throw new SynapseException("no type declaration on
> "+med.toString());
> > + MediatorConfigurator config = MediatorTypes.getMediatorConfigurator(
> type.getAttributeValue());
> > + mc = config.parse(med);
> > + mediatorType = MediatorTypes.getType(type.getAttributeValue());
> > + }
> > + // deal with QoS apply elements here TODO
> > + }
> > +
> > + //public QoS getQoS();
> > +
> > + public MediatorConfiguration getMediatorConfiguration() {
> > + return mc;
> > + }
> > + public int getMediatorType() {
> > + return mediatorType;
> > + }
> > +
> > +
> > + public RuleCondition getRuleCondition() {
> > + return rc;
> > + }
> > + public void setRuleCondition(RuleCondition rc) {
> > + this.rc = rc;
> > + }
> > +
> > +
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,11 @@
> > +package org.apache.synapse.ruleEngines;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +
> > +
> > +
> > +public interface RuleCondition {
> > +
> > + boolean matches(SOAPMessageContext smc);
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,35 @@
> > +/*
> > + * 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.ruleEngines;
> > +
> > +import org.apache.synapse.RuleEngine;
> > +
> > +public class RuleEngineTypes {
> > + // this class could be replaced with a dynamic registry bootstrapped
> using JAR services
> > +
> > + public static final String XPATH="xpath";
> > + public static final String REGEX="regex";
> > + public static final String ALL="all";
> > +
> > +
> > + public static RuleEngine getRuleEngine(String type) {
> > + if (type.toLowerCase().equals(XPATH)) return new XPathRuleEngine();
> > + else if (type.toLowerCase().equals(REGEX)) return new
> RegexRuleEngine();
> > + else if (type.toLowerCase().equals(ALL)) return new AllRuleEngine();
> > + return null;
> > + }
> > +
> > +}
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine%24XPathRuleCondition.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class?rev=332618&view=auto
> >
> ==============================================================================
> > Binary file - no diff available.
> >
> > Propchange:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
> >
> ------------------------------------------------------------------------------
> > svn:mime-type = application/octet-stream
> >
> > Added:
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> > URL:
> http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java?rev=332618&view=auto
> >
> ==============================================================================
> > ---
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> (added)
> > +++
> incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> Fri Nov 11 09:41:11 2005
> > @@ -0,0 +1,62 @@
> > +package org.apache.synapse.ruleEngines;
> > +
> > +import java.util.Iterator;
> > +
> > +import javax.xml.namespace.QName;
> > +
> > +import org.apache.axis2.context.SOAPMessageContext;
> > +import org.apache.axis2.om.OMAttribute;
> > +import org.apache.axis2.om.OMElement;
> > +import org.apache.axis2.om.xpath.AXIOMXPath;
> > +
> > +import org.apache.synapse.SynapseException;
> > +import org.jaxen.JaxenException;
> > +
> > +public class XPathRuleEngine extends OnceRuleEngine {
> > + private static final String XPATH_NS = "
> http://ws.apache.org/synapse/ns/xpathrule";
> > + private static final QName XPATH_RULE_Q = new QName(
> > + XPATH_NS, "rule", "xpath");
> > + private static final QName XPATH_CONDITION_ATT_Q = new QName(XPATH_NS,
> "xpath");
> > +
> > + public RuleCondition getRuleCondition(OMElement om) {
> > + OMAttribute xpath=om.getAttribute(XPATH_CONDITION_ATT_Q);
> > + if (xpath==null) {
> > + throw new SynapseException("rule must have xpath attribute:
> "+om.toString());
> > + }
> > + RuleCondition rc = null;
> > + try {
> > + rc = new XPathRuleCondition(om.getAllDeclaredNamespaces(),
> xpath.getAttributeValue().trim());
> > + }
> > + catch (JaxenException e) {
> > + throw new SynapseException("Problem with xpath expression
> "+xpath.getAttributeValue(), e);
> > + }
> > + return rc;
> > + }
> > +
> > + public QName getRuleQName() {
> > + return XPATH_RULE_Q;
> > + }
> > +
> > + protected class XPathRuleCondition implements RuleCondition {
> > + private AXIOMXPath xp = null;
> > + protected XPathRuleCondition(Iterator namespaces, String xpath) throws
> JaxenException {
> > +
> > + this.xp = new AXIOMXPath(xpath);
> > + }
> > +
> > + public boolean matches(SOAPMessageContext smc) {
> > + try {
> > + return xp.booleanValueOf(smc.getEnvelope());
> > + } catch (JaxenException e) {
> > + throw new SynapseException ("Problem trying to evaluate
> "+xp.getRootExpr()+" on "+smc.getEnvelope().toString(),e);
> > +
> > + }
> > + }
> > + }
> > +
> > + public String getRulesetType() {
> > +
> > + return "xpath";
> > + }
> > +
> > +}
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>

Re: svn commit: r332618 - in /incubator/synapse/trunk/scratch/yomsp2: ./ src/ src/org/ src/org/apache/ src/org/apache/synapse/ src/org/apache/synapse/axis2/ src/org/apache/synapse/mediators/ src/org/apache/synapse/ruleEngines/

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Um you didn't mean to commit the .class files right? :).

Sanjiva.

On Fri, 2005-11-11 at 17:43 +0000, pzf@apache.org wrote:
> Author: pzf
> Date: Fri Nov 11 09:41:11 2005
> New Revision: 332618
> 
> URL: http://svn.apache.org/viewcvs?rev=332618&view=rev
> Log:
> multiple edits... getting close to running in Axis2
> 
> Added:
>     incubator/synapse/trunk/scratch/yomsp2/
>     incubator/synapse/trunk/scratch/yomsp2/src/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class   (with props)
>     incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ConfigurationAware.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,6 @@
> +package org.apache.synapse;
> +
> +public interface ConfigurationAware {
> +	public void setMediationConfiguration(MediatorConfiguration mc);
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Constants.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,71 @@
> +/*
> + * 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;
> +
> +import javax.xml.namespace.QName;
> +
> +public class Constants {
> +	public static final String SPRINGMEDIATOR = "springmediator";
> +
> +	public static final String SYNAPSE_MEDIATOR_SPRING_BEAN_FACTORY = "synapse.mediator.spring.beanFactory";
> +
> +	public static final String SYNAPSE_SPRING_MEDIATOR_NAME = "synapse.spring.mediatorName";
> +
> +	public static final String CLASSMEDIATOR = "classmediator";
> +
> +	public static final String SYNAPSE_MEDIATOR_CLASS = "synapse.mediator.class";
> +
> +	public static final String MEDIATE_OPERATION_NAME = "mediate";
> +
> +
> +
> +	
> +	public static final String SYNAPSE_MEDIATOR_XML_BYTES = "synapse.mediator.xml.bytes";
> +
> +	public static final String BPELMEDIATOR = "bpelmediator";
> +
> +	public static final String SYNAPSE_NAMESPACE = "http://ws.apache.org/ns/synapse";
> +
> +	public static final String SYNAPSE = "synapse";
> +
> +	public static final String MEDIATOR = "mediator";
> +
> +	public static final String RULESET = "ruleset";
> +
> +	public static final String TYPE = "type";
> +
> +	public static final QName RULESET_Q = new QName(SYNAPSE_NAMESPACE, RULESET);
> +	public static final QName MEDIATOR_Q = new QName(SYNAPSE_NAMESPACE, MEDIATOR);
> +
> +	
> +	public static final QName TYPE_ATT_Q = new QName(SYNAPSE_NAMESPACE,
> +			TYPE);
> +	public static final QName RULESET_NAME_ATT_Q = new QName(SYNAPSE_NAMESPACE,
> +			"name");
> +
> +	public static final QName PHASE_ORDER_ATTR_Q = new QName(SYNAPSE_NAMESPACE,
> +			"order");
> +
> +	public static final String INPHASE = "inphase";
> +
> +	public static final String OUTPHASE = "outphase";
> +
> +	public static final String MEDIATOR_CONFIGURATION = "synapse.mediator.configuration";
> +
> +	public static final String RESPONSE_PROPERTY = "synapse.mediator.response";
> +
> +	public static final String ISRESPONSE_PROPERTY = "synapse.isresponse";
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/EnvironmentAware.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,6 @@
> +package org.apache.synapse;
> +
> +public interface EnvironmentAware {
> +	public void setSynapseEnvironment(SynapseEnvironment se);
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/Mediator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,22 @@
> +/*
> + * 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;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +
> +public interface Mediator {
> +    public boolean mediate(SOAPMessageContext smc);
> +}
> \ No newline at end of file
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfiguration.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,9 @@
> +package org.apache.synapse;
> +
> +import org.apache.axis2.om.OMElement;
> +
> +public interface MediatorConfiguration {
> +	OMElement getMediatorElement();
> +	String getMediatorName();
> +	int getMediatorType();
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -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;
> +
> +import org.apache.axis2.om.OMElement;
> +
> +public interface MediatorConfigurator {
> +	    MediatorConfiguration parse(OMElement el);
> +	
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/MediatorTypes.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,55 @@
> +/*
> + * 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;
> +
> +import org.apache.synapse.mediators.ClassMediatorConfigurator;
> +import org.apache.synapse.mediators.E4XMediatorConfigurator;
> +import org.apache.synapse.mediators.ServiceMediatorConfigurator;
> +import org.apache.synapse.mediators.SpringMediatorConfigurator;
> +
> +public class MediatorTypes {
> +	
> +	public static final int SERVICE=0, SPRING=1, E4X=2, CLASS=3;
> +	public static final String STRSERVICE = "service", STRCLASS = "class", STRSPRING = "spring", STRE4X = "e4x";
> +
> +	
> +	public static MediatorConfigurator getMediatorConfigurator(String attributeValue) {
> +		String type = attributeValue.toLowerCase().trim();
> +		if (type.equals(STRSPRING))  
> +			return new SpringMediatorConfigurator();
> +		else if (type.equals(STRSERVICE)) 
> +			return new ServiceMediatorConfigurator();
> +		else if (type.equals(STRE4X))
> +			return new E4XMediatorConfigurator();
> +		else if (type.equals(STRCLASS)) 
> +			return new ClassMediatorConfigurator();
> +		else return null;
> +	}
> +
> +	public static int getType(String attributeValue) {
> +		String type = attributeValue.toLowerCase().trim();
> +		if (type.equals("spring"))  
> +			return SPRING;
> +		else if (type.equals("service")) 
> +			return SERVICE;
> +		else if (type.equals("e4x"))
> +			return E4X;
> +		else if (type.equals("class")) 
> +			return CLASS;
> +		else return -1;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ResponseIdentifier.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,20 @@
> +package org.apache.synapse;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +
> +public class ResponseIdentifier {
> +
> +	public static boolean isResponse(SOAPMessageContext smc) {
> +		Boolean bool = (Boolean)smc.getProperty(Constants.ISRESPONSE_PROPERTY);
> +		if (bool==null) {
> +			// TODO figure it out
> +			return false;
> +		}
> +		else
> +			return bool.booleanValue();
> +	}
> +	public static void setResponse(SOAPMessageContext smc, boolean b) {
> +		smc.setProperty(Constants.ISRESPONSE_PROPERTY, new Boolean(b));
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/RuleEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,32 @@
> +/*
> + * 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;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.om.OMElement;
> +
> +public interface RuleEngine {
> +
> +	public String getRulesetType();
> +
> +	public void init(OMElement om); // gets passed the <synapse:ruleset>
> +									// element.
> +
> +	public boolean process(SynapseEnvironment sc, SOAPMessageContext smc); // stateless
> +																	// per
> +																	// invocation
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,68 @@
> +/*
> + * 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;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +
> +
> +
> +
> +public class SynapseEngine {
> +
> +	private RuleEngine[] inphase = null, outphase = null;
> +
> +	private boolean inoutseparate = false;
> +	
> +	private SynapseEnvironment se = null;
> +
> +	public void processMessage(SOAPMessageContext smc) {
> +		SynapseEnvironment se = getSynapseEnvironment();
> +		if (inoutseparate && ResponseIdentifier.isResponse(smc)) {
> +				for (int i=0; i<outphase.length;i++) {
> +					boolean ret = outphase[i].process(se, smc);
> +					if (ret) break;
> +				}
> +			
> +		}else {
> +			for (int i=0; i<inphase.length;i++) {
> +				boolean ret = inphase[i].process(se, smc);
> +				if (ret) break;
> +			}
> +		}
> +	}
> +	
> +	
> +	
> +	public SynapseEnvironment getSynapseEnvironment() {
> +		return se;
> +	}
> +
> +	public void setInphase(RuleEngine[] inphase) {
> +		this.inphase = inphase;
> +	}
> +
> +
> +	public void setOutphase(RuleEngine[] outphase) {
> +		this.outphase = outphase;
> +	}
> +
> +
> +	void setInoutseparate(boolean inoutseparate) {
> +		this.inoutseparate = inoutseparate;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEngineConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,140 @@
> +/*
> + * 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;
> +
> +
> +import java.util.HashMap;
> +
> +import java.util.LinkedList;
> +import java.util.List;
> +import java.util.Map;
> +
> +import org.apache.axis2.om.OMAttribute;
> +import org.apache.axis2.om.OMElement;
> +
> +import org.apache.axis2.om.OMNode;
> +import org.apache.synapse.ruleEngines.RuleEngineTypes;
> +
> +
> +public class SynapseEngineConfigurator {
> +
> +	
> +	public static void parse(SynapseEngine se, OMElement om) {
> +		List rulesets = new LinkedList();
> +
> +		RuleEngine[] inphase = null, outphase = null;
> +
> +		Map ruleSetNames = new HashMap();
> +
> +		boolean inoutseparate = false;
> +		String inPhaseNames = null, outPhaseNames = null;
> +		if (!om.getLocalName().equals(Constants.SYNAPSE)
> +				|| !om.getNamespace().getName().equals(
> +						Constants.SYNAPSE_NAMESPACE)) {
> +			throw new SynapseException("OMElement is not of namespace "
> +					+ Constants.SYNAPSE_NAMESPACE + "or not localname "
> +					+ Constants.SYNAPSE);
> +		}
> +
> +		OMNode node = om.getFirstOMChild();
> +		while (node != null) {
> +
> +			if (node.getType() != OMNode.ELEMENT_NODE) {
> +				node = node.getNextOMSibling();
> +				continue;
> +			} // loop thru Elements only
> +
> +			OMElement el = (OMElement) node;
> +
> +			if (el.getNamespace().getName().toLowerCase().equals(
> +					Constants.SYNAPSE_NAMESPACE)) {
> +				node = node.getNextOMSibling();
> +				continue;
> +			} // ignore non-synapse elements
> +
> +			if (el.getLocalName().toLowerCase().equals(Constants.RULESET)) {
> +				OMAttribute attr = el
> +						.getAttribute(Constants.TYPE_ATT_Q);
> +				String type = attr.getAttributeValue();
> +				RuleEngine re = RuleEngineTypes.getRuleEngine(type);
> +				if (re != null) {
> +					re.init(el);
> +				}
> +				rulesets.add(re);
> +				OMAttribute name = el
> +						.getAttribute(Constants.RULESET_NAME_ATT_Q);
> +				if (name != null) {
> +					ruleSetNames.put(name.getAttributeValue(), re);
> +				}
> +			} else if (el.getLocalName().toLowerCase()
> +					.equals(Constants.INPHASE)) {
> +				OMAttribute attr = el
> +						.getAttribute(Constants.PHASE_ORDER_ATTR_Q);
> +				if (attr != null) {
> +					inPhaseNames = attr.getAttributeValue();
> +				}
> +			} else if (el.getLocalName().equals(Constants.OUTPHASE)) {
> +				OMAttribute attr = el
> +						.getAttribute(Constants.PHASE_ORDER_ATTR_Q);
> +				if (attr != null) {
> +					outPhaseNames = attr.getAttributeValue();
> +				}
> +
> +			}
> +		}
> +		if (inPhaseNames != null || outPhaseNames != null) {
> +			inoutseparate = true;
> +			String inOrder[] = parsePhaseOrder(inPhaseNames);
> +			inphase = new RuleEngine[inOrder.length];
> +			for (int i = 0; i < inOrder.length; i++) {
> +				RuleEngine r = (RuleEngine) ruleSetNames.get(inOrder[i]);
> +				if (r == null) {
> +					throw new SynapseException(
> +							"missing ruleset specified in inPhase order: "
> +									+ inOrder[i]);
> +				} else
> +					inphase[i] = r;
> +			}
> +			String outOrder[] = parsePhaseOrder(outPhaseNames);
> +			outphase = new RuleEngine[outOrder.length];
> +			for (int i = 0; i < outOrder.length; i++) {
> +				RuleEngine r = (RuleEngine) ruleSetNames.get(outOrder[i]);
> +				if (r == null) {
> +					throw new SynapseException(
> +							"missing ruleset specified in outPhase order: "
> +									+ outOrder[i]);
> +				} else
> +					outphase[i] = r;
> +			}
> +		} else {
> +			inphase = new RuleEngine[rulesets.size()];
> +			for (int i=0;i<inphase.length;i++) {
> +				inphase[i] = (RuleEngine)rulesets.get(i);
> +			}
> +			
> +			
> +		}
> +		se.setInoutseparate(inoutseparate);
> +		se.setInphase(inphase);
> +		se.setOutphase(outphase);
> +		
> +	}	
> +
> +	private static String[] parsePhaseOrder(String order) {
> +		return order.trim().toLowerCase().split("[ \t\n\f\r]+");
> +	}
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseEnvironment.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,26 @@
> +/*
> + * 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;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +
> +public interface SynapseEnvironment {
> +	
> +	public void injectMessage(SOAPMessageContext smc);
> +	
> +	public boolean executeMediator(MediatorConfiguration mc, SOAPMessageContext smc);
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/SynapseException.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,34 @@
> +/*
> + * 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;
> +
> +public class SynapseException extends RuntimeException {
> +
> +	private static final long serialVersionUID = -7244032125641596311L;
> +
> +	public SynapseException(String string) {
> +		super(string);
> +	}
> +
> +	public SynapseException(String msg, Throwable e) {
> +		super(msg, e);
> +	}
> +
> +	public SynapseException(Throwable t) {
> +		super(t);
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironment.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,125 @@
> +package org.apache.synapse.axis2;
> +
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.context.ConfigurationContext;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.context.OperationContext;
> +import org.apache.axis2.context.OperationContextFactory;
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.context.ServiceContext;
> +import org.apache.axis2.description.AxisOperation;
> +import org.apache.axis2.description.AxisService;
> +import org.apache.axis2.engine.AxisConfiguration;
> +import org.apache.axis2.engine.AxisEngine;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.axis2.util.Utils;
> +import org.apache.synapse.Constants;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorTypes;
> +
> +import org.apache.synapse.SynapseEngine;
> +import org.apache.synapse.SynapseEngineConfigurator;
> +import org.apache.synapse.SynapseEnvironment;
> +import org.apache.synapse.SynapseException;
> +import org.apache.synapse.mediators.SpringMediatorConfiguration;
> +
> +
> +public class Axis2SynapseEnvironment implements SynapseEnvironment {
> +	private SynapseEngine se = new SynapseEngine();
> +	
> +	public Axis2SynapseEnvironment(OMElement synapseConfiguration) {
> +		SynapseEngineConfigurator.parse(se, synapseConfiguration);
> +	}
> +	
> +	public void injectMessage(SOAPMessageContext smc) {
> +		
> +		se.processMessage(smc);
> +
> +	}
> +
> +	
> +
> +	public boolean executeMediator(MediatorConfiguration mc,
> +			SOAPMessageContext smc) {
> +		MessageContext messageContext = null;
> +		try {
> +			messageContext= (MessageContext)smc;
> +		}
> +		catch (ClassCastException cce) {
> +			throw new SynapseException("A non-Axis2 MC SOAPMessageContext has been passed to the Axis2 MediationExecutor",cce);
> +		}
> +		
> +		ConfigurationContext cc = messageContext.getSystemContext();
> +		AxisConfiguration ac = cc.getAxisConfiguration();
> +		AxisEngine ae = new AxisEngine(cc);
> +
> +		AxisService as = null;
> +		AxisOperation ao = null;
> +		messageContext.setProperty(
> +				Constants.MEDIATOR_CONFIGURATION, mc);
> +		
> +		try {
> +			switch (mc.getMediatorType()) { 
> +				case  MediatorTypes.SPRING: {
> +
> +					as = ac.getService(Constants.SPRINGMEDIATOR);
> +					if (as == null) throw new SynapseException("cannot locate service " +Constants.SPRINGMEDIATOR);
> +					((SpringMediatorConfiguration)mc).getApplicationContext().setClassLoader(as.getClassLoader());
> +					((SpringMediatorConfiguration)mc).getApplicationContext().refresh();
> +					
> +					break;
> +					
> +				}
> +				case MediatorTypes.SERVICE: {
> +					as = ac.getService(mc.getMediatorName());
> +					if (as == null) throw new SynapseException("cannot locate service " +mc.getMediatorName());
> +					break;
> +				}
> +				case MediatorTypes.CLASS: {
> +					as = ac.getService(Constants.CLASSMEDIATOR);
> +					if (as==null) throw new SynapseException("cannot locate service "+Constants.CLASSMEDIATOR);
> +					Class c = null;
> +					try {
> +						c = as.getClassLoader().loadClass(mc.getMediatorName());
> +					} catch (ClassNotFoundException ce) {
> +						throw new SynapseException(ce);
> +					}
> +
> +					messageContext.setProperty(Constants.SYNAPSE_MEDIATOR_CLASS, c);
> +					
> +					break;
> +					
> +				}
> +					
> +			}
> +			
> +			
> +
> +			ao = as.getOperation(Constants.MEDIATE_OPERATION_NAME);
> +			OperationContext oc = OperationContextFactory
> +					.createOperationContext(ao.getAxisSpecifMEPConstant(), ao);
> +			ao.registerOperationContext(messageContext, oc);
> +
> +			ServiceContext sc = Utils.fillContextInformation(ao, as, cc);
> +			oc.setParent(sc);
> +			messageContext.setOperationContext(oc);
> +			messageContext.setServiceContext(sc);
> +
> +			messageContext.setAxisOperation(ao);
> +			messageContext.setAxisService(as);
> +			ae.receive(messageContext);
> +
> +		} catch (AxisFault e) {
> +			throw new SynapseException(e);
> +
> +		}
> +
> +		return ((Boolean) messageContext
> +				.getProperty(Constants.RESPONSE_PROPERTY))
> +				.booleanValue();
> +
> +		
> +	}
> +
> +	
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/Axis2SynapseEnvironmentFinder.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,61 @@
> +package org.apache.synapse.axis2;
> +
> +import java.io.InputStream;
> +
> +
> +import javax.xml.stream.XMLStreamException;
> +
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.description.Parameter;
> +import org.apache.axis2.description.ParameterImpl;
> +import org.apache.axis2.engine.AxisConfiguration;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
> +
> +import org.apache.synapse.SynapseEnvironment;
> +import org.apache.synapse.SynapseException;
> +
> +public class Axis2SynapseEnvironmentFinder {
> +
> +	private static final String SYNAPSECONFIGURATION = "SynapseConfiguration";
> +
> +	public static final String SYNAPSE_ENVIRONMENT = "synapse.environment";
> +
> +	public static synchronized SynapseEnvironment getSynapseEnvironment(MessageContext mc) {
> +		AxisConfiguration ac = mc.getSystemContext().getAxisConfiguration();
> +		Parameter synapseEnvParam = ac.getParameter(SYNAPSE_ENVIRONMENT);
> +		if (synapseEnvParam == null) {
> +
> +			Parameter param = ac.getParameter(SYNAPSECONFIGURATION);
> +			if (param == null) {
> +				throw new SynapseException("no parameter '" + SYNAPSECONFIGURATION
> +						+ "' in axis2.xml");
> +			}
> +			String synapseConfig = (String) param.getValue();
> +			InputStream is = mc.getAxisService().getClassLoader().getResourceAsStream(synapseConfig);
> +			
> +			StAXOMBuilder builder;
> +			try {
> +				builder =  new StAXOMBuilder(is);
> +
> +			} catch (XMLStreamException e1) {
> +				throw new SynapseException("Trouble parsing Synapse Configuration ",e1);
> +				
> +			}		
> +			OMElement config = builder.getDocumentElement();
> +			Axis2SynapseEnvironment se = new Axis2SynapseEnvironment(config);
> +		
> +			synapseEnvParam = new ParameterImpl(SYNAPSE_ENVIRONMENT, null);
> +			synapseEnvParam.setValue(se);
> +			try {
> +				ac.addParameter(synapseEnvParam);
> +			} catch (AxisFault e) {
> +				throw new SynapseException(e);
> +			}
> +		}
> +		return (SynapseEnvironment) synapseEnvParam.getValue();
> +		
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/E4XMediatorMessageReceiver.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,16 @@
> +package org.apache.synapse.axis2;
> +
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.engine.MessageReceiver;
> +
> +public class E4XMediatorMessageReceiver implements MessageReceiver {
> +
> +	public void receive(MessageContext arg0) throws AxisFault {
> +		// TODO Auto-generated method stub
> +		
> +	}
> +
> +
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SpringMessageReceiver.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,38 @@
> +package org.apache.synapse.axis2;
> +
> +
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.engine.MessageReceiver;
> +import org.apache.synapse.Constants;
> +import org.apache.synapse.Mediator;
> +import org.apache.synapse.mediators.SpringMediatorConfiguration;
> +
> +import org.springframework.context.support.GenericApplicationContext;
> +
> +public class SpringMessageReceiver implements MessageReceiver {
> +
> +
> +    
> +	
> +    public void receive(MessageContext mc) throws AxisFault {
> +        Mediator mediator = (Mediator) makeNewServiceObject(mc);
> +        boolean resp = mediator.mediate((SOAPMessageContext)mc);
> +        mc.setProperty(Constants.RESPONSE_PROPERTY, Boolean.valueOf(resp));
> +    }
> +
> +    
> +    protected Object makeNewServiceObject(MessageContext msgContext) {
> +    	
> +        
> +        SpringMediatorConfiguration medConfig = (SpringMediatorConfiguration)msgContext.getProperty(Constants.MEDIATOR_CONFIGURATION);
> +        GenericApplicationContext ctx = medConfig.getApplicationContext();
> +        
> +        Object o = ctx.getBean(medConfig.getMediatorName());
> +       	        
> +        return o;
> +    }
> +	
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/axis2/SynapseMessageReceiver.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,33 @@
> +/*
> + * 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.axis2;
> +
> +import org.apache.axis2.AxisFault;
> +import org.apache.axis2.context.MessageContext;
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.engine.MessageReceiver;
> +
> +
> +import org.apache.synapse.SynapseEnvironment;
> +
> +public class SynapseMessageReceiver implements MessageReceiver {
> +	
> +	
> +	public void receive(MessageContext mc) throws AxisFault {
> +		SynapseEnvironment env = Axis2SynapseEnvironmentFinder.getSynapseEnvironment(mc);
> +		env.injectMessage((SOAPMessageContext)mc);
> +	}
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ClassMediatorConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,16 @@
> +package org.apache.synapse.mediators;
> +
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorConfigurator;
> +
> +public class ClassMediatorConfigurator implements MediatorConfigurator {
> +
> +	public MediatorConfiguration parse(OMElement el) {
> +		// TODO Auto-generated method stub
> +		return null;
> +	}
> +
> +
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/E4XMediatorConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,15 @@
> +package org.apache.synapse.mediators;
> +
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorConfigurator;
> +
> +public class E4XMediatorConfigurator implements MediatorConfigurator {
> +
> +	public MediatorConfiguration parse(OMElement el) {
> +		// TODO Auto-generated method stub
> +		return null;
> +	}
> +
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/ServiceMediatorConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,14 @@
> +package org.apache.synapse.mediators;
> +
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorConfigurator;
> +
> +public class ServiceMediatorConfigurator implements MediatorConfigurator {
> +
> +	public MediatorConfiguration parse(OMElement el) {
> +		// TODO Auto-generated method stub
> +		return null;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfiguration.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,49 @@
> +package org.apache.synapse.mediators;
> +
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorTypes;
> +
> +import org.springframework.context.support.GenericApplicationContext;
> +
> +
> +public class SpringMediatorConfiguration implements MediatorConfiguration {
> +
> +	private OMElement mediatorElement = null;
> +	private GenericApplicationContext ctx = null;
> +	private String name = null;
> +	
> +	public void setMediatorElement(OMElement me) {
> +		this.mediatorElement = me;
> +	}
> +	
> +	public OMElement getMediatorElement() {
> +	
> +		return mediatorElement;
> +	}
> +
> +	public void setApplicationContext(GenericApplicationContext ctx) {
> +		this.ctx = ctx;
> +		
> +	}
> +	public GenericApplicationContext getApplicationContext() {
> +		return ctx;
> +	}
> +
> +	public String getMediatorName() {
> +		
> +		return name;
> +		
> +	}
> +	public void setMediatorName(String name) {
> +		this.name=name;
> +	}
> +
> +	public int getMediatorType() {
> +		
> +		return MediatorTypes.SPRING;
> +	}
> +	
> +
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/mediators/SpringMediatorConfigurator.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,63 @@
> +package org.apache.synapse.mediators;
> +
> +import java.io.ByteArrayOutputStream;
> +
> +import java.util.Iterator;
> +
> +import javax.xml.namespace.QName;
> +import javax.xml.stream.XMLOutputFactory;
> +import javax.xml.stream.XMLStreamWriter;
> +
> +import org.apache.axis2.om.OMAttribute;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorConfigurator;
> +import org.apache.synapse.SynapseException;
> +import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
> +import org.springframework.context.support.GenericApplicationContext;
> +import org.springframework.core.io.ByteArrayResource;
> +
> +public class SpringMediatorConfigurator implements MediatorConfigurator {
> +	
> +	
> +	public MediatorConfiguration parse(OMElement el) {
> +	    
> +		OMAttribute name = el.getAttribute(new QName(el.getNamespace().getName(), "name"));
> +		if (name == null) throw new SynapseException("missing name attribute on "+el.toString());
> +		ByteArrayOutputStream baos = new ByteArrayOutputStream();
> +		try {
> +			baos.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE beans PUBLIC \"-//SPRING//DTD BEAN//EN\" \"http://www.springframework.org/dtd/spring-beans.dtd\">"
> +							.getBytes());
> +			XMLStreamWriter xsw = XMLOutputFactory.newInstance().createXMLStreamWriter(baos);
> +			OMElement beans = null;
> +			Iterator it = el.getChildElements();
> +			while (it.hasNext()) {
> +				OMElement ths = (OMElement)it.next();
> +				if (ths.getLocalName().toLowerCase().equals("beans")) {
> +					beans = ths;
> +					break;
> +				}
> +			}
> +			if (beans==null) throw new SynapseException("<beans> element not found in "+el.toString());
> +			xsw.setDefaultNamespace(beans.getNamespace().getName());
> +			beans.serialize(xsw);
> +		} catch (Exception e) {
> +			throw new SynapseException(e);
> +		} 
> +				
> +		GenericApplicationContext ctx = new GenericApplicationContext();
> +		XmlBeanDefinitionReader xbdr = new XmlBeanDefinitionReader(
> +				ctx);
> +		xbdr.setValidating(false);
> +		xbdr.loadBeanDefinitions(new ByteArrayResource(baos.toByteArray()));
> +		
> +		SpringMediatorConfiguration mc = new SpringMediatorConfiguration();
> +		mc.setMediatorElement(el);
> +		mc.setApplicationContext(ctx);
> +		mc.setMediatorName(name.getAttributeValue());
> +		return mc;
> +	}
> +
> +
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine%241.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine$1.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/AllRuleEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,33 @@
> +package org.apache.synapse.ruleEngines;
> +
> +import javax.xml.namespace.QName;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.om.OMElement;
> +
> +
> +public class AllRuleEngine extends OnceRuleEngine {
> +	private static final QName ALL_RULE_Q = new QName(
> +			"http://ws.apache.org/synapse/ns/allrule", "rule");
> +
> +	public static final RuleCondition always = new RuleCondition() {
> +		public boolean matches(SOAPMessageContext smc) {
> +			return true;
> +		}
> +
> +	};
> +
> +	public RuleCondition getRuleCondition(OMElement om) {
> +		return always;
> +	}
> +
> +	public QName getRuleQName() {
> +		return ALL_RULE_Q;
> +	}
> +
> +	public String getRulesetType() {
> +		return "all";
> +		
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/OnceRuleEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,73 @@
> +/*
> + * 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.ruleEngines;
> +
> +import java.util.Iterator;
> +import java.util.LinkedList;
> +import java.util.List;
> +
> +import javax.xml.namespace.QName;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.MediatorConfiguration;
> +
> +import org.apache.synapse.RuleEngine;
> +
> +
> +import org.apache.synapse.SynapseEnvironment;
> +
> +// This implements a class of rule engine. These rule engines have a specific
> +// behaviour which is to
> +// 
> +public abstract class OnceRuleEngine implements RuleEngine {
> +
> +	private List rules = new LinkedList();
> +
> +	public abstract RuleCondition getRuleCondition(OMElement om);
> +
> +	public abstract QName getRuleQName();
> +
> +	public void init(OMElement om) {
> +		Iterator it = om.getChildrenWithName(getRuleQName());
> +		while (it.hasNext()) {
> +			OMElement rule = (OMElement) it.next();
> +			Rule ra = new Rule();
> +			ra.init(rule);
> +			ra.setRuleCondition(getRuleCondition(om));
> +			rules.add(ra);
> +
> +		}
> +
> +	}
> +
> +	public boolean process(SynapseEnvironment se, SOAPMessageContext smc) {
> +		Iterator it = rules.iterator();
> +		while (it.hasNext()) {
> +
> +			Rule ra = (Rule) it.next();
> +			RuleCondition rc = ra.getRuleCondition();
> +			if (rc.matches(smc)) {
> +				MediatorConfiguration mc = ra.getMediatorConfiguration();
> +				boolean ret = se.executeMediator(mc, smc);
> +				if (!ret)
> +					return false;
> +			}
> +		}
> +		return true;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RegexRuleEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,44 @@
> +/*
> + * 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.ruleEngines;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.RuleEngine;
> +
> +
> +import org.apache.synapse.SynapseEnvironment;
> +
> +public class RegexRuleEngine implements RuleEngine {
> +
> +	
> +	// TBD
> +	public String getRulesetType() {
> +		return RuleEngineTypes.REGEX;
> +	}
> +
> +	public void init(OMElement om) {
> +		
> +
> +	}
> +
> +
> +	public boolean process(SynapseEnvironment sc, SOAPMessageContext smc) {
> +		// TODO Auto-generated method stub
> +		return false;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/Rule.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,50 @@
> +package org.apache.synapse.ruleEngines;
> +
> +import java.util.Iterator;
> +
> +import org.apache.axis2.om.OMAttribute;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.synapse.Constants;
> +import org.apache.synapse.MediatorConfiguration;
> +import org.apache.synapse.MediatorConfigurator;
> +import org.apache.synapse.MediatorTypes;
> +import org.apache.synapse.SynapseException;
> +
> +public class Rule {
> +	private RuleCondition rc = null;
> +	private MediatorConfiguration mc = null;
> +	private int mediatorType = 0; 
> +	
> +	public void init(OMElement ruleContainer) {
> +		Iterator it = ruleContainer.getChildrenWithName(Constants.MEDIATOR_Q);
> +		if (it.hasNext()) {
> +			OMElement med = (OMElement)it.next(); // only use first mediator
> +			OMAttribute type = med.getAttribute(Constants.TYPE_ATT_Q);
> +			if (type==null) throw new SynapseException("no type declaration on "+med.toString());
> +			MediatorConfigurator config = MediatorTypes.getMediatorConfigurator(type.getAttributeValue());
> +			mc = config.parse(med);
> +			mediatorType = MediatorTypes.getType(type.getAttributeValue());
> +		}
> +		// deal with QoS apply elements here TODO
> +	}
> +	
> +	//public QoS getQoS();
> +	
> +	public MediatorConfiguration getMediatorConfiguration() {
> +		return mc;
> +	}
> +	public int getMediatorType() { 
> +		return mediatorType;
> +	}
> +	
> +	
> +	public RuleCondition getRuleCondition() {
> +		return rc;
> +	}
> +	public void setRuleCondition(RuleCondition rc) {
> +		this.rc = rc;
> +	}
> +	
> +	
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleCondition.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,11 @@
> +package org.apache.synapse.ruleEngines;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +
> +
> +
> +public interface RuleCondition {
> +
> +	boolean matches(SOAPMessageContext smc);
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/RuleEngineTypes.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,35 @@
> +/*
> + * 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.ruleEngines;
> +
> +import org.apache.synapse.RuleEngine;
> +
> +public class RuleEngineTypes {
> +	// this class could be replaced with a dynamic registry bootstrapped using JAR services 
> +	
> +	public static final String XPATH="xpath";
> +	public static final String REGEX="regex";
> +	public static final String ALL="all";
> +	
> +	
> +	public static RuleEngine getRuleEngine(String type) {
> +		if (type.toLowerCase().equals(XPATH)) return new XPathRuleEngine();
> +		else if (type.toLowerCase().equals(REGEX)) return new RegexRuleEngine();
> +		else if (type.toLowerCase().equals(ALL)) return new AllRuleEngine();
> +		return null;
> +	}
> +
> +}
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine%24XPathRuleCondition.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine$XPathRuleCondition.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class?rev=332618&view=auto
> ==============================================================================
> Binary file - no diff available.
> 
> Propchange: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.class
> ------------------------------------------------------------------------------
>     svn:mime-type = application/octet-stream
> 
> Added: incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java
> URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java?rev=332618&view=auto
> ==============================================================================
> --- incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java (added)
> +++ incubator/synapse/trunk/scratch/yomsp2/src/org/apache/synapse/ruleEngines/XPathRuleEngine.java Fri Nov 11 09:41:11 2005
> @@ -0,0 +1,62 @@
> +package org.apache.synapse.ruleEngines;
> +
> +import java.util.Iterator;
> +
> +import javax.xml.namespace.QName;
> +
> +import org.apache.axis2.context.SOAPMessageContext;
> +import org.apache.axis2.om.OMAttribute;
> +import org.apache.axis2.om.OMElement;
> +import org.apache.axis2.om.xpath.AXIOMXPath;
> +
> +import org.apache.synapse.SynapseException;
> +import org.jaxen.JaxenException;
> +
> +public class XPathRuleEngine extends OnceRuleEngine {
> +	private static final String XPATH_NS = "http://ws.apache.org/synapse/ns/xpathrule";
> +	private static final QName XPATH_RULE_Q = new QName(
> +			XPATH_NS, "rule", "xpath");
> +	private static final QName XPATH_CONDITION_ATT_Q = new QName(XPATH_NS, "xpath"); 
> +
> +	public RuleCondition getRuleCondition(OMElement om) {
> +		OMAttribute xpath=om.getAttribute(XPATH_CONDITION_ATT_Q);
> +		if (xpath==null) {
> +			throw new SynapseException("rule must have xpath attribute: "+om.toString());
> +		}
> +		RuleCondition rc = null;
> +		try {
> +			rc = new XPathRuleCondition(om.getAllDeclaredNamespaces(), xpath.getAttributeValue().trim());
> +		}
> +		catch (JaxenException e) {
> +			throw new SynapseException("Problem with xpath expression "+xpath.getAttributeValue(), e);
> +		}
> +		return rc;
> +	}
> +
> +	public QName getRuleQName() {
> +		return XPATH_RULE_Q;
> +	}
> +
> +	protected class XPathRuleCondition implements RuleCondition {
> +		private AXIOMXPath xp = null;
> +		protected XPathRuleCondition(Iterator namespaces, String xpath) throws JaxenException {
> +			
> +			this.xp = new AXIOMXPath(xpath);
> +		}
> +		
> +		public boolean matches(SOAPMessageContext smc) {
> +			try {
> +				return xp.booleanValueOf(smc.getEnvelope());
> +			} catch (JaxenException e) {
> +				throw new SynapseException ("Problem trying to evaluate "+xp.getRootExpr()+" on "+smc.getEnvelope().toString(),e);
> +				
> +			}
> +		}
> +	}
> +
> +	public String getRulesetType() {
> +		
> +		return "xpath";
> +	}
> +	
> +}
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org