Author: hiranya
Date: Fri Aug 23 22:41:46 2013
New Revision: 1517081

URL: http://svn.apache.org/r1517081
Log:
Using the Axis2BlockingClient in the message processor impls. Adding sample 
704. Patches applied from SYNAPSE-971 and SYNAPSE-972

Added:
    
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample704.xml
    synapse/trunk/java/repository/conf/sample/synapse_sample_704.xml
Modified:
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/MessageForwardingProcessorView.java
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ScheduledMessageForwardingProcessor.java
    synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java?rev=1517081&r1=1517080&r2=1517081&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ForwardingJob.java
 Fri Aug 23 22:41:46 2013
@@ -16,19 +16,26 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 package org.apache.synapse.message.processors.forward;
 
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.*;
+import org.apache.synapse.Mediator;
+import org.apache.synapse.MessageContext;
+import org.apache.synapse.SynapseConstants;
+import org.apache.synapse.core.axis2.Axis2BlockingClient;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
-import org.apache.synapse.endpoints.AddressEndpoint;
+import org.apache.synapse.endpoints.AbstractEndpoint;
 import org.apache.synapse.endpoints.Endpoint;
 import org.apache.synapse.message.processors.MessageProcessorConsents;
 import org.apache.synapse.message.store.MessageStore;
-import org.quartz.*;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.quartz.StatefulJob;
 
 import java.util.Map;
 import java.util.Set;
@@ -45,17 +52,14 @@ public class ForwardingJob implements St
     public void execute(JobExecutionContext jobExecutionContext) throws 
JobExecutionException {
         JobDataMap jdm = jobExecutionContext.getMergedJobDataMap();
 
-        /**
-         * Get the Global Objects from DataMap
-         */
-        MessageStore messageStore = (MessageStore) jdm.get(
-                MessageProcessorConsents.MESSAGE_STORE);
+        //Get the Global Objects from DataMap
+        MessageStore messageStore = (MessageStore) 
jdm.get(MessageProcessorConsents.MESSAGE_STORE);
         Map<String, Object> parameters = (Map<String, Object>) jdm.get(
                 MessageProcessorConsents.PARAMETERS);
-        BlockingMessageSender sender =
-                (BlockingMessageSender) 
jdm.get(ScheduledMessageForwardingProcessor.BLOCKING_SENDER);
-        ScheduledMessageForwardingProcessor processor =
-                (ScheduledMessageForwardingProcessor) 
jdm.get(ScheduledMessageForwardingProcessor.PROCESSOR_INSTANCE);
+        Axis2BlockingClient sender = (Axis2BlockingClient) jdm.get(
+                ScheduledMessageForwardingProcessor.BLOCKING_SENDER);
+        ScheduledMessageForwardingProcessor processor = 
(ScheduledMessageForwardingProcessor) jdm.get(
+                ScheduledMessageForwardingProcessor.PROCESSOR_INSTANCE);
 
         int maxDeliverAttempts = -1;
         String mdaParam = null;
@@ -107,8 +111,8 @@ public class ForwardingJob implements St
                 Set proSet = messageContext.getPropertyKeySet();
 
                 if (proSet != null) {
-                    if 
(proSet.contains(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR)) {
-                        
proSet.remove(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR);
+                    if 
(proSet.contains(SynapseConstants.BLOCKING_CLIENT_ERROR)) {
+                        proSet.remove(SynapseConstants.BLOCKING_CLIENT_ERROR);
                     }
                 }
 
@@ -123,14 +127,13 @@ public class ForwardingJob implements St
                         return;
                     }
 
-                    if (ep instanceof AddressEndpoint) {
+                    if ((ep != null) && (((AbstractEndpoint) 
ep).isLeafEndpoint())) {
 
                         try {
-                            MessageContext outCtx = sender.send(
-                                    ((AddressEndpoint) ep).getDefinition(), 
messageContext);
+                            MessageContext outCtx = sender.send(ep, 
messageContext);
 
                             if (outCtx != null && "true".equals(outCtx.
-                                    
getProperty(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR))) {
+                                    
getProperty(SynapseConstants.BLOCKING_CLIENT_ERROR))) {
                                 // This Means an Error has occurred
 
                                 if (maxDeliverAttempts > 0) {
@@ -204,9 +207,15 @@ public class ForwardingJob implements St
                             continue;
                         }
                     } else {
-                        // Currently only Address Endpoint delivery is 
supported
-                        log.warn("Address Endpoint Named " + targetEp + " not 
found.Hence removing " +
-                                "the message form store");
+                        String logMsg;
+                        if (ep == null) {
+                            logMsg = "Endpoint named " + targetEp + " not 
found.Hence removing " +
+                                    "the message form store";
+                        } else {
+                            logMsg = "Unsupported endpoint type. Only 
address/wsdl/default " +
+                                    "endpoint types supported";
+                        }
+                        log.warn(logMsg);
                         messageStore.poll();
                     }
 
@@ -229,29 +238,6 @@ public class ForwardingJob implements St
         }
     }
 
-
-    private BlockingMessageSender initMessageSender(Map<String, Object> 
params) {
-
-        BlockingMessageSender sender = null;
-        String axis2repo = (String) 
params.get(ForwardingProcessorConstants.AXIS2_REPO);
-        String axis2Config = (String) 
params.get(ForwardingProcessorConstants.AXIS2_CONFIG);
-
-        sender = new BlockingMessageSender();
-
-        if (axis2repo != null) {
-            sender.setClientRepository(axis2repo);
-        }
-
-
-        if (axis2Config != null) {
-            sender.setAxis2xml(axis2Config);
-        }
-        sender.init();
-
-        return sender;
-    }
-
-
     /**
      * Helper method to get a value of a parameters in the AxisConfiguration
      *

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/MessageForwardingProcessorView.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/MessageForwardingProcessorView.java?rev=1517081&r1=1517080&r2=1517081&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/MessageForwardingProcessorView.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/MessageForwardingProcessorView.java
 Fri Aug 23 22:41:46 2013
@@ -16,21 +16,19 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
+
 package org.apache.synapse.message.processors.forward;
 
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.synapse.Mediator;
 import org.apache.synapse.MessageContext;
-import org.apache.synapse.SynapseArtifact;
+import org.apache.synapse.SynapseConstants;
 import org.apache.synapse.SynapseException;
+import org.apache.synapse.core.axis2.Axis2BlockingClient;
 import org.apache.synapse.core.axis2.Axis2MessageContext;
-import org.apache.synapse.endpoints.AddressEndpoint;
+import org.apache.synapse.endpoints.AbstractEndpoint;
 import org.apache.synapse.endpoints.Endpoint;
-import org.apache.synapse.message.processors.MessageProcessor;
-import org.apache.synapse.message.processors.ScheduledMessageProcessor;
-import org.apache.synapse.message.store.AbstractMessageStore;
 import org.apache.synapse.message.store.MessageStore;
 
 import java.util.ArrayList;
@@ -39,37 +37,34 @@ import java.util.Set;
 
 public class MessageForwardingProcessorView implements 
MessageForwardingProcessorViewMBean {
 
-    private MessageStore messageStore;
-
-    private BlockingMessageSender sender;
+    private static final Log log = 
LogFactory.getLog(MessageForwardingProcessorView.class);
 
+    private MessageStore messageStore;
+    private Axis2BlockingClient sender;
     private ScheduledMessageForwardingProcessor processor;
-    private static Log log = 
LogFactory.getLog(MessageForwardingProcessorView.class);
-
 
-    public MessageForwardingProcessorView(MessageStore messageStore, 
BlockingMessageSender sender,
-                                          ScheduledMessageForwardingProcessor 
processor)
-            throws Exception {
+    public MessageForwardingProcessorView(MessageStore messageStore, 
Axis2BlockingClient sender,
+                                          ScheduledMessageForwardingProcessor 
processor) {
         if (messageStore != null) {
             this.messageStore = messageStore;
         } else {
-            throw new Exception("Error , Can not create Message Forwarding 
Processor " +
-                    "view with null " + "message store");
+            throw new SynapseException("Cannot create Message Forwarding 
Processor " +
+                    "view with null message store");
         }
 
         if (sender != null) {
             this.sender = sender;
         } else {
-            throw new Exception("Error , Can not create Message Forwarding 
Processor " +
-                    "view with null " + "Message Sender");
+            throw new SynapseException("Cannot create Message Forwarding 
Processor " +
+                    "view with null message sender");
         }
 
 
         if (processor != null) {
             this.processor = processor;
         } else {
-            throw new SynapseException("Error , Can not create Message 
Forwarding Processor " +
-                    "view with null " + "Message Processor");
+            throw new SynapseException("Cannot create Message Forwarding 
Processor " +
+                    "view with null message processor");
         }
 
     }
@@ -186,23 +181,18 @@ public class MessageForwardingProcessorV
         if (messageContext != null) {
             Set proSet = messageContext.getPropertyKeySet();
 
-            if (proSet != null) {
-                if 
(proSet.contains(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR)) {
-                    
proSet.remove(ForwardingProcessorConstants.BLOCKING_SENDER_ERROR);
-                }
+            if (proSet != null && 
proSet.contains(SynapseConstants.BLOCKING_CLIENT_ERROR)) {
+                proSet.remove(SynapseConstants.BLOCKING_CLIENT_ERROR);
             }
 
-            String targetEp =
-                    (String) 
messageContext.getProperty(ForwardingProcessorConstants.TARGET_ENDPOINT);
+            String targetEp = (String) messageContext.getProperty(
+                    ForwardingProcessorConstants.TARGET_ENDPOINT);
 
             if (targetEp != null) {
                 Endpoint ep = messageContext.getEndpoint(targetEp);
-
-                if (ep instanceof AddressEndpoint) {
-
+                if ((ep != null) && (((AbstractEndpoint) 
ep).isLeafEndpoint())) {
                     try {
-                        MessageContext outCtx = sender.send(
-                                ((AddressEndpoint) ep).getDefinition(), 
messageContext);
+                        sender.send(ep, messageContext);
                         // If no Exception Occurred We remove the Message
                         if (delete) {
                             messageStore.poll();
@@ -212,10 +202,15 @@ public class MessageForwardingProcessorV
                         throw new Exception(e);
                     }
                 } else {
-                    // Currently only Address Endpoint delivery is supported
-                    String logMsg = "Address Endpoint Named " + targetEp +
-                            " not found.Hence removing " +
-                            "the message form store";
+                    String logMsg;
+                    if (ep == null) {
+                        logMsg = "Endpoint named " + targetEp + "not found. 
Hence removing " +
+                                "the message form store";
+                    } else {
+                        logMsg = "Unsupported endpoint type. Only 
address/wsdl/default endpoint " +
+                                "types supported";
+                    }
+
                     log.warn(logMsg);
                     if (delete) {
                         messageStore.poll();
@@ -223,7 +218,6 @@ public class MessageForwardingProcessorV
                     throw new Exception(logMsg);
                 }
 
-
             } else {
                 //No Target Endpoint defined for the Message
                 //So we do not have a place to deliver.

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ScheduledMessageForwardingProcessor.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ScheduledMessageForwardingProcessor.java?rev=1517081&r1=1517080&r2=1517081&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ScheduledMessageForwardingProcessor.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/message/processors/forward/ScheduledMessageForwardingProcessor.java
 Fri Aug 23 22:41:46 2013
@@ -19,12 +19,11 @@
 
 package org.apache.synapse.message.processors.forward;
 
-import org.apache.synapse.SynapseException;
 import org.apache.synapse.core.SynapseEnvironment;
+import org.apache.synapse.core.axis2.Axis2BlockingClient;
 import org.apache.synapse.message.processors.ScheduledMessageProcessor;
 import org.quartz.*;
 
-import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -36,8 +35,7 @@ public class ScheduledMessageForwardingP
 
     public static final String BLOCKING_SENDER = "blocking.sender";
 
-
-    private BlockingMessageSender sender = null;
+    private Axis2BlockingClient sender = null;
 
     private volatile AtomicBoolean active = new AtomicBoolean(true);
 
@@ -48,13 +46,8 @@ public class ScheduledMessageForwardingP
     @Override
     public void init(SynapseEnvironment se) {
         super.init(se);
-        try {
-            view = new MessageForwardingProcessorView(
-                    
se.getSynapseConfiguration().getMessageStore(messageStore),sender,this);
-        } catch (Exception e) {
-            throw new SynapseException(e);
-        }
-
+        view = new MessageForwardingProcessorView(
+                se.getSynapseConfiguration().getMessageStore(messageStore), 
getSender(), this);
         
org.apache.synapse.commons.jmx.MBeanRegistrar.getInstance().registerMBean(view,
                 "Message Forwarding Processor view", getName());
     }
@@ -68,38 +61,18 @@ public class ScheduledMessageForwardingP
     @Override
     protected JobDataMap getJobDataMap() {
         JobDataMap jdm = new JobDataMap();
-        sender = initMessageSender(parameters);
-        jdm.put(BLOCKING_SENDER,sender);
+        jdm.put(BLOCKING_SENDER, getSender());
         jdm.put(PROCESSOR_INSTANCE,this);
         return jdm;
     }
 
-     private BlockingMessageSender initMessageSender(Map<String ,Object> 
params) {
-
-        String axis2repo = (String) 
params.get(ForwardingProcessorConstants.AXIS2_REPO);
-        String axis2Config = (String) 
params.get(ForwardingProcessorConstants.AXIS2_CONFIG);
-
-        sender = new BlockingMessageSender();
-
-        if(axis2repo != null) {
-            sender.setClientRepository(axis2repo);
-        }
-
-
-        if(axis2Config != null) {
-            sender.setAxis2xml(axis2Config);
+    private synchronized Axis2BlockingClient getSender() {
+        if (sender != null) {
+            return sender;
         }
-        sender.init();
-
-        return sender;
-    }
-
-    public BlockingMessageSender getSender() {
-        return sender;
-    }
-
-    public void setSender(BlockingMessageSender sender) {
-        this.sender = sender;
+        String axis2repo = (String) 
parameters.get(ForwardingProcessorConstants.AXIS2_REPO);
+        String axis2Config = (String) 
parameters.get(ForwardingProcessorConstants.AXIS2_CONFIG);
+        return new Axis2BlockingClient(axis2repo, axis2Config);
     }
 
     public boolean isActive() {
@@ -140,7 +113,8 @@ public class ScheduledMessageForwardingP
 
     /**
      * Return the JMS view of Message Processor
-     * @return
+     *
+     * @return MessageForwardingProcessorView
      */
     public MessageForwardingProcessorView getView() {
         return view;

Modified: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml?rev=1517081&r1=1517080&r2=1517081&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml 
(original)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples.xml 
Fri Aug 23 22:41:46 2013
@@ -262,6 +262,7 @@
                         <li><a href="samples/sample701.html">Sample 701: 
Introduction to Message Sampling Processor</a></li>
                         <li><a href="samples/sample702.html">Sample 702: 
Introduction to Message Forwarding Processor</a></li>
                         <li><a href="samples/sample703.html">Sample 703: 
Introduction to Message Resequencing Processor</a></li>
+                        <li><a href="samples/sample704.html">Sample 704: 
Invoke Secured Services with Scheduled Message Forwarding Processor</a></li>
                     </ul>
                 </p>
             </subsection>

Added: 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample704.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample704.xml?rev=1517081&view=auto
==============================================================================
--- 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample704.xml
 (added)
+++ 
synapse/trunk/java/modules/documentation/src/site/xdoc/userguide/samples/sample704.xml
 Fri Aug 23 22:41:46 2013
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you 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.
+  -->
+
+<document>
+    <properties>
+        <title>Apache Synapse - Sample 704</title>
+    </properties>
+    <body>
+        <section name="Sample 704: Invoke Secured Services with Scheduled 
Message Forwarding Processor">
+            <div class="xmlConf">&lt;!-- Invoke Secured Services with 
Scheduled Message Forwarding Processor --&gt;
+                &lt;definitions xmlns="http://ws.apache.org/ns/synapse"&gt;
+                    &lt;localEntry key="sec_policy" 
src="file:repository/conf/sample/resources/policy/policy_3.xml"/&gt;
+                    &lt;endpoint name="SecuredStockQuoteServiceEp"&gt;
+                        &lt;address 
uri="http://localhost:9000/services/SecureStockQuoteService"&gt;
+                            &lt;suspendOnFailure&gt;
+                                &lt;errorCodes&gt;-1&lt;/errorCodes&gt;
+                                
&lt;progressionFactor&gt;1.0&lt;/progressionFactor&gt;
+                            &lt;/suspendOnFailure&gt;
+                            &lt;enableSec policy="sec_policy"/&gt;
+                        &lt;/address&gt;
+                    &lt;/endpoint&gt;
+                    &lt;sequence name="fault"&gt;
+                        &lt;log level="full"&gt;
+                            &lt;property name="MESSAGE" value="Executing 
default 'fault' sequence"/&gt;
+                            &lt;property name="ERROR_CODE" 
expression="get-property('ERROR_CODE')"/&gt;
+                            &lt;property name="ERROR_MESSAGE" 
expression="get-property('ERROR_MESSAGE')"/&gt;
+                        &lt;/log&gt;
+                        &lt;drop/&gt;
+                    &lt;/sequence&gt;
+                    &lt;sequence name="main"&gt;
+                        &lt;in&gt;
+                            &lt;log level="full"/&gt;
+                            &lt;property name="FORCE_SC_ACCEPTED" value="true" 
scope="axis2"/&gt;
+                            &lt;property name="OUT_ONLY" value="true"/&gt;
+                            &lt;property name="target.endpoint" 
value="SecuredStockQuoteServiceEp"/&gt;
+                            &lt;store messageStore="MyStore"/&gt;
+                        &lt;/in&gt;
+                        &lt;description&gt;The main sequence for the message 
mediation&lt;/description&gt;
+                    &lt;/sequence&gt;
+                    &lt;messageStore name="MyStore"/&gt;
+                    &lt;messageProcessor 
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
 name="ScheduledProcessor" messageStore="MyStore"&gt;
+                        &lt;parameter 
name="interval"&gt;10000&lt;/parameter&gt;
+                    &lt;/messageProcessor&gt;
+                &lt;/definitions&gt;
+            </div>
+            <subsection name="Objective">
+                <p>
+                    Invoke Secured Services with Scheduled Message Forwarding 
Processor
+                </p>
+            </subsection>
+            <subsection name="Pre-requisites">
+                <p>
+                    <ul>
+                        <li>
+                            Download and install the Java Cryptography 
Extension (JCE) unlimited
+                            strength policy files for your JDK
+                        </li>
+                        <li>
+                            Start Synapse using the configuration numbered 704 
(repository/conf/sample/synapse_sample_704.xml)
+                            <div class="command">
+                                Unix/Linux: sh synapse.sh -sample 704<br/>
+                                Windows: synapse.bat -sample 704
+                            </div>
+                        </li>
+                    </ul>
+                </p>
+            </subsection>
+            <subsection name="Executing the Client">
+                <p>
+                    Execute the sample client a few times with the following 
command. Note that
+                    we still haven't started the sample Axis2 server.
+                </p>
+                <div class="command">
+                    ant stockquote -Daddurl=http://localhost:8280/ 
-Dmode=placeorder
+                </div>
+
+                <p>
+                    Deploy the SecureStockQuoteService in the sample Axis2 
server and start Axis2.
+                </p>
+                <p>
+                    When you start the service you will see messages getting 
delivered to the service,
+                    even though the service was actually down when we invoked 
the sample client.
+                </p>
+                <p>
+                    Here in the 'main' sequence, store mediator will store the 
placeOrder request
+                    message in the 'MyStore' message store.
+                    Message processor will send the message to the secured 
backend service using the defined endpoint.
+                    Endpoint is configured to use WS-Security.
+                    Message processor will remove the message from the store 
only if the message is delivered
+                    successfully.
+                </p>
+            </subsection>
+        </section>
+        <p>
+            <a href="../samples.html">Back to Catalog</a>
+        </p>
+    </body>
+</document>

Added: synapse/trunk/java/repository/conf/sample/synapse_sample_704.xml
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/repository/conf/sample/synapse_sample_704.xml?rev=1517081&view=auto
==============================================================================
--- synapse/trunk/java/repository/conf/sample/synapse_sample_704.xml (added)
+++ synapse/trunk/java/repository/conf/sample/synapse_sample_704.xml Fri Aug 23 
22:41:46 2013
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+        <!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you 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.
+  -->
+
+<!-- Invoke Secured Services with Scheduled Message Forwarding Processor -->
+
+<definitions xmlns="http://ws.apache.org/ns/synapse";>
+    <localEntry key="sec_policy" 
src="file:repository/conf/sample/resources/policy/policy_3.xml"/>
+    <endpoint name="SecuredStockQuoteServiceEp">
+        <address uri="http://localhost:9000/services/SecureStockQuoteService";>
+            <suspendOnFailure>
+                <errorCodes>-1</errorCodes>
+                <progressionFactor>1.0</progressionFactor>
+            </suspendOnFailure>
+            <enableSec policy="sec_policy"/>
+        </address>
+    </endpoint>
+    <sequence name="fault">
+        <log level="full">
+            <property name="MESSAGE" value="Executing default 'fault' 
sequence"/>
+            <property name="ERROR_CODE" 
expression="get-property('ERROR_CODE')"/>
+            <property name="ERROR_MESSAGE" 
expression="get-property('ERROR_MESSAGE')"/>
+        </log>
+        <drop/>
+    </sequence>
+    <sequence name="main">
+        <in>
+            <log level="full"/>
+            <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
+            <property name="OUT_ONLY" value="true"/>
+            <property name="target.endpoint" 
value="SecuredStockQuoteServiceEp"/>
+            <store messageStore="MyStore"/>
+        </in>
+        <description>The main sequence for the message mediation</description>
+    </sequence>
+    <messageStore name="MyStore"/>
+    <messageProcessor 
class="org.apache.synapse.message.processors.forward.ScheduledMessageForwardingProcessor"
 name="ScheduledProcessor" messageStore="MyStore">
+        <parameter name="interval">10000</parameter>
+    </messageProcessor>
+</definitions>
\ No newline at end of file


Reply via email to