You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by ru...@apache.org on 2007/03/16 05:56:37 UTC

svn commit: r518866 - in /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2: Axis2SynapseEnvironment.java ProxyServiceMessageReceiver.java

Author: ruwan
Date: Thu Mar 15 21:56:37 2007
New Revision: 518866

URL: http://svn.apache.org/viewvc?view=rev&rev=518866
Log:
small spelling mistakes fixed

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java?view=diff&rev=518866&r1=518865&r2=518866
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/Axis2SynapseEnvironment.java Thu Mar 15 21:56:37 2007
@@ -25,6 +25,7 @@
 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.SynapseConfiguration;
 import org.apache.synapse.endpoints.utils.EndpointDefinition;
 import org.apache.synapse.core.SynapseEnvironment;
@@ -61,37 +62,41 @@
             StatisticsUtils.processProxyServiceStatistics(synCtx);
             StatisticsUtils.processSequenceStatistics(synCtx);
         }
-        
+
         // if this is a response to a proxy service 
         if (synCtx.getProperty(Constants.PROXY_SERVICE) != null) {
 
-            if (synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(Constants.PROXY_SERVICE))
-                    .getTargetOutSequence() != null) {
+            if (synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(
+                    Constants.PROXY_SERVICE)).getTargetOutSequence() != null) {
 
-                String sequenceName = synCtx.getConfiguration().getProxyService(
-                        (String) synCtx.getProperty(Constants.PROXY_SERVICE)).getTargetOutSequence();
+                String sequenceName = synCtx.getConfiguration().getProxyService((String) synCtx.
+                        getProperty(Constants.PROXY_SERVICE)).getTargetOutSequence();
                 Mediator outSequence = synCtx.getSequence(sequenceName);
 
                 if (outSequence != null) {
-                    log.debug("Using the sequence named " + sequenceName + " for the outgoing message mediation of " +
-                            "the proxy service " + synCtx.getProperty(Constants.PROXY_SERVICE));
+                    log.debug("Using the sequence named " + sequenceName
+                            + " for the outgoing message mediation of the proxy service "
+                            + synCtx.getProperty(Constants.PROXY_SERVICE));
                     outSequence.mediate(synCtx);
                 } else {
-                    log.error("Unable to find the sequence specified by the name " + sequenceName);
-                    // TODO invoke a generic synapse error handler for this message
+                    log.error("Unable to find the out-sequence " +
+                            "specified by the name " + sequenceName);
+                    throw new SynapseException("Unable to find the " +
+                            "out-sequence specified by the name " + sequenceName);
                 }
 
             } else if (synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(
                     Constants.PROXY_SERVICE)).getTargetInLineOutSequence() != null) {
 
-                log.debug("Using the anonymous out sequence specified in the proxy service "
-                        + synCtx.getProperty(Constants.PROXY_SERVICE) + " for out going message mediation");
+                log.debug("Using the anonymous out-sequence specified in the proxy service "
+                        + synCtx.getProperty(Constants.PROXY_SERVICE)
+                        + " for outgoing message mediation");
                 synCtx.getConfiguration().getProxyService((String) synCtx.getProperty(
                         Constants.PROXY_SERVICE)).getTargetInLineOutSequence().mediate(synCtx);
             } else {
 
-                log.debug("Proxy service " + synCtx.getProperty(Constants.PROXY_SERVICE) + " does not specifies " +
-                        "an out sequence - sending the response back");
+                log.debug("Proxy service " + synCtx.getProperty(Constants.PROXY_SERVICE)
+                        + " does not specifies an out-sequence - sending the response back");
                 Axis2Sender.sendBack(synCtx);
             }
 

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java?view=diff&rev=518866&r1=518865&r2=518866
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java (original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/core/axis2/ProxyServiceMessageReceiver.java Thu Mar 15 21:56:37 2007
@@ -60,33 +60,37 @@
             // Setting Required property to collect the proxy service statistics
             boolean statisticsEnable;
             if (proxy != null) {
-                statisticsEnable = (org.apache.synapse.Constants.STATISTICS_ON == proxy.getStatisticsEnable());
+                statisticsEnable = (
+                        org.apache.synapse.Constants.STATISTICS_ON == proxy.getStatisticsEnable());
                 if (statisticsEnable) {
-                    ProxyServiceStatisticsStack proxyServiceStatisticsStack = new ProxyServiceStatisticsStack();
+                    ProxyServiceStatisticsStack proxyServiceStatisticsStack
+                            = new ProxyServiceStatisticsStack();
                     boolean isFault = synCtx.getEnvelope().getBody().hasFault();
-                    proxyServiceStatisticsStack.put(
-                            name, System.currentTimeMillis(), !synCtx.isResponse(), statisticsEnable, isFault);
-                    synCtx.setProperty(
-                            org.apache.synapse.Constants.PROXYSERVICE_STATISTICS_STACK, proxyServiceStatisticsStack);
+                    proxyServiceStatisticsStack.put(name, System.currentTimeMillis(),
+                            !synCtx.isResponse(), statisticsEnable, isFault);
+                    synCtx.setProperty(org.apache.synapse.Constants.PROXYSERVICE_STATISTICS_STACK,
+                            proxyServiceStatisticsStack);
                 }
 
                 if (proxy.getTargetFaultSequence() != null) {
 
                     Mediator faultSequence = synCtx.getSequence(proxy.getTargetFaultSequence());
                     if (faultSequence != null) {
-                        log.debug("setting the fault sequence of the proxy to context");
+                        log.debug("setting the fault-sequence of the " +
+                                "proxy service to MessageContext");
                         synCtx.pushFaultHandler(new MediatorFaultHandler(
                                 synCtx.getSequence(proxy.getTargetFaultSequence())));
                     } else {
-                        // when we can not find the reference to the fault sequence of the proxy service we should not
-                        // throw an exception because still we have the global fault sequence and the message mediation
-                        // can still continue
-                        log.warn("Unable to find the fault sequence for the proxy service " +
+                        // when we can not find the reference to the fault sequence of the proxy
+                        // service we should not throw an exception because still we have the global
+                        // fault sequence and the message mediation can still continue
+                        log.warn("Unable to find the fault-sequence for the proxy service " +
                                 "specified by the name " + proxy.getTargetFaultSequence());
                     }
                 } else if (proxy.getTargetInLineFaultSequence() != null) {
-                    log.debug("Setting the anonymous fault sequence of the proxy to context");
-                    synCtx.pushFaultHandler(new MediatorFaultHandler(proxy.getTargetInLineFaultSequence()));
+                    log.debug("Setting the anonymous fault-sequence of the proxy to context");
+                    synCtx.pushFaultHandler(
+                            new MediatorFaultHandler(proxy.getTargetInLineFaultSequence()));
                 }
 
                 // Using inSequence for the incoming message mediation
@@ -94,17 +98,19 @@
 
                     Mediator inSequence = synCtx.getSequence(proxy.getTargetInSequence());
                     if (inSequence != null) {
-                        log.debug("Using the sequence named " + proxy.getTargetInSequence() + " for message mediation");
+                        log.debug("Using the sequence named "
+                                + proxy.getTargetInSequence() + " for message mediation");
                         inSequence.mediate(synCtx);
                     } else {
 
-                        log.error("Unable to find the in sequence for the proxy service " +
-                                "specified by the name " + proxy.getTargetInSequence());
-                        throw new SynapseException("Unable to find the in sequence for the proxy service " +
+                        log.error("Unable to find the in-sequence for the proxy service " +
                                 "specified by the name " + proxy.getTargetInSequence());
+                        throw new SynapseException("Unable to find the in-sequence for the proxy " +
+                                "service specified by the name " + proxy.getTargetInSequence());
                     }
                 } else if (proxy.getTargetInLineInSequence() != null) {
-                    log.debug("Using the anonymous in sequence of the proxy service for message mediation");
+                    log.debug("Using the anonymous " +
+                            "in-sequence of the proxy service for message mediation");
                     proxy.getTargetInLineInSequence().mediate(synCtx);
                 }
 
@@ -114,26 +120,23 @@
                         log.debug("Forwarding message to the endpoint named "
                                 + proxy.getTargetEndpoint() + " after message mediation");
                         endpoint.send(synCtx);
-                        //synCtx.setTo(new EndpointReference(endpoint.getAddress()));
-                        //Axis2FlexibleMEPClient.send(endpoint, synCtx);
                     } else {
 
                         log.error("Unable to find the endpoint for the proxy service " +
                                 "specified by the name " + proxy.getTargetEndpoint());
-                        throw new SynapseException("Unable to find the endpoint for the proxy service " +
-                                "specified by the name " + proxy.getTargetEndpoint());
+                        throw new SynapseException("Unable to find the endpoint for the " +
+                                "proxy service specified by the name " + proxy.getTargetEndpoint());
                     }
                 } else if (proxy.getTargetInLineEndpoint() != null) {
                     log.debug("Forwarding the message to the anonymous " +
                             "endpoint of the proxy service after message mediation");
                     proxy.getTargetInLineEndpoint().send(synCtx);
-                    //synCtx.setTo(new EndpointReference(proxy.getTargetInLineEndpoint().getAddress()));
-                    //Axis2FlexibleMEPClient.send(proxy.getTargetInLineEndpoint(), synCtx);
                 }
 
             } else {
                 log.error("Proxy Service with the name " + name + " does not exists");
-                throw new SynapseException("Proxy Service with the name " + name + " does not exists");
+                throw new SynapseException(
+                        "Proxy Service with the name " + name + " does not exists");
             }
         } catch (SynapseException syne) {
             if (!synCtx.getFaultStack().isEmpty()) {



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