Author: saminda
Date: Wed Oct 26 02:47:32 2005
New Revision: 328612
URL: http://svn.apache.org/viewcvs?rev=328612&view=rev
Log:
SynpaseServlet is added. org.apache.synapse.rules.* classes modified to
handle hot deployment too.
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/build.xml
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/SynapseConstants.java
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/client/SampleClient.java
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/modules/META-INF/module.xml
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleConfiguration.java
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleReader.java
Modified: incubator/synapse/trunk/scratch/saminda/synapse2/build.xml
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/build.xml?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
--- incubator/synapse/trunk/scratch/saminda/synapse2/build.xml (original)
+++ incubator/synapse/trunk/scratch/saminda/synapse2/build.xml Wed Oct 26
02:47:32 2005
@@ -49,7 +49,8 @@
<jar destfile="${jardrop.dir}/synapse_prototype_2.jar">
<fileset dir="${classes.dir}">
- <include name="**/SynapseDispatcher.class"/>
+ <include name="**/SyanpseDispatcher.class"/>
+ <include name="**/Mediator.class"/>
<include name="**/DependencyManager.class"/>
<include name="**/SynapseAbstractMessageReceiver.class"/>
<include name="**/SynapseMessageReceiver.class"/>
@@ -57,6 +58,7 @@
<include name="**/SynapseRuleEngine.class"/>
<include name="**/SynapaseRuleBean.class"/>
<include name="**/SynapseRuleConfiguration.class"/>
+ <include name="**/SynapseServlet.class"/>
<include name="**/Utils.class"/>
</fileset>
</jar>
@@ -71,5 +73,6 @@
todir="/home/saminda/myprojects/synapse2/server/" overwrite="true"/>
</target>
+
</project>
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/SynapseConstants.java
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/SynapseConstants.java?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
---
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/SynapseConstants.java
(original)
+++
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/SynapseConstants.java
Wed Oct 26 02:47:32 2005
@@ -13,6 +13,7 @@
public static final String VALUE_FALSE="false";
public static final String SYNAPSE_STATE="state";
public static final String RULE_STATE="ruleState";
+ public static final String PATH="path";
public interface SynapseRuleReader {
public static final String CONDITION = "condition";
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/client/SampleClient.java
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/client/SampleClient.java?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
---
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/client/SampleClient.java
(original)
+++
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/client/SampleClient.java
Wed Oct 26 02:47:32 2005
@@ -18,7 +18,7 @@
*/
public class SampleClient {
private static EndpointReference targetEPR = new EndpointReference(
- "http://localhost:8081/");
+ "http://localhost:8081/synapse/services/dummyservice");
public static void main(String[] args) {
try {
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/modules/META-INF/module.xml
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/modules/META-INF/module.xml?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
---
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/modules/META-INF/module.xml
(original)
+++
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/modules/META-INF/module.xml
Wed Oct 26 02:47:32 2005
@@ -3,5 +3,8 @@
<handler name="synapseInHandler"
class="org.apache.synapse.handler.SynapseInHandler">
<order phase="PreDispatch" after="AddressingInHandler"/>
</handler>
+ <handler name="SyanpseDispatcher"
class="org.apache.synapse.engine.SyanpseDispatcher">
+ <order phaseFirst="true" phase="Dispatch"/>
+ </handler>
</inflow>
</module>
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleConfiguration.java
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleConfiguration.java?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
---
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleConfiguration.java
(original)
+++
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleConfiguration.java
Wed Oct 26 02:47:32 2005
@@ -4,8 +4,6 @@
import org.apache.axis2.AxisFault;
import org.apache.axis2.soap.SOAPEnvelope;
import org.apache.axis2.om.xpath.AXIOMXPath;
-import org.apache.axis2.om.OMDocument;
-import org.apache.axis2.om.OMAbstractFactory;
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.synapse.SynapseConstants;
import org.jaxen.JaxenException;
@@ -54,7 +52,7 @@
HashMap serviceMap = registry.getServices();
- ruleReader.populateRules();
+ ruleReader.populateRules(msgCtx);
Iterator ite = serviceMap.entrySet().iterator();
Map.Entry entry = null;
Modified:
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleReader.java
URL:
http://svn.apache.org/viewcvs/incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleReader.java?rev=328612&r1=328611&r2=328612&view=diff
==============================================================================
---
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleReader.java
(original)
+++
incubator/synapse/trunk/scratch/saminda/synapse2/src/org/apache/synapse/rules/SynapseRuleReader.java
Wed Oct 26 02:47:32 2005
@@ -6,6 +6,7 @@
import org.apache.axis2.om.OMAttribute;
import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
import org.apache.synapse.SynapseConstants;
import javax.xml.stream.XMLStreamReader;
@@ -32,16 +33,27 @@
private HashMap namespaceMap;
+
public SynapseRuleReader() {
ruleList = new ArrayList();
namespaceMap = new HashMap();
}
- public OMElement readRules()
+
+ public OMElement readRules(MessageContext messageContext)
throws AxisFault {
try {
- File absolutePath = new File(".");
+ String path = (String) messageContext.getSystemContext()
+ .getProperty(SynapseConstants.PATH);
+ File absolutePath = null;
+
+ if (path == null) {
+ absolutePath = new File(".");
+ } else {
+ absolutePath = new File(path);
+ }
+
File inFile = new File(absolutePath.getAbsolutePath(), RULE_XML);
InputStream in = new FileInputStream(inFile);
if (in == null) {
@@ -64,10 +76,10 @@
}
}
- public void populateRules() throws
+ public void populateRules(MessageContext messageContexgt) throws
AxisFault {
- OMElement rules = readRules();
+ OMElement rules = readRules(messageContexgt);
if (rules != null) {
this.fillBean(rules);
this.fillNamespaces(rules);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]