Package org.apache.synapse

Examples of org.apache.synapse.Startup


            Iterator taskDefinitions = FileUtils.iterateFiles(tasksDir, extensions, false);
            while (taskDefinitions.hasNext()) {
                File file = (File) taskDefinitions.next();
                OMElement document = getOMElement(file);
                Startup startup = SynapseXMLConfigurationFactory.defineStartup(synapseConfig,
                        document, properties);
                startup.setFileName(file.getName());
                synapseConfig.getArtifactDeploymentStore().addArtifact(
                        file.getAbsolutePath(), startup.getName());
             }
        }
    }
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);
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

        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

            }
        }

        Collection<Startup> tasks = newConfig.getStartups();
        for (Startup task : tasks) {
            Startup oldTask = currentConfig.getStartup(task.getName());
            if (oldTask != null) {
                task.setFileName(oldTask.getFileName());
            }
        }

        Collection<SynapseEventSource> eventSources = newConfig.getEventSources();
        for (SynapseEventSource eventSource : eventSources) {
View Full Code Here

            } else if (SynapseAppDeployerConstants.EVENT_SOURCE_TYPE.equals(type)) {
                eventList.add(instanceName);
            } else if (SynapseAppDeployerConstants.MEDIATOR_TYPE.equals(type)) {
                mediatorList.add(instanceName);
            } else if (SynapseAppDeployerConstants.TASK_TYPE.equals(type)) {
                Startup task = SynapseAppServiceComponent.getScService().
                        getSynapseConfiguration().getStartup(instanceName);
                TaskDescription taskDescription = ((SimpleQuartz) task).getTaskDescription();
                TaskMetadata taskMetadata = new TaskMetadata();
                taskMetadata.setName(taskDescription.getName());
                taskMetadata.setGroupName(taskDescription.getGroup());
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

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.