Package org.apache.servicemix.jbi.framework

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


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


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

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

     */
    public String shutDownComponent(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.shutDown();
                result = mbean.getCurrentState();
            }
        }
        return result;
    }
View Full Code Here

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

    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

    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

     // Retrieve a delivery channel
        TestComponent component = new TestComponent(new QName("service"), "endpoint");
        container.activateComponent(new ActivationSpec("component", component));
        final DeliveryChannel channel = component.getChannel();
        // test
        ComponentMBeanImpl componentMbeanImpl = container.getRegistry().getComponent("component");
        assertNotNull(componentMbeanImpl);
        componentMbeanImpl.setExchangeThrottling(true);
        componentMbeanImpl.setThrottlingTimeout(4000);
       

        class ProviderThread extends Thread {
            private int counter;
            private DeliveryChannel channel;
View Full Code Here

            if (processor == null) {
                String componentName = getServletConfig().getInitParameter(COMPONENT_PROPERTY);
                if (componentName == null) {
                    componentName = COMPONENT_DEFAULT;
                }
                ComponentMBeanImpl mbean = container.getComponent(componentName);
                if (mbean == null) {
                    throw new ServletException("Component " + componentName + " not installed");
                }
                Component component = mbean.getComponent();
                Method mth = component.getClass().getMethod("getMainProcessor", (Class[]) null);
                processor = mth.invoke(component, (Object[]) null);
                processorMethod = processor.getClass().getMethod("process", new Class[] { HttpServletRequest.class, HttpServletResponse.class });
            }
            processorMethod.invoke(processor, new Object[] { request, response });
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.