Package org.apache.synapse.core.axis2

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


     */
    public String redeployProxyService(String proxyName) throws ProxyAdminException {
        final Lock lock = getLock();
        try {
            lock.lock();
            ProxyService currentProxy = getSynapseConfiguration().getProxyService(proxyName);
            if (currentProxy != null) {
                if(log.isDebugEnabled()) {
                    log.debug("Redeploying proxy service : " + proxyName);
                }
                OMElement proxyElement = ProxyServiceSerializer.serializeProxy(null, currentProxy);
View Full Code Here


    public ProxyData getProxy(String proxyName) throws ProxyAdminException {
        final Lock lock = getLock();
        try {
            lock.lock();
            ProxyService ps = proxyForName(proxyName);
            return generateProxyDataFor(ps);
        } finally {
            lock.unlock();
        }
    }
View Full Code Here

        }
    }

    private ProxyService proxyForName(String proxyName) throws ProxyAdminException {
        try {
            ProxyService ps = getSynapseConfiguration().getProxyService(proxyName);
            if (ps != null) {
                return ps;
            } else {
                handleException(log, "A proxy service named : "
                        + proxyName + " does not exist", null);
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

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

        }

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

        // Add Event sources
        for (SynapseEventSource eventSource : synCfg.getEventSources()) {
View Full Code Here

            Iterator proxyDefinitions = FileUtils.iterateFiles(proxyServicesDir, extensions, false);
            while (proxyDefinitions.hasNext()) {
                File file = (File) proxyDefinitions.next();
                OMElement document = getOMElement(file);
                ProxyService proxy = SynapseXMLConfigurationFactory.defineProxy(synapseConfig,
                        document, properties);
                if (proxy != null) {
                    proxy.setFileName(file.getName());
                    synapseConfig.getArtifactDeploymentStore().addArtifact(
                            file.getAbsolutePath(), proxy.getName());
                 }
             }
        }
    }
View Full Code Here

        return startup;
    }

    public static ProxyService defineProxy(SynapseConfiguration config, OMElement elem,
                                           Properties properties) {
        ProxyService proxy = null;

        try {
            proxy = ProxyServiceFactory.createProxy(elem, properties);
            if (proxy != null) {
                config.addProxyService(proxy.getName(), proxy);
            }
        } catch (Exception e) {
            String msg = "Proxy Service configuration: " + elem.getAttributeValue((
                    new QName(XMLConfigConstants.NULL_NAMESPACE, "name"))) + " cannot be built";
            handleConfigurationError(SynapseConstants.FAIL_SAFE_MODE_PROXY_SERVICES, msg, e);
View Full Code Here

        return null;
    }

    private void validateProxyService(OMElement proxyElement, List<ValidationError> errors) {
        try {
            ProxyService proxy = ProxyServiceFactory.createProxy(proxyElement, new Properties());
            URI wsdl = proxy.getWsdlURI();
            if (wsdl != null && !testURL(wsdl.toString())) {
                errors.add(newValidationError(proxyElement, "WSDL URL is not accessible"));
            }
        } catch (Exception e) {
            errors.add(newValidationError(proxyElement, e.getMessage()));
View Full Code Here

TOP

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

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.