Package org.apache.synapse.core.axis2

Examples of org.apache.synapse.core.axis2.Axis2SynapseEnvironment


   
    private boolean continueAfterExplicitlySet;
   
    public boolean mediate(MessageContext synCtx) {
       
        Axis2MessageContext axis2smc = (Axis2MessageContext) synCtx;
        org.apache.axis2.context.MessageContext axis2MessageCtx =
                axis2smc.getAxis2MessageContext();
        Object headers = axis2MessageCtx.getProperty(
                org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS);
        Map<String, String> evaluatorHeaders = new HashMap<String, String>();

        if (headers != null && headers instanceof Map) {
View Full Code Here


    public static MessageContext cloneMessageContext(MessageContext synCtx) throws AxisFault {

        // creates the new MessageContext and clone the internal axis2 MessageContext
        // inside the synapse message context and place that in the new one
        MessageContext newCtx = synCtx.getEnvironment().createMessageContext();
        Axis2MessageContext axis2MC = (Axis2MessageContext) newCtx;
        axis2MC.setAxis2MessageContext(
            cloneAxis2MessageContext(((Axis2MessageContext) synCtx).getAxis2MessageContext()));

        newCtx.setConfiguration(synCtx.getConfiguration());
        newCtx.setEnvironment(synCtx.getEnvironment());
        newCtx.setContextEntries(synCtx.getContextEntries());
View Full Code Here

            if (log.isDebugEnabled()) {
                log.debug("RMSequence Mediator  ::  only axis2 message context is supported ");
            }
            return true;
        }
        Axis2MessageContext axis2MessageCtx = (Axis2MessageContext) smc;
        org.apache.axis2.context.MessageContext orgMessageCtx =
            axis2MessageCtx.getAxis2MessageContext();

        cleanupSequenceMap();

        String version = getVersionValue();
        orgMessageCtx.getOptions().setProperty(
View Full Code Here

        } else if(Constants.SCOPE_CORRELATE.equals(getScope())) {
            smc.setCorrelationProperty(getName(), value);

        } else if (Constants.SCOPE_AXIS2.equals(getScope()) && smc instanceof Axis2MessageContext) {
            Axis2MessageContext axis2smc = (Axis2MessageContext) smc;
            org.apache.axis2.context.MessageContext axis2MessageCtx =
                axis2smc.getAxis2MessageContext();
            axis2MessageCtx.getConfigurationContext().setProperty(getName(), value);

        } else {
            String msg = "Unsupported scope : " + scope + " for set-property mediator";
            log.error(msg);
View Full Code Here

     */
    public MessageContext build() throws Exception {
        SynapseConfiguration testConfig = new SynapseConfiguration();
        // TODO: check whether we need a SynapseEnvironment in all cases
        SynapseEnvironment synEnv
            = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()),
                                          testConfig);
        MessageContext synCtx;
        if (requireAxis2MessageContext) {
            synCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(),
                                             testConfig, synEnv);
View Full Code Here

     */
    public MessageContext build() throws Exception {
        SynapseConfiguration testConfig = new SynapseConfiguration();
        // TODO: check whether we need a SynapseEnvironment in all cases
        SynapseEnvironment synEnv
            = new Axis2SynapseEnvironment(new ConfigurationContext(new AxisConfiguration()),
                                          testConfig);
        MessageContext synCtx;
        if (requireAxis2MessageContext) {
            synCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(),
                                             testConfig, synEnv);
View Full Code Here

        algorithm.setLoadBalanceEndpoint(loadbalanceEndpoint);

        loadbalanceEndpoint.setChildren(endpoints);
        loadbalanceEndpoint.setAlgorithm(algorithm);

        SynapseEnvironment env = new Axis2SynapseEnvironment(
                new ConfigurationContext(new AxisConfiguration()), new SynapseConfiguration());
        loadbalanceEndpoint.init(env);
        return loadbalanceEndpoint;
    }
View Full Code Here

        try {
            SynapseConfiguration synapseConfig = new SynapseConfiguration();
            AxisConfiguration axisConfig = new AxisConfiguration();
            synapseConfig.setAxisConfiguration(axisConfig);
            ConfigurationContext cfgCtx = new ConfigurationContext(axisConfig);
            SynapseEnvironment env = new Axis2SynapseEnvironment(cfgCtx, synapseConfig);
            axisConfig.addParameter(SynapseConstants.SYNAPSE_CONFIG, synapseConfig);
            axisConfig.addParameter(SynapseConstants.SYNAPSE_ENV, env);

            MessageContext msgCtx = TestUtils.getAxis2MessageContext(payload, null).
                    getAxis2MessageContext();
View Full Code Here

* test resources.
*/
public class HessianMessageBuilderTest extends TestCase {

    public void testProcessDocumentFaultWithSynEnv() throws IOException {
        SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(
                new AxisConfiguration()), new SynapseConfiguration());
        testProcessDocumentFault(synEnv);
    }
View Full Code Here

    public void testProcessDocumentFaultWithoutSynEnv() throws IOException {
        testProcessDocumentFault(null);
    }

    public void testProcessDocumentWithSynEnv() throws IOException {
        SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(
                new AxisConfiguration()), new SynapseConfiguration());
        testProcessDocument(synEnv);
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.core.axis2.Axis2SynapseEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.