Package org.apache.synapse.core.axis2

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


        }

        // add proxy services
        Iterator iter = synCfg.getProxyServices().iterator();
        while (iter.hasNext()) {
            ProxyService service = (ProxyService) iter.next();
            ProxyServiceSerializer.serializeProxy(definitions, service);
        }

        Map entries = new HashMap();
        Map endpoints = new HashMap();
View Full Code Here


     *
     * @param name
     *            of the Proxy Service to be deleted
     */
    public synchronized void removeProxyService(String name) {
        ProxyService proxy = proxyServices.get(name);
        if (proxy == null) {
            handleException("Unknown proxy service for name : " + name);
        } else {
            try {
                if (getAxisConfiguration().getServiceForActivation(name) != null) {
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("ProxyService Deployment from file : " + fileName + " : Started");
        }

        try {
            ProxyService proxy = ProxyServiceFactory.createProxy(artifactConfig, properties);
            if (proxy != null) {
                proxy.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("ProxyService named '" + proxy.getName()
                            + "' has been built from the file " + fileName);
                }
                initializeProxy(proxy);
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the ProxyService : " + proxy.getName());
                }

                proxy.buildAxisService(getSynapseConfiguration(),
                        getSynapseConfiguration().getAxisConfiguration());
                if (log.isDebugEnabled()) {
                    log.debug("Started the ProxyService : " + proxy.getName());
                }
                getSynapseConfiguration().addProxyService(proxy.getName(), proxy);
                if (log.isDebugEnabled()) {
                    log.debug("ProxyService Deployment from file : " + fileName + " : Completed");
                }
                log.info("ProxyService named '" + proxy.getName()
                        + "' has been deployed from file : " + fileName);
                return proxy.getName();
            } else {
                handleSynapseArtifactDeploymentError("ProxyService Deployment Failed. The " +
                        "artifact described in the file " + fileName + " is not a ProxyService");
            }
        } catch (Exception e) {
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("ProxyService Update from file : " + fileName + " : Started");
        }

        try {
            ProxyService proxy = ProxyServiceFactory.createProxy(artifactConfig, properties);
            if (proxy != null) {
                proxy.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("ProxyService named '" + proxy.getName()
                            + "' has been built from the file " + fileName);
                }
                initializeProxy(proxy);
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the ProxyService : " + proxy.getName());
                }
                ProxyService currentProxy = getSynapseConfiguration().getProxyService(existingArtifactName);
                currentProxy.stop(getSynapseConfiguration());
                getSynapseConfiguration().removeProxyService(existingArtifactName);
                if (!existingArtifactName.equals(proxy.getName())) {
                    log.info("ProxyService named " + existingArtifactName + " has been Undeployed");
                }
                proxy.buildAxisService(getSynapseConfiguration(),
View Full Code Here

            log.debug("ProxyService Undeployment of the proxy named : "
                    + artifactName + " : Started");
        }
       
        try {
            ProxyService proxy = getSynapseConfiguration().getProxyService(artifactName);
            if (proxy != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Stopping the ProxyService named : " + artifactName);
                }
                proxy.stop(getSynapseConfiguration());
                getSynapseConfiguration().removeProxyService(artifactName);
                if (log.isDebugEnabled()) {
                    log.debug("ProxyService Undeployment of the proxy named : "
                            + artifactName + " : Completed");
                }
                log.info("ProxyService named '" + proxy.getName() + "' has been undeployed");
            } else if (log.isDebugEnabled()) {
                log.debug("Proxy service " + artifactName + " has already been undeployed");
            }
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError(
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Restoring the ProxyService with name : " + artifactName + " : Started");
        }

        try {
            ProxyService proxy
                    = getSynapseConfiguration().getProxyService(artifactName);
            OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, proxy);
            if (proxy.getFileName() != null) {
                String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
                        + File.separator + MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR
                        + File.separator + proxy.getFileName();
                writeToFile(proxyElem, fileName);
                if (log.isDebugEnabled()) {
                    log.debug("Restoring the ProxyService with name : "
                            + artifactName + " : Completed");
                }
View Full Code Here

        }
        ConfigurationContext cfgCtx = new ConfigurationContext(axisConfig);
        mc.setConfigurationContext(cfgCtx);
        mc.setEnvelope(TestUtils.getTestContext("<empty/>").getEnvelope());

        new SynapseMessageReceiver().receive(mc);

        assertTrue("T1.T2.T4".equals(result.toString()));
    }
View Full Code Here

        MessageContextCreatorForAxis2.setSynConfig(synapseConfig);
        MessageContextCreatorForAxis2.setSynEnv(synCtx.getEnvironment());

        org.apache.axis2.context.MessageContext mc = ((Axis2MessageContext) synCtx).getAxis2MessageContext();
        mc.setConfigurationContext(((Axis2SynapseEnvironment) synCtx.getEnvironment()).getAxis2ConfigurationContext());
        new SynapseMessageReceiver().receive(mc);
        assertEquals("seq.in.value", mc.getProperty("seq.in"));
        assertEquals("seq.fault.value", mc.getProperty("seq.fault"));
    }
View Full Code Here

        MessageContextCreatorForAxis2.setSynEnv(new Axis2SynapseEnvironment());
        org.apache.axis2.context.MessageContext mc =
            new org.apache.axis2.context.MessageContext();
        mc.setEnvelope(TestUtils.getTestContext("<empty/>").getEnvelope());

        new SynapseMessageReceiver().receive(mc);

        assertTrue("T1.T2.T4".equals(result.toString()));
    }
View Full Code Here

        MessageContextCreatorForAxis2.setSynEnv(new Axis2SynapseEnvironment(synConfig));
        org.apache.axis2.context.MessageContext mc =
            new org.apache.axis2.context.MessageContext();
        mc.setEnvelope(TestUtils.getTestContext("<empty/>").getEnvelope());

        new SynapseMessageReceiver().receive(mc);

        assertTrue("T1.T2.T4".equals(result.toString()));
    }
View Full Code Here

TOP

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

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.