synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sami...@apache.org
Subject svn commit: r356298 - /incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java
Date Mon, 12 Dec 2005 17:42:52 GMT
Author: saminda
Date: Mon Dec 12 09:42:44 2005
New Revision: 356298

URL: http://svn.apache.org/viewcvs?rev=356298&view=rev
Log:
Made DeprecationMediator EnvironmentAware so that it can get resources 
out of the Axis2 environment 

Modified:
    incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java

Modified: incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java
URL: http://svn.apache.org/viewcvs/incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java?rev=356298&r1=356297&r2=356298&view=diff
==============================================================================
--- incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java
(original)
+++ incubator/synapse/trunk/java/src/sampleMediators/deprecation/DeprecationMediator.java
Mon Dec 12 09:42:44 2005
@@ -16,26 +16,21 @@
 
 package sampleMediators.deprecation;
 
-import org.apache.axis2.context.MessageContext;
 import org.apache.synapse.SynapseMessage;
+import org.apache.synapse.SynapseEnvironment;
 import org.apache.synapse.api.Mediator;
+import org.apache.synapse.api.EnvironmentAware;
 
 import java.io.InputStream;
 import java.util.Map;
 
-public class DeprecationMediator implements Mediator {
+public class DeprecationMediator implements Mediator, EnvironmentAware {
 
     DeprecationConfiguration configuration;
     private InputStream depricationInStream;
+    private SynapseEnvironment se;
+    private ClassLoader cl;
 
-    /**
-     * work around to get the deprication.xml into the mediator system
-     */
-    public void init(MessageContext messageContext) {
-        this.depricationInStream = messageContext.getServiceContext()
-                .getAxisService().getClassLoader()
-                .getResourceAsStream("META-INF/deprecation.xml");
-    }
 
     public DeprecationMediator() {
     }
@@ -43,6 +38,7 @@
     public boolean mediate(SynapseMessage synapseMessageContext) {
 
         try {
+            this.depricationInStream = this.cl.getResourceAsStream("META-INF/deprecation.xml");
             final DeprecationConfigurator deprecationConfigurator =
                     new DeprecationConfigurator(this.depricationInStream);
             Map mediatorConfig = deprecationConfigurator
@@ -100,4 +96,11 @@
 
     }
 
+    public void setSynapseEnvironment(SynapseEnvironment se) {
+        this.se = se;
+    }
+
+    public void setClassLoader(ClassLoader cl) {
+        this.cl = cl;
+    }
 }



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


Mime
View raw message