Package org.apache.servicemix.jbi.deployer

Examples of org.apache.servicemix.jbi.deployer.Component


        }
        return result;
    }

    protected ComponentInstaller getComponentInstaller(String name) {
        Component component = deployer.getComponent(name);
        return (ComponentInstaller) deployer.getInstaller(component);
    }
View Full Code Here


    private void checkSus(ServiceUnitDesc[] sus) throws Exception {
        if (sus != null) {
            for (int i = 0; i < sus.length; i++) {
                String suName = sus[i].getIdentification().getName();
                String componentName = sus[i].getTarget().getComponentName();
                Component component = deployer.getComponent(componentName);
                if (component == null) {
                    throw ManagementSupport.failure("deploy", "Target component " + componentName
                            + " for service unit " + suName + " is not installed");
                }
                if (!component.getCurrentState().equals(LifeCycleMBean.STARTED)) {
                    throw ManagementSupport.failure("deploy", "Target component " + componentName
                            + " for service unit " + suName + " is not started");
                }
                if (component.getComponent().getServiceUnitManager() == null) {
                    throw ManagementSupport.failure("deploy", "Target component " + componentName
                            + " for service unit " + suName + " does not accept deployments");
                }

                if (isDeployedServiceUnit(componentName, suName)) {
View Full Code Here

        installer.uninstall(false);
        return ManagementSupport.createSuccessMessage("undeploy", "Service assembly " + saName + " undeployed");
    }

    public String[] getDeployedServiceUnitList(String componentName) throws Exception {
        Component component = deployer.getComponent(componentName);

        ServiceUnit[] serviceUnits = component.getServiceUnits();
        String[] sus = new String[serviceUnits.length];
        for (int i = 0; i < serviceUnits.length; i++) {
            sus[i] = serviceUnits[i].getName();
        }
        return sus;
View Full Code Here

        ServiceAssembly sa = deployer.getServiceAssembly(saName);
        return sa != null ? sa.getDescriptor() : null;
    }

    public boolean canDeployToComponent(String componentName) {
        Component component = deployer.getComponent(componentName);
        return component != null
                && LifeCycleMBean.STARTED.equals(component.getCurrentState())
                && component.getComponent().getServiceUnitManager() != null;
    }
View Full Code Here

            throw new IllegalArgumentException("Can not specify options -c and -a at the same time!");
        }
        for (String artifact : artifacts) {
            try {
                if ((!isComponent && !isAssembly) || isComponent) {
                    Component component = getComponent(artifact);
                    if (component != null) {
                        handle(component);
                        continue;
                    }
                }
View Full Code Here

        }
        return names.toArray(new ObjectName[names.size()]);
    }

    public ObjectName getComponentByName(String name) {
        Component component = deployer.getComponent(name);
        if (component != null) {
            try {
                return namingStrategy.getObjectName(component);
            } catch (MalformedObjectNameException e) {
            }
View Full Code Here

        // TODO
        return new ObjectName[0];
    }

    public boolean isBinding(String componentName) {
        Component component = deployer.getComponent(componentName);
        return component != null && Deployer.TYPE_BINDING_COMPONENT.equals(component.getType());
    }
View Full Code Here

        Component component = deployer.getComponent(componentName);
        return component != null && Deployer.TYPE_BINDING_COMPONENT.equals(component.getType());
    }

    public boolean isEngine(String componentName) {
        Component component = deployer.getComponent(componentName);
        return component != null && Deployer.TYPE_SERVICE_ENGINE.equals(component.getType());
    }
View Full Code Here

     *
     * @param name
     * @return
     */
    public String startComponent(String name) throws Exception {
        Component component = deployer.getComponent(name);
        if (component == null) {
            throw ManagementSupport.failure("start", "Component does not exist: " + name);
        }
        try {
            component.start();
            return ManagementSupport.createSuccessMessage("Component started", name);
        } catch (Throwable e) {
            throw ManagementSupport.failure("startComponent", name, e);
        }
    }
View Full Code Here

     *
     * @param name
     * @return
     */
    public String stopComponent(String name) throws Exception {
        Component component = deployer.getComponent(name);
        if (component == null) {
            throw ManagementSupport.failure("stop", "Component does not exist: " + name);
        }
        try {
            component.stop();
            return ManagementSupport.createSuccessMessage("Component stopped", name);
        } catch (Throwable e) {
            throw ManagementSupport.failure("stopComponent", name, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.deployer.Component

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.