Package org.apache.synapse

Examples of org.apache.synapse.Startup


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

        try {
            Startup st = StartupFinder.getInstance().getStartup(artifactConfig, properties);
                st.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("StartupTask named '" + st.getName()
                            + "' has been built from the file " + fileName);
                }
                st.init(getSynapseEnvironment());
                if (log.isDebugEnabled()) {
                    log.debug("Initialized the StartupTask : " + st.getName());
                }
                Startup existingSt =
                        getSynapseConfiguration().getStartup(existingArtifactName);
                getSynapseConfiguration().removeStartup(existingArtifactName);
                if (!existingArtifactName.equals(st.getName())) {
                    log.info("StartupTask named '" + existingArtifactName + "' has been Undeployed");
                }
                getSynapseConfiguration().addStartup(st);
                existingSt.destroy();
                if (log.isDebugEnabled()) {
                    log.debug("StartupTask " + (existingArtifactName.equals(st.getName()) ?
                            "update" : "deployment") + " from file : " + fileName + " : Completed");
                }
                log.info("StartupTask named '" + st.getName()
View Full Code Here


            log.debug("StartupTask Undeployment of the task named : "
                    + artifactName + " : Started");
        }

        try {
            Startup st = getSynapseConfiguration().getStartup(artifactName);
            if (st != null) {
                getSynapseConfiguration().removeStartup(artifactName);
                if (log.isDebugEnabled()) {
                    log.debug("Destroying the StartupTask named : " + artifactName);
                }
                st.destroy();
                if (log.isDebugEnabled()) {
                    log.debug("StartupTask Undeployment of the sequence named : "
                            + artifactName + " : Completed");
                }
                log.info("StartupTask named '" + st.getName() + "' has been undeployed");
            } else if (log.isDebugEnabled()) {
                log.debug("Startup task " + artifactName + " has already been undeployed");
            }
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError(
View Full Code Here

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

        try {
            Startup st = getSynapseConfiguration().getStartup(artifactName);
            OMElement stElem = StartupFinder.getInstance().serializeStartup(null, st);
            if (st.getFileName() != null) {
                String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
                        + File.separator + MultiXMLConfigurationBuilder.TASKS_DIR
                        + File.separator + st.getFileName();
                writeToFile(stElem, fileName);
                if (log.isDebugEnabled()) {
                    log.debug("Restoring the StartupTask with name : " + artifactName + " : Completed");
                }
                log.info("StartupTask named '" + artifactName + "' has been restored");
View Full Code Here

            }
            File[] taskDefinitions = tasksDir.listFiles(filter);
            for (File file : taskDefinitions) {
                try {
                    OMElement document = parseFile(file);
                    Startup startup = SynapseXMLConfigurationFactory.defineStartup(
                            synapseConfig, document, properties);
                    startup.setFileName(file.getName());
                    synapseConfig.getArtifactDeploymentStore().addArtifact(
                            file.getAbsolutePath(), startup.getName());
                } catch (FileNotFoundException ignored) {}
            }
        }
    }
View Full Code Here

        return registry;
    }

    public static Startup defineStartup(SynapseConfiguration config, OMElement elem,
                                        Properties properties) {
        Startup startup = StartupFinder.getInstance().getStartup(elem, properties);
        config.addStartup(startup);
        return startup;
    }
View Full Code Here

    }

    private static void serializeStartups(OMElement definitions, Collection startups) {
        for (Object o : startups) {
            if (o instanceof Startup) {
                Startup s = (Startup) o;
                StartupFinder.getInstance().serializeStartup(definitions, s);
            }
        }
    }
View Full Code Here

        }
        config.setRegistry(RegistryFactory.createRegistry(elem));
    }

    private static void defineStartup(SynapseConfiguration config, OMElement elem) {
        Startup startup = StartupFinder.getInstance().getStartup(elem);
        if (config.getStartup(startup.getName()) != null) {
            handleException("Duplicate startup with name : " + startup.getName());
        }
        config.addStartup(startup);
    }
View Full Code Here

    }

    private static void serializeStartups(OMElement definitions, Collection startups) {
        Iterator it = startups.iterator();
        while (it.hasNext()) {
            Startup s = (Startup) it.next();
            StartupFinder.getInstance().serializeStartup(definitions, s);
        }
    }
View Full Code Here

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

        try {
            Startup st = StartupFinder.getInstance().getStartup(artifactConfig, properties);
            st.setFileName((new File(fileName)).getName());
            if (log.isDebugEnabled()) {
                log.debug("StartupTask named '" + st.getName()
                        + "' has been built from the file " + fileName);
            }
            st.init(getSynapseEnvironment());
            if (log.isDebugEnabled()) {
                log.debug("Initialized the StartupTask : " + st.getName());
            }
            getSynapseConfiguration().addStartup(st);
            if (log.isDebugEnabled()) {
                log.debug("StartupTask Deployment from file : " + fileName + " : Completed");
            }
            log.info("StartupTask named '" + st.getName()
                    + "' has been deployed from file : " + fileName);
            return st.getName();
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError(
                    "StartupTask Deployment from the file : " + fileName + " : Failed.", e);
        }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("StartupTask update from file : " + fileName + " has started");
        }

        try {
            Startup st = StartupFinder.getInstance().getStartup(artifactConfig, properties);
            st.setFileName((new File(fileName)).getName());

            if (log.isDebugEnabled()) {
                log.debug("StartupTask: " + st.getName() + " has been built from the file: " + fileName);
            }

            Startup existingSt = getSynapseConfiguration().getStartup(existingArtifactName);
            existingSt.destroy();

            st.init(getSynapseEnvironment());
            if (existingArtifactName.equals(st.getName())) {
                getSynapseConfiguration().updateStartup(st);
            } else {
View Full Code Here

TOP

Related Classes of org.apache.synapse.Startup

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.