Package org.apache.servicemix.jbi.deployer

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


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

    public void init() throws Exception {
        // Check requirements
        for (ServiceUnitDesc sud : descriptor.getServiceAssembly().getServiceUnits()) {
            String componentName = sud.getTarget().getComponentName();
            Component component = deployer.getComponent(componentName);
            if (component == null) {
                throw new PendingException(bundle, "Component not installed: " + componentName);
            }
            if (!LifeCycleMBean.STARTED.equals(component.getCurrentState())) {
                throw new PendingException(bundle, "Component is not started: " + componentName);
            }
        }
        // Extract bundle
        super.init();
View Full Code Here

                innerComponent = (javax.jbi.component.Component) clazz.newInstance();
            } finally {
                Thread.currentThread().setContextClassLoader(oldCl);
            }
        }
        Component component = deployer.registerComponent(getBundle(), componentDesc, innerComponent, aLibs);
        return deployer.getNamingStrategy().getObjectName(component);
    }
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

                innerComponent = (javax.jbi.component.Component) clazz.newInstance();
            } finally {
                Thread.currentThread().setContextClassLoader(oldCl);
            }
        }
        Component component = deployer.registerComponent(getBundle(), componentDesc, innerComponent, aLibs);
        return deployer.getEnvironment().getManagedObjectName(component);
    }
View Full Code Here

    public void init() throws Exception {
        // Check requirements
        for (ServiceUnitDesc sud : descriptor.getServiceAssembly().getServiceUnits()) {
            String componentName = sud.getTarget().getComponentName();
            Component component = deployer.getComponent(componentName);
            if (component == null) {
                throw new PendingException(bundle, "Component not installed: " + componentName);
            }
            if (!LifeCycleMBean.STARTED.equals(component.getCurrentState())) {
                throw new PendingException(bundle, "Component is not started: " + componentName);
            }
        }
        // Extract bundle
        super.init();
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 deployer.getEnvironment().getManagedObjectName(component);
            } catch (Exception 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.getMainType());
    }
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.