Package javax.jbi.component

Examples of javax.jbi.component.Component


            }
        }
    }

    protected MessageExchangeListener getExchangeListener() {
        Component comp = this.component.getComponent();
        if (comp instanceof MessageExchangeListener) {
            return (MessageExchangeListener) comp;
        }
        ComponentLifeCycle lifecycle = this.component.getLifeCycle();
        if (lifecycle instanceof MessageExchangeListener) {
View Full Code Here


        Object bean = activationSpec.getComponent();
        if (bean == null) {
            throw new IllegalArgumentException("A Registration must have a component associated with it");
        }
        if (bean instanceof Component) {
            Component component = (Component) bean;
            if (component instanceof ComponentSupport) {
                defaultComponentServiceAndEndpoint((ComponentSupport) component, activationSpec);
            }
            activateComponent(component, activationSpec);
            return component;
        } else if (bean instanceof ComponentLifeCycle) {
            // lets support just plain lifecycle pojos
            ComponentLifeCycle lifeCycle = (ComponentLifeCycle) bean;
            if (bean instanceof PojoSupport) {
                defaultComponentServiceAndEndpoint((PojoSupport) bean, activationSpec);
            }
            Component adaptor = createComponentAdaptor(lifeCycle, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        } else if (bean instanceof MessageExchangeListener) {
            // lets support just plain listener pojos
            MessageExchangeListener listener = (MessageExchangeListener) bean;
            Component adaptor = createComponentAdaptor(listener, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        } else {
            throw new IllegalArgumentException("Component name: " + id
                            + " is bound to an object which is not a JBI component, it is of type: " + bean.getClass().getName());
View Full Code Here

        }
        ObjectName result = null;
        try {
            Class componentClass = componentClassLoader.loadClass(context.getComponentClassName());
            if (componentClass != null){
            Component component = (Component) componentClass.newInstance();
            result = container.activateComponent(context.getinstallRootAsDir(), component,context.getComponentDescription(),(ComponentContextImpl) context.getContext(), context
                    .isBinding(), context.isEngine());
            installed = true;
            if (bootstrap != null) {
                bootstrap.cleanUp();
View Full Code Here

     * @param id - the unique component ID
     * @throws JBIException
     */
    public void deactivateComponent(String id) throws JBIException {
        ComponentNameSpace cns = new ComponentNameSpace(name, id, id);
        Component component = registry.getComponent(cns);
        if (component != null) {
            LocalComponentConnector lcc = registry.getLocalComponentConnector(cns);
            if (lcc != null) {
                environmentContext.unreregister(lcc, true);
                managementContext.unregisterMBean(lcc.getMbeanName());
            }
            registry.deregisterComponent(component);
            log.info("Deactivating component for name: " + id + " component: " + component);
            component.getLifeCycle().stop();
            component.getLifeCycle().shutDown();
        }
        else {
            throw new JBIException("Could not find Component with id " + id);
        }
    }
View Full Code Here

        Object bean = activationSpec.getComponent();
        if (bean == null) {
            throw new IllegalArgumentException("A Registration must have a component associated with it");
        }
        if (bean instanceof Component) {
            Component component = (Component) bean;
            if (component instanceof ComponentSupport) {
                defaultComponentServiceAndEndpoint((ComponentSupport) component, activationSpec);
            }
            activateComponent(component, activationSpec);
            return component;
        }
        else if (bean instanceof ComponentLifeCycle) {
            // lets support just plain lifecycle pojos
            ComponentLifeCycle lifeCycle = (ComponentLifeCycle) bean;
            if (bean instanceof PojoSupport) {
                defaultComponentServiceAndEndpoint((PojoSupport) bean, activationSpec);
            }
            Component adaptor = createComponentAdaptor(lifeCycle, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        }
        else if (bean instanceof MessageExchangeListener) {
            // lets support just plain listener pojos
            MessageExchangeListener listener = (MessageExchangeListener) bean;
            Component adaptor = createComponentAdaptor(listener, activationSpec);
            activateComponent(adaptor, activationSpec);
            return adaptor;
        }
        else {
            throw new IllegalArgumentException("Component name: " + id
View Full Code Here

        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());
                        }
                    }
                }
View Full Code Here

        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());
                        }
                    }
                }
View Full Code Here

        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());
                        }
                    }
                }
View Full Code Here

                else {
                    throw new DeploymentException("artifact: " + artifact + "(" + artifactFile.getAbsolutePath()
                            + ") doesn't exist");
                }
            }
            Component component = container.getComponent(componentName);
            if (component != null) {
                ServiceUnitManager sum = component.getServiceUnitManager();
                if (sum != null) {
                    result = sum.deploy(name, targetDir.getAbsolutePath());
                    sum.init(name, targetDir.getAbsolutePath());
                    // register active endpoints
                }
View Full Code Here

        String componentName = target.getComponentName();
        try {
            File targetDir = environmentContext.getServiceUnitDirectory(componentName, name);
            // unpack the artifact
            // now get the component and give it a SA
            Component component = container.getComponent(componentName);
            if (component != null) {
                ServiceUnitManager sum = component.getServiceUnitManager();
                if (sum != null) {
                    sum.undeploy(name, targetDir.getAbsolutePath());
                    FileUtil.deleteFile(targetDir);
                }
            }
View Full Code Here

TOP

Related Classes of javax.jbi.component.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.