Package org.apache.servicemix.jbi.framework

Examples of org.apache.servicemix.jbi.framework.ComponentMBeanImpl


     *
     * @param id
     * @return the Component
     */
    public Object getBean(String id) {
        ComponentMBeanImpl component = getComponent(id);
        Object bean = component != null ? component.getComponent() : null;
        if (bean instanceof ComponentAdaptor) {
            bean = ((ComponentAdaptor) bean).getLifeCycle();
        }
        return bean;
    }
View Full Code Here


                      component.getDescription(),
                      context,
                      component.getType().equals("binding-component"),
                      component.getType().equals("service-engine"),
                                    null);
        ComponentMBeanImpl cmb = container.getComponent(component.getName());
        File stateFile = cmb.getContext().getEnvironment().getStateFile();
        if (stateFile.isFile()) {
          cmb.setInitialRunningState();
        } else {
          cmb.start();
        }
    }
View Full Code Here

        }
        String componentName = config.getInitParameter(COMPONENT_PROPERTY);
        if (componentName == null) {
            componentName = COMPONENT_DEFAULT;
        }
        ComponentMBeanImpl componentMBean  = container.getComponent(componentName);
        if (componentMBean == null) {
            throw new IllegalStateException("Unable to find component " + componentName);
        }
        if (componentMBean.getComponent() instanceof HttpSpringComponent == false) {
            throw new IllegalStateException("The component is not an instance of HttpSpringComponent");
        }
        HttpSpringComponent component = (HttpSpringComponent) componentMBean.getComponent();
        String mapping = config.getInitParameter(MAPPING_PROPERTY);
        if (mapping != null) {
            component.getConfiguration().setMapping(mapping);
        }
        processor = component.getMainProcessor();
View Full Code Here

     *
     * @param componentName - the unique component ID
     * @throws JBIException
     */
    public void deactivateComponent(String componentName) throws JBIException {
        ComponentMBeanImpl component = registry.getComponent(componentName);
        if (component != null) {
            component.doShutDown();
            component.unregisterMbeans(managementContext);
            registry.deregisterComponent(component);
            environmentContext.unreregister(component);
            component.dispose();
            LOG.info("Deactivating component " + componentName);
        } else {
            throw new JBIException("Could not find component " + componentName);
        }
    }
View Full Code Here

        ObjectName result = null;
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
        if (LOG.isDebugEnabled()) {
            LOG.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: " + component);
        }
        ComponentMBeanImpl lcc = registry.registerComponent(cns, description, component, binding, service, sharedLibraries);
        if (lcc != null) {
            lcc.setPojo(pojo);
            ComponentEnvironment env = environmentContext.registerComponent(context.getEnvironment(), lcc);
            if (env.getInstallRoot() == null) {
                env.setInstallRoot(installationDir);
            }
            context.activate(component, env, activationSpec);
            lcc.setContext(context);
            lcc.setActivationSpec(activationSpec);

            if (lcc.isPojo()) {
                //non-pojo's are either started by the auto deployer
                //or manually
                lcc.init();
            } else {
                lcc.doShutDown();
            }
            result = lcc.registerMBeans(managementContext);
            // Start the component after mbeans have been registered
            // This can be usefull if listeners use them
            if (lcc.isPojo() && started.get()) {
                lcc.start();
            }
        }
        return result;
    }
View Full Code Here

                                    component.getDescription(),
                                    context,
                                    component.getType().equals("binding-component"),
                                    component.getType().equals("service-engine"),
                                    null);
        ComponentMBeanImpl cmb = container.getComponent(component.getName());
        File stateFile = cmb.getContext().getEnvironment().getStateFile();
        if (stateFile.isFile()) {
            cmb.setInitialRunningState();
        } else {
            cmb.start();
        }
    }
View Full Code Here

    protected MessageList getReceivedMessageList() {
        return getReceiver().getMessageList();
    }
   
    protected Component getComponent(String name) {
        ComponentMBeanImpl lcc = jbi.getComponent(name);
        return lcc != null ? lcc.getComponent() : null;
    }
View Full Code Here

     * @param componentName -
     *            is the name of the BC or SE.
     * @return the JMX object name of the component's LifeCycle MBean or null.
     */
    public ObjectName getComponentByName(String componentName) {
        ComponentMBeanImpl component = container.getRegistry().getComponent(componentName);
        return component != null ? component.getMBeanName() : null;
    }
View Full Code Here

     * @param componentName -
     *            the unique name of the component
     * @return true if the component is a binding
     */
    public boolean isBinding(String componentName) {
        ComponentMBeanImpl component = container.getRegistry().getComponent(componentName);
        return component != null ? component.isBinding() : false;
    }
View Full Code Here

     * @param componentName -
     *            the unique name of the component
     * @return true if the component is a service engine
     */
    public boolean isEngine(String componentName) {
        ComponentMBeanImpl component = container.getRegistry().getComponent(componentName);
        return component != null ? component.isEngine() : false;
    }
View Full Code Here

TOP

Related Classes of org.apache.servicemix.jbi.framework.ComponentMBeanImpl

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.