Package org.apache.servicemix.jbi.deployer

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


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

    public boolean isEngine(String componentName) {
        Component component = deployer.getComponent(componentName);
        return component != null && Deployer.TYPE_SERVICE_ENGINE.equals(component.getMainType());
    }
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

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

            SharedLibrary lib = getDeployer().getSharedLibrary(sharedLibraryName);
            if (lib != null) {
                libs.add(lib);
            }
        } else if (componentName != null && componentName.length() > 0) {
            Component component = deployer.getComponent(componentName);
            if (component != null) {
                for (SharedLibrary lib : component.getSharedLibraries()) {
                    libs.add(lib);
                }
            }
        } else {
            libs.addAll(getDeployer().getSharedLibraries().values());
View Full Code Here

     * @param serviceAssemblyName
     * @return
     */
    public String listServiceAssemblies(String state, String componentName, String serviceAssemblyName) throws Exception {
        List<ServiceAssembly> assemblies = new ArrayList<ServiceAssembly>();
        Component component = null;
        if (StringUtils.hasLength(componentName)) {
            component = deployer.getComponent(componentName);
        }
        for (ServiceAssembly sa : deployer.getServiceAssemblies().values()) {
            boolean match = true;
            if (StringUtils.hasLength(serviceAssemblyName)) {
                match = serviceAssemblyName.equals(sa.getName());
            }
            if (match && StringUtils.hasLength(state)) {
                match = state.equalsIgnoreCase(sa.getCurrentState());
            }
            if (match && StringUtils.hasLength(componentName)) {
                match = false;
                if (component != null) {
                    for (ServiceUnit su : component.getServiceUnits()) {
                        if (sa.getName().equals(su.getServiceAssembly().getName())) {
                            match = true;
                            break;
                        }
                    }
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

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.