Package org.servicemix.jbi.deployment

Examples of org.servicemix.jbi.deployment.ServiceAssembly


     */
    public String deploy(String saZipURL) throws Exception {
        String result = null;
        File tmpDir = AutoDeploymentService.unpackLocation(environmentContext.getTmpDir(), saZipURL);
        Descriptor root = AutoDeploymentService.buildDescriptor(tmpDir);
        ServiceAssembly sa = root.getServiceAssembly();
        if (sa != null) {
            result = deploy(tmpDir, sa);
        }
        else {
            throw new DeploymentException("Not an assembly: " + saZipURL);
View Full Code Here


     * @return Result/Status of the SA undeployment.
     * @throws Exception if compelete undeployment fails.
     */
    public String undeploy(String saName) throws Exception {
        String result = null;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.remove(saName);
        if (sa != null) {
            String assemblyName = sa.getIdentification().getName();
            File saDirectory = environmentContext.createSALibDirectory(assemblyName);
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    undeployServiceUnit(sus[i]);
                }
            }
View Full Code Here

    public String[] getDeployedServiceUnitList(String componentName) throws Exception {
        String[] result = null;
        // iterate through the service assembilies
        List tmpList = new ArrayList();
        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)) {
                        tmpList.add(sus[i].getIdentification().getName());
                    }
View Full Code Here

     * @return descriptor of the Service Assembly.
     * @throws Exception if unable to retrieve descriptor.
     */
    public String getServiceAssemblyDescriptor(String saName) throws Exception {
        String result = null;
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(saName);
        if (sa != null) {
            result = sa.getIdentification().getDescription();
        }
        return result;
    }
View Full Code Here

    public String[] getDeployedServiceAssembliesForComponent(String componentName) throws Exception {
        String[] result = null;
        // iterate through the service assembilies
        Set tmpList = new HashSet();
        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)) {
                        tmpList.add(sa.getIdentification().getName());
                    }
                }
            }
        }
        result = new String[tmpList.size()];
View Full Code Here

     * @throws Exception if unable to retrieve component list.
     */
    public String[] getComponentsForDeployedServiceAssembly(String saName) throws Exception {
        String[] result = null;
        Set tmpList = new HashSet();
        ServiceAssembly sa = (ServiceAssembly) serviceAssembilies.get(saName);
        if (sa != null) {
            ServiceUnit[] sus = sa.getServiceUnits();
            if (sus != null) {
                for (int i = 0;i < sus.length;i++) {
                    tmpList.add(sus[i].getTarget().getComponentName());
                }
            }
View Full Code Here

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

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

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

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

TOP

Related Classes of org.servicemix.jbi.deployment.ServiceAssembly

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.