synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r556596 - in /webservices/synapse/trunk/java/modules: core/src/main/java/org/apache/synapse/core/axis2/ core/src/main/java/org/apache/synapse/mediators/ core/src/main/java/org/apache/synapse/mediators/ext/ core/src/main/java/org/apache/syna...
Date Mon, 16 Jul 2007 11:59:12 GMT
Author: indika
Date: Mon Jul 16 04:59:09 2007
New Revision: 556596

URL: http://svn.apache.org/viewvc?view=rev&rev=556596
Log:
ixed some  NFE 
improve logs ,comments

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/Registry.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java
Mon Jul 16 04:59:09 2007
@@ -19,23 +19,25 @@
 
 package org.apache.synapse.core.axis2;
 
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.client.async.Callback;
-import org.apache.axis2.context.MessageContext;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFault;
+import org.apache.axiom.soap.SOAPFaultReason;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.util.Utils;
-import org.apache.axis2.transport.nhttp.NhttpConstants;
-import org.apache.axis2.addressing.RelatesTo;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.RelatesTo;
+import org.apache.axis2.client.async.Callback;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.transport.nhttp.NhttpConstants;
+import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.sandesha2.client.SandeshaClientConstants;
 import org.apache.synapse.Constants;
 import org.apache.synapse.FaultHandler;
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.endpoints.Endpoint;
-import org.apache.axiom.soap.SOAPFault;
-import org.apache.sandesha2.client.SandeshaClientConstants;
 
 import java.util.*;
 
@@ -116,19 +118,25 @@
 
             Stack faultStack = synapseOutMsgCtx.getFaultStack();
             if (faultStack != null && !faultStack.isEmpty()) {
-                SOAPFault fault = response.getEnvelope().getBody().getFault();
-                Exception e = fault.getException();
-                if (e == null) {
-                    e = new Exception(fault.toString());
-                }
-                // set an error code to the message context, so that error sequences can
filter
-                // using that property to determine the cause of error
-                synapseOutMsgCtx.setProperty(Constants.ERROR_CODE, Constants.SENDING_FAULT);
-                if (fault != null && fault.getReason() != null) {
-                    synapseOutMsgCtx.setProperty(Constants.ERROR_MESSAGE, fault.getReason().getText());
+                SOAPEnvelope envelope = response.getEnvelope();
+                if (envelope != null) {
+                    SOAPFault fault = envelope.getBody().getFault();
+                    if (fault != null) {
+                        Exception e = fault.getException();
+                        if (e == null) {
+                            e = new Exception(fault.toString());
+                        }
+                        // set an error code to the message context, so that error sequences
can filter
+                        // using that property to determine the cause of error
+                        synapseOutMsgCtx.setProperty(Constants.ERROR_CODE, Constants.SENDING_FAULT);
+                        SOAPFaultReason faultReason = fault.getReason();
+                        if (faultReason != null) {
+                            synapseOutMsgCtx.setProperty(Constants.ERROR_MESSAGE,
+                                    faultReason.getText());
+                        }
+                        ((FaultHandler) faultStack.pop()).handleFault(synapseOutMsgCtx, e);
+                    }
                 }
-
-                ((FaultHandler) faultStack.pop()).handleFault(synapseOutMsgCtx, e);
             }
 
         } else {
@@ -217,9 +225,10 @@
             try {
                 synapseOutMsgCtx.getEnvironment().injectMessage(synapseInMessageContext);
             } catch (SynapseException syne) {
-                if (!synapseInMessageContext.getFaultStack().isEmpty()) {
-                    ((FaultHandler) synapseInMessageContext
-                            .getFaultStack().pop()).handleFault(synapseInMessageContext,
syne);
+                Stack stack = synapseInMessageContext.getFaultStack();
+                if (stack != null &&
+                        !stack.isEmpty()) {
+                    ((FaultHandler) stack.pop()).handleFault(synapseInMessageContext, syne);
                 } else {
                     log.error("Synapse encountered an exception, " +
                             "No error handlers found - [Message Dropped]\n" + syne.getMessage());

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/GetPropertyFunction.java
Mon Jul 16 04:59:09 2007
@@ -21,8 +21,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.MessageContext;
 import org.apache.synapse.Constants;
+import org.apache.synapse.MessageContext;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.jaxen.Context;
 import org.jaxen.Function;
@@ -30,9 +30,9 @@
 import org.jaxen.Navigator;
 import org.jaxen.function.StringFunction;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
 
 /**
  * Implements the XPath extension function synapse:get-property(scope,prop-name)
@@ -62,7 +62,13 @@
      * @throws FunctionCallException
      */
     public Object call(Context context, List args) throws FunctionCallException {
-
+        
+        if (args == null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Property key value for lookup was not specified");
+            }
+            return null;
+        }
         int size = args.size();
         if (size == 0) {
             if (log.isDebugEnabled()) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/ext/ClassMediator.java
Mon Jul 16 04:59:09 2007
@@ -101,35 +101,37 @@
      */
     private void setProperties(Mediator m, MessageContext synCtx, boolean shouldTrace) {
 
-        Iterator iter = properties.iterator();
-        while (iter.hasNext()) {
+        if (!properties.isEmpty()) {
+            for (Iterator iter = properties.iterator(); iter.hasNext();) {
 
-            MediatorProperty mProp = (MediatorProperty) iter.next();
+                MediatorProperty mProp = (MediatorProperty) iter.next();
 
-            String mName = "set" + Character.toUpperCase(mProp.getName().charAt(0)) + mProp.getName().substring(1);
-            String value = (mProp.getValue() != null ?
-                mProp.getValue() :
-                Axis2MessageContext.getStringValue(mProp.getExpression(), synCtx));
+                String mName = "set" + Character.toUpperCase(mProp.getName().charAt(0)) +
+                                            mProp.getName().substring(1);
+                String value = (mProp.getValue() != null ?
+                        mProp.getValue() :
+                        Axis2MessageContext.getStringValue(mProp.getExpression(), synCtx));
 
-            try {
-                if (value != null) {
-                    Method method = m.getClass().getMethod(mName, new Class[]{String.class});
-                    if (log.isDebugEnabled()) {
-                        log.debug("Setting property :: invoking method " + mName + "(" +
value + ")");
+                try {
+                    if (value != null) {
+                        Method method = m.getClass().getMethod(mName, new Class[]{String.class});
+                        if (log.isDebugEnabled()) {
+                            log.debug("Setting property :: invoking method " + mName + "("
+ value + ")");
+                        }
+                        if (shouldTrace) {
+                            trace.trace("Setting property :: invoking method " + mName +
"(" + value + ")");
+                        }
+                        method.invoke(m, new Object[]{value});
                     }
+                } catch (Exception e) {
+                    String msg = "Error setting property : " + mProp.getName() + " as a String
property into class" +
+                            " mediator : " + m.getClass() + " : " + e.getMessage();
+
                     if (shouldTrace) {
-                        trace.trace("Setting property :: invoking method " + mName + "("
+ value + ")");
+                        trace.trace(msg);
                     }
-                    method.invoke(m, new Object[]{value});
-                }
-            } catch (Exception e) {
-                String msg = "Error setting property : " + mProp.getName() + " as a String
property into class" +
-                    " mediator : " + m.getClass() + " : " + e.getMessage();
-
-                if (shouldTrace) {
-                    trace.trace(msg);
+                    handleException(msg, e);
                 }
-                handleException(msg,e);
             }
         }
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/FaultMediator.java
Mon Jul 16 04:59:09 2007
@@ -25,12 +25,11 @@
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.soap.*;
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.Constants;
 import org.apache.synapse.MessageContext;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.Constants;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.AbstractMediator;
 
@@ -131,7 +130,7 @@
         setFaultRole(factory, fault);
         setFaultDetail(factory, fault);
 
-        // set the all headers of griginal SOAP Envelope to the Fault Envelope
+        // set the all headers of original SOAP Envelope to the Fault Envelope
         if (synCtx.getEnvelope() != null) {
             SOAPHeader soapHeader = synCtx.getEnvelope().getHeader();
             if (soapHeader != null) {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/HeaderMediator.java
Mon Jul 16 04:59:09 2007
@@ -19,22 +19,23 @@
 
 package org.apache.synapse.mediators.transform;
 
-import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.addressing.EndpointReference;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.*;
+import org.apache.synapse.Constants;
+import org.apache.synapse.MessageContext;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.AbstractMediator;
-import org.apache.axis2.addressing.EndpointReference;
 
 import javax.xml.namespace.QName;
-import java.util.List;
 import java.util.Iterator;
+import java.util.List;
 
 /**
  * The header mediator is able to set a given value as a SOAP header, or remove a given
@@ -129,12 +130,24 @@
                 } else if (Constants.HEADER_REPLY_TO.equals(qName.getLocalPart())) {
                     synCtx.setReplyTo(null);
                 } else {
-                    removeFromHeaderList(synCtx.getEnvelope().getHeader().
-                            getHeaderBlocksWithNSURI(""));
+                    SOAPEnvelope envelope = synCtx.getEnvelope();
+                    if (envelope != null) {
+                        SOAPHeader header = envelope.getHeader();
+                        if (header != null) {
+                            removeFromHeaderList(header.
+                                    getHeaderBlocksWithNSURI(""));
+                        }
+                    }
                 }
             } else {
-                removeFromHeaderList(synCtx.getEnvelope().getHeader().
-                        getHeaderBlocksWithNSURI(qName.getNamespaceURI()));
+                SOAPEnvelope envelope = synCtx.getEnvelope();
+                if (envelope != null) {
+                    SOAPHeader header = envelope.getHeader();
+                    if (header != null) {
+                        removeFromHeaderList(header.
+                                getHeaderBlocksWithNSURI(qName.getNamespaceURI()));
+                    }
+                }
             }
         }
         if (shouldTrace) {
@@ -145,23 +158,24 @@
 
     private void addCustomHeader(MessageContext synCtx) {
         SOAPEnvelope env = synCtx.getEnvelope();
-            SOAPFactory fac = (SOAPFactory) env.getOMFactory();
-            SOAPHeader header = env.getHeader();
-            if (header == null) {
-                header = fac.createSOAPHeader(env);
-            }
-            SOAPHeaderBlock hb = header.addHeaderBlock(qName.getLocalPart(),
+        if (env == null) {
+            return;
+        }
+        SOAPFactory fac = (SOAPFactory) env.getOMFactory();
+        SOAPHeader header = env.getHeader();
+        if (header == null) {
+            header = fac.createSOAPHeader(env);
+        }
+        SOAPHeaderBlock hb = header.addHeaderBlock(qName.getLocalPart(),
                 fac.createOMNamespace(qName.getNamespaceURI(), qName.getPrefix()));
-            hb.setText(value);
+        hb.setText(value);
     }
 
     private void removeFromHeaderList(List headersList) {
         if (headersList == null || headersList.isEmpty()) {
             return;
         }
-        
-        Iterator iter = headersList.iterator();
-        while (iter.hasNext()) {
+        for ( Iterator iter = headersList.iterator();iter.hasNext();) {
             Object o = iter.next();
             if (o instanceof SOAPHeaderBlock) {
                 SOAPHeaderBlock header = (SOAPHeaderBlock) o;
@@ -207,10 +221,5 @@
 
     public void setExpression(AXIOMXPath expression) {
         this.expression = expression;
-    }
-
-    private void handleException(String msg) {
-        log.error(msg);
-        throw new SynapseException(msg);
     }
 }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/mediators/transform/XSLTMediator.java
Mon Jul 16 04:59:09 2007
@@ -22,10 +22,10 @@
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
 import org.apache.axiom.om.impl.dom.jaxp.DocumentBuilderFactoryImpl;
+import org.apache.axiom.om.util.ElementHelper;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
@@ -43,24 +43,29 @@
 import org.w3c.dom.Node;
 
 import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
 import javax.xml.transform.*;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
 import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.dom.DOMSource;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.util.*;
-import java.io.ByteArrayOutputStream;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
 
 /**
  * The XSLT mediator performs an XSLT transformation requested, using
  * the current message. The source attribute (if available) spcifies the source element
  * on which the transformation would be applied. It will default to the first child of
  * the messages' SOAP body, if it is omitted. Additional properties passed into this
- * mediator would become parameters for XSLT
+ * mediator would become parameters for XSLT.Additional features passed inot this mediator
would
+ * become features except "http://ws.apache.org/ns/synapse/transform/feature/dom" for the
Transformer Factory.
+ * The "http://ws.apache.org/ns/synapse/transform/feature/dom" feature is used to deciding
swiching
+ * between DOM and Stream during the transformation process
  */
 public class XSLTMediator extends AbstractMediator {
 
@@ -347,7 +352,7 @@
     }
     
     /**
-     * to add a features which need to set to the TransformerFactory
+     * to add a feature which need to set to the TransformerFactory
      * @param  featureName The name of the feature
      * @param isFeatureEnable should this feature enable?
      */

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/AbstractRegistry.java
Mon Jul 16 04:59:09 2007
@@ -22,10 +22,10 @@
 import org.apache.axiom.om.OMNode;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.config.XMLToObjectMapper;
 import org.apache.synapse.config.Entry;
-import org.apache.synapse.mediators.base.SequenceMediator;
+import org.apache.synapse.config.XMLToObjectMapper;
 import org.apache.synapse.endpoints.Endpoint;
+import org.apache.synapse.mediators.base.SequenceMediator;
 
 import java.net.URI;
 import java.util.HashMap;
@@ -131,8 +131,10 @@
         }
 
         // increment cache expiry time as specified by the last getRegistryEntry() call
-        entry.setExpiryTime(System.currentTimeMillis() + re.getCachableDuration());
-        entry.setVersion(re.getVersion());
+        if (re != null) {
+            entry.setExpiryTime(System.currentTimeMillis() + re.getCachableDuration());
+            entry.setVersion(re.getVersion());
+        }
 
         return entry.getValue();
     }

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/Registry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/Registry.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/Registry.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/Registry.java
Mon Jul 16 04:59:09 2007
@@ -48,7 +48,8 @@
 
     /**
      * Get the registry entry for the given key
-     * @return the registry key
+     * @param key the registry key
+     * @return The registry entry for the given key
      */
     public RegistryEntry getRegistryEntry(String key);
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/registry/url/SimpleURLRegistry.java
Mon Jul 16 04:59:09 2007
@@ -162,7 +162,7 @@
             if(url.getProtocol().equals("file")) {
 
                 File file = new File(url.getFile());
-                if(file.isDirectory() == false) {
+                if(!file.isDirectory()) {
                     return null;
                 }
 

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
Mon Jul 16 04:59:09 2007
@@ -19,14 +19,6 @@
 
 package org.apache.synapse.mediators.bsf;
 
-import javax.script.Bindings;
-import javax.script.Compilable;
-import javax.script.CompiledScript;
-import javax.script.Invocable;
-import javax.script.ScriptEngine;
-import javax.script.ScriptEngineManager;
-import javax.script.ScriptException;
-
 import org.apache.axiom.om.OMElement;
 import org.apache.bsf.xml.XMLHelper;
 import org.apache.commons.logging.Log;
@@ -37,9 +29,7 @@
 import org.apache.synapse.config.Entry;
 import org.apache.synapse.mediators.AbstractMediator;
 
-import java.io.Writer;
-import java.io.StringWriter;
-import java.io.PrintWriter;
+import javax.script.*;
 
 /**
  * A Synapse mediator that calls a function in any scripting language supported by the BSF.
@@ -157,7 +147,7 @@
             trace.trace("Start : Script mediator # Language : " + language +
                     (key == null ? " inline script" : " script with key : " + key) +
                     " function : " + function);
-            trace.trace("Invoking inline script for current message : " + synCtx);
+            trace.trace("Invoking inline script for current message : " + synCtx.getEnvelope());
         }
 
         boolean returnValue;
@@ -171,7 +161,7 @@
         }
 
         if (shouldTrace) {
-            trace.trace("Result message after execution of script : " + synCtx);
+            trace.trace("Result message after execution of script : " + synCtx.getEnvelope());
             trace.trace("End : Script mediator " + returnValue);
         }
 

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java?view=diff&rev=556596&r1=556595&r2=556596
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
Mon Jul 16 04:59:09 2007
@@ -22,15 +22,15 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.neethi.PolicyEngine;
-import org.apache.synapse.MessageContext;
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.Constants;
 import org.apache.synapse.Mediator;
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.SynapseException;
 import org.apache.synapse.config.Entry;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
 import org.apache.synapse.mediators.AbstractMediator;
-import org.wso2.throttle.factory.AccessControllerFactory;
 import org.wso2.throttle.*;
+import org.wso2.throttle.factory.AccessControllerFactory;
 
 
 /**
@@ -48,7 +48,7 @@
     /** InLine policy object - XML   */
     private OMElement inLinePolicy = null;
     /** The throttle - hold runtime + configuration data of throttle  */
-    Throttle throttle = null;
+    private Throttle throttle = null;
     /** The reference to the sequence which will execute when access deny*/
     private String onReject = null;
     /** The in-line sequence which will execute when access deny*/



---------------------------------------------------------------------
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