Package org.apache.synapse.endpoints

Examples of org.apache.synapse.endpoints.Endpoint


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

        try {
            Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties);
            if (ep != null) {
                ep.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint named '" + ep.getName()
                            + "' has been built from the file " + fileName);
                }
                ep.init(getSynapseEnvironment());
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the endpoint : " + ep.getName());
                }
                getSynapseConfiguration().addEndpoint(ep.getName(), ep);
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint Deployment from file : " + fileName + " : Completed");
                }
                log.info("Endpoint named '" + ep.getName()
                        + "' has been deployed from file : " + fileName);
                return ep.getName();
            } else {
                handleSynapseArtifactDeploymentError("Endpoint Deployment Failed. The artifact " +
                        "described in the file " + fileName + " is not an Endpoint");
            }
        } catch (Exception e) {
View Full Code Here


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

        try {
            Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties);
            if (ep != null) {
                ep.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint named '" + ep.getName()
                            + "' has been built from the file " + fileName);
                }
                ep.init(getSynapseEnvironment());
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the endpoint : " + ep.getName());
                }
                Endpoint existingEp
                        = getSynapseConfiguration().getDefinedEndpoints().get(existingArtifactName);
                getSynapseConfiguration().removeEndpoint(existingArtifactName);
                if (!existingArtifactName.equals(ep.getName())) {
                    log.info("Endpoint named " + existingArtifactName + " has been Undeployed");
                }
                getSynapseConfiguration().addEndpoint(ep.getName(), ep);
                existingEp.destroy();
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint " + (existingArtifactName.equals(ep.getName()) ?
                            "update" : "deployment") + " from file : " + fileName + " : Completed");
                }
                log.info("Endpoint named '" + ep.getName()
View Full Code Here

            log.debug("Endpoint Undeployment of the endpoint named : "
                    + artifactName + " : Started");
        }
       
        try {
            Endpoint ep = getSynapseConfiguration().getDefinedEndpoints().get(artifactName);
            if (ep != null) {
                getSynapseConfiguration().removeEndpoint(artifactName);
                if (log.isDebugEnabled()) {
                    log.debug("Destroying the endpoint named : " + artifactName);
                }
                ep.destroy();
                if (log.isDebugEnabled()) {
                    log.debug("Endpoint Undeployment of the endpoint named : "
                            + artifactName + " : Completed");
                }
                log.info("Endpoint named '" + ep.getName() + "' has been undeployed");
            } else if (log.isDebugEnabled()) {
                log.debug("Endpoint " + artifactName + " has already been undeployed");
            }
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError("Endpoint Undeployement of endpoint named : "
View Full Code Here

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

        try {
            Endpoint ep
                    = getSynapseConfiguration().getDefinedEndpoints().get(artifactName);
            OMElement epElem = EndpointSerializer.getElementFromEndpoint(ep);
            if (ep.getFileName() != null) {
                String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
                        + File.separator + MultiXMLConfigurationBuilder.ENDPOINTS_DIR
                        + File.separator + ep.getFileName();
                writeToFile(epElem, fileName);
                if (log.isDebugEnabled()) {
                    log.debug("Restoring the Endpoint with name : "
                            + artifactName + " : Completed");
                }
View Full Code Here

                "</endpoint>" +
                "</loadbalance>" +
                "</endpoint>";

        OMElement inputElement = createOMElement(inputXml);
        Endpoint endpoint = LoadbalanceEndpointFactory.getEndpointFromElement(
                inputElement,true,null);
        OMElement serializedOut = LoadbalanceEndpointSerializer.getElementFromEndpoint(endpoint);

        assertTrue(compare(serializedOut,inputElement));
    }
View Full Code Here

    public void testSimpleObserver() {
        SynapseConfiguration synapseConfig = new SynapseConfiguration();
        synapseConfig.setAxisConfiguration(new AxisConfiguration());
        synapseConfig.registerObserver(observer);

        Endpoint epr = new AddressEndpoint();
        epr.setName("endpoint1");
        synapseConfig.addEndpoint(epr.getName(), epr);
        assertItemAdded(epr.getName(), ENDPOINT);
        synapseConfig.removeEndpoint(epr.getName());
        assertItemRemoved(epr.getName(), ENDPOINT);

        SequenceMediator seq = new SequenceMediator();
        seq.setName("sequence1");
        synapseConfig.addSequence(seq.getName(), seq);
        assertItemAdded(seq.getName(), SEQUENCE);
View Full Code Here

        this.target = target;
    }

    public void init(SynapseEnvironment se) {
        if (target != null) {
            Endpoint endpoint = target.getEndpoint();
            if (endpoint != null) {
                endpoint.init(se);
            }

            ManagedLifecycle seq = target.getSequence();
            if (seq != null) {
                seq.init(se);
View Full Code Here

        }
    }

    public void destroy() {
        if (target != null) {
            Endpoint endpoint = target.getEndpoint();
            if (endpoint != null && endpoint.isInitialized()) {
                endpoint.destroy();
            }

            ManagedLifecycle seq = target.getSequence();
            if (seq != null) {
                seq.destroy();
View Full Code Here

            // there can always be only one instance of an Endpoint in the faultStack of a message
            // if the send was successful, so remove it before we proceed any further
            Stack faultStack = synapseOutMsgCtx.getFaultStack();
            if (faultStack !=null && !faultStack.isEmpty()
                && faultStack.peek() instanceof Endpoint) {
                Endpoint successfulEndpoint = (Endpoint) faultStack.pop();
                successfulEndpoint.onSuccess();
            }
            if (log.isDebugEnabled()) {
                log.debug("Synapse received an asynchronous response message");
                log.debug("Received To: " +
                        (response.getTo() != null ? response.getTo().getAddress() : "null"));
View Full Code Here

        for (Target target : targets) {
            ManagedLifecycle seq = target.getSequence();
            if (seq != null) {
                seq.init(se);
            }
            Endpoint endpoint = target.getEndpoint();
            endpoint.init(se);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.endpoints.Endpoint

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.