Examples of ServiceAssembly


Examples of org.servicemix.jbi.deployment.ServiceAssembly

     * @throws Exception if unable to return status of service unit.
     */
    public boolean isDeployedServiceUnit(String componentName, String suName) throws Exception {
        boolean result = false;
        for (Iterator iter = serviceAssembilies.values().iterator();iter.hasNext();) {
            ServiceAssembly sa = (ServiceAssembly) iter.next();
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    if (sus[i].getTarget().getComponentName().equals(componentName)
                            && sus[i].getIdentification().getName().equals(suName)) {
                        result = true;
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

     * @return Result/Status of this operation.
     * @throws Exception if operation fails.
     */
    public String start(String serviceAssemblyName) throws Exception {
        String result = DeploymentServiceMBean.STOPPED;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(serviceAssemblyName);
        if (sa != null) {
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    String componentName = sus[i].getTarget().getComponentName();
                    Component component = container.getComponent(componentName);
                    if (component != null) {
                        ServiceUnitManager sum = component.getServiceUnitManager();
                        if (sum != null) {
                            sum.start(sus[i].getIdentification().getName());
                        }
                    }
                }
            }
            startConnections(sa);
            result = DeploymentServiceMBean.STARTED;
            sa.setState(result);
            log.info("Started Service Assembly: " + serviceAssemblyName);
        }
        return result;
    }
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

     * @return Result/Status of this operation.
     * @throws Exception if operation fails.
     */
    public String stop(String serviceAssemblyName) throws Exception {
        String result = DeploymentServiceMBean.STOPPED;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(serviceAssemblyName);
        if (sa != null) {
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    String componentName = sus[i].getTarget().getComponentName();
                    Component component = container.getComponent(componentName);
                    if (component != null) {
                        ServiceUnitManager sum = component.getServiceUnitManager();
                        if (sum != null) {
                            sum.stop(sus[i].getIdentification().getName());
                        }
                    }
                }
            }
            result = DeploymentServiceMBean.STOPPED;
            sa.setState(result);
            log.info("Stopped Service Assembly: " + serviceAssemblyName);
        }
        return result;
    }
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

     * @return Result/Status of this operation.
     * @throws Exception if operation fails.
     */
    public String shutDown(String serviceAssemblyName) throws Exception {
        String result = DeploymentServiceMBean.STOPPED;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(serviceAssemblyName);
        if (sa != null) {
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    String componentName = sus[i].getTarget().getComponentName();
                    Component component = container.getComponent(componentName);
                    if (component != null) {
                        ServiceUnitManager sum = component.getServiceUnitManager();
                        if (sum != null) {
                            sum.shutDown(sus[i].getIdentification().getName());
                        }
                    }
                }
            }
            result = DeploymentServiceMBean.SHUTDOWN;
            sa.setState(result);
            log.info("Shutdown Service Assembly: " + serviceAssemblyName);
        }
        return result;
    }
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

     * @return State of the service assembly.
     * @throws Exception if operation fails.
     */
    public String getState(String serviceAssemblyName) throws Exception {
        String result = DeploymentServiceMBean.STOPPED;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(serviceAssemblyName);
        if (sa != null) {
            result = sa.getState();
        }
        return result;
    }
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

            if (files != null) {
                for (int i = 0;i < files.length;i++) {
                    if (files[i].isDirectory()) {
                        Descriptor root = AutoDeploymentService.buildDescriptor(files[i]);
                        if (root != null) {
                            ServiceAssembly sa = root.getServiceAssembly();
                            if (sa != null && sa.getIdentification() != null) {
                                String name = sa.getIdentification().getName();
                                try {
                                    initSA(sa);
                                    sa.setState(DeploymentServiceMBean.STARTED);
                                    serviceAssembilies.put(name, sa);
                                    buildConnections(sa);
                                }
                                catch (JBIException e) {
                                    log.warn("Failed to deploy Service Assembly: " + name, e);
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

                }
                else if (root.getSharedLibrary() != null) {
                    installationService.doInstallSharedLibrary(tmp, root.getSharedLibrary());
                }
                else if (root.getServiceAssembly() != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    String name = sa.getIdentification().getName();
                    try {
                        if (deploymentService.isSaDeployed(name)) {
                            deploymentService.shutDown(name);
                            deploymentService.undeploy(name);
                            deploymentService.deploy(tmp, sa);
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

        File tmpDir = (File) pendingSAs.remove(componentName);
        if (tmpDir != null) {
            try {
                Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
                if (root != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    if (sa != null && sa.getIdentification() != null) {
                        String name = sa.getIdentification().getName();
                        log.info("auto deploying Service Assembly: " + name);
                        if (!deploymentService.isSaDeployed(name)) {
                            deploymentService.deploy(tmpDir, sa);
                            deploymentService.start(name);
                        }
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

    private void autoRemoveSAs(String componentName) {
        for (Iterator i = descriptorMap.entrySet().iterator();i.hasNext();) {
            Map.Entry entry = (Map.Entry) i.next();
            Descriptor root = (Descriptor) entry.getValue();
            if (root != null && root.getServiceAssembly() != null) {
                ServiceAssembly sa = root.getServiceAssembly();
                String name = sa.getIdentification().getName();
                if (deploymentService.isSaDeployed(name)) {
                    // remove
                    try {
                        deploymentService.shutDown(name);
                        deploymentService.undeploy(name);
View Full Code Here

Examples of org.servicemix.jbi.deployment.ServiceAssembly

                    String name = root.getSharedLibrary().getIdentification().getName();
                    log.info("removing shared library: " + name);
                    installationService.uninstallSharedLibrary(name);
                }
                if (root.getServiceAssembly() != null) {
                    ServiceAssembly sa = root.getServiceAssembly();
                    String name = sa.getIdentification().getName();
                    log.info("removing service assembly " + name);
                    try {
                        if (deploymentService.isSaDeployed(name)) {
                            deploymentService.shutDown(name);
                            deploymentService.undeploy(name);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.