Package org.apache.servicemix.jbi.framework

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


     * @throws MessagingException
     */
    protected void doRouting(MessageExchangeImpl me) throws MessagingException {
        ComponentNameSpace id = me.getRole() == Role.PROVIDER ? me.getDestinationId() : me.getSourceId();
        //As the MessageExchange could come from another container - ensure we get the local Component
        ComponentMBeanImpl lcc = broker.getContainer().getRegistry().getComponent(id.getName());
        if (lcc != null) {
            if (lcc.getDeliveryChannel() != null) {
                try {
                    lock.readLock().lock();
                    if (!me.getSourceId().getContainerName().equalsIgnoreCase(broker.getContainer().getName())
                        && broker instanceof SecuredBroker) {
                        try {
                            ((SecuredBroker)broker).checkSecurity(me);
                        } catch (Exception e) {
                            me.handleAccept();
                            me.setError(e);
                            me.handleSend(false);
                            broker.getContainer().sendExchange(me.getMirror());
                            throw new MessagingException(e);
                        }
                    }
                    lcc.getDeliveryChannel().processInBound(me);
                } finally {
                    lock.readLock().unlock();
                }
            } else {
                throw new MessagingException("Component " + id.getName() + " is shut down");
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);
        }
        HttpComponent component = (HttpComponent) componentMBean.getComponent();
        String mapping = config.getInitParameter(MAPPING_PROPERTY);
        if (mapping != null) {
            component.getConfiguration().setMapping(mapping);
        }
        processor = component.getMainProcessor();
View Full Code Here

                    throw new IllegalStateException("No such shared library: " + library);
                }
                parents.add(sl.getClassLoader());
            }
            for (String component : components) {
                ComponentMBeanImpl componentMBean = container.getRegistry().getComponent(component);
                if (componentMBean == null) {
                    throw new IllegalStateException("No such component: " + componentMBean);
                }
                parents.add(componentMBean.getComponent().getClass().getClassLoader());
            }
            classLoader = new JarFileClassLoader(applicationContext.getDisplayName(),
                                                 urls,
                                                 parents.toArray(new ClassLoader[parents.size()]),
                                                 inverse,
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

     *            the exchange that will be serviced
     * @return an array of endpoints on which both consumer and provider agrees
     */
    protected ServiceEndpoint[] getMatchingEndpoints(ServiceEndpoint[] endpoints, MessageExchangeImpl exchange) {
        List<ServiceEndpoint> filtered = new ArrayList<ServiceEndpoint>();
        ComponentMBeanImpl consumer = getRegistry().getComponent(exchange.getSourceId());

        for (int i = 0; i < endpoints.length; i++) {
            ComponentNameSpace id = ((InternalEndpoint) endpoints[i]).getComponentNameSpace();
            if (id != null) {
                ComponentMBeanImpl provider = getRegistry().getComponent(id);
                if (provider != null
                        && (!consumer.getComponent().isExchangeWithProviderOkay(endpoints[i], exchange)
                                || !provider.getComponent().isExchangeWithConsumerOkay(endpoints[i], exchange))) {
                    continue;
                }
            }
            filtered.add(endpoints[i]);
        }
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

     */
    public String startComponent(String componentName) throws JBIException {
        String result = "NOT FOUND: " + componentName;
        ObjectName objName = getComponentByName(componentName);
        if (objName != null) {
            ComponentMBeanImpl mbean = (ComponentMBeanImpl) beanMap.get(objName);
            if (mbean != null) {
                mbean.start();
                result = mbean.getCurrentState();
            }
        }
        return result;
    }
View Full Code Here

     */
    public String stopComponent(String componentName) throws JBIException {
        String result = "NOT FOUND: " + componentName;
        ObjectName objName = getComponentByName(componentName);
        if (objName != null) {
            ComponentMBeanImpl mbean = (ComponentMBeanImpl) beanMap.get(objName);
            if (mbean != null) {
                mbean.stop();
                result = mbean.getCurrentState();
            }
        }
        return result;
    }
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.