Package org.servicemix.jbi.framework

Examples of org.servicemix.jbi.framework.LocalComponentConnector


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


    public void onEvent(ConsumerAdvisoryEvent event) {
        if (started.get()) {
            ConsumerInfo info = event.getInfo();
            if (info.isStarted()) {
                for (Iterator i = broker.getRegistry().getLocalComponentConnectors().iterator();i.hasNext();) {
                    LocalComponentConnector lcc = (LocalComponentConnector) i.next();
                    ComponentPacket packet = lcc.getPacket();
                    ComponentPacketEvent cpe = new ComponentPacketEvent(packet, ComponentPacketEvent.ACTIVATED);
                    onEvent(cpe);
                }
            }
            else {
View Full Code Here

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

        ObjectName result = null;
        ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName(), activationSpec.getId());
        log.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: "
                + component);
        DeliveryChannelImpl dc = new DeliveryChannelImpl(this, activationSpec.getComponentName());
        LocalComponentConnector lcc = registry.registerComponent(cns, description, component, dc, binding, service);
        if (lcc != null) {
            dc.setConnector(lcc);
            lcc.setPojo(pojo);
            ComponentEnvironment env = environmentContext.registerComponent(context.getEnvironment(),lcc);
            env.setInstallRoot(installationDir);
            context.activate(component, dc, env, activationSpec, installationDir);
            lcc.setContext(context);
            lcc.setActivationSpec(activationSpec);
            component.getLifeCycle().init(context);
            if (started.get() && lcc.isPojo()) {
                component.getLifeCycle().start();
            }
            ComponentMBeanImpl mbean = new ComponentMBeanImpl(lcc);
            result = managementContext.createObjectName(mbean);
            try {
                managementContext.registerMBean(result, mbean, ComponentMBean.class);
                lcc.setMBean(result, mbean);
            }
            catch (JMException e) {
                throw new JBIException(e);
            }
        }
View Full Code Here

     * @param event
     */
    public void onNodeAdd(ClusterEvent event) {
        // send all registered Components to the remote cluster node
        for (Iterator i = broker.getRegistry().getLocalComponentConnectors().iterator();i.hasNext();) {
            LocalComponentConnector lcc = (LocalComponentConnector) i.next();
            ComponentPacket packet = lcc.getPacket();
            ComponentPacketEvent cpe = new ComponentPacketEvent(packet, ComponentPacketEvent.ACTIVATED);
            onEvent(cpe);
        }
    }
View Full Code Here

    public void onEvent(ConsumerAdvisoryEvent event) {
        if (started.get()) {
            ConsumerInfo info = event.getInfo();
            if (info.isStarted()) {
                for (Iterator i = broker.getRegistry().getLocalComponentConnectors().iterator();i.hasNext();) {
                    LocalComponentConnector lcc = (LocalComponentConnector) i.next();
                    ComponentPacket packet = lcc.getPacket();
                    ComponentPacketEvent cpe = new ComponentPacketEvent(packet, ComponentPacketEvent.ACTIVATED);
                    onEvent(cpe);
                }
            }
            else {
View Full Code Here

     * @param exchange 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 filtered = new ArrayList();
        LocalComponentConnector consumer = getRegistry().getLocalComponentConnector(exchange.getSourceId());
       
      for (int i = 0; i < endpoints.length; i++) {
      ComponentNameSpace id = ((AbstractServiceEndpoint) endpoints[i]).getComponentNameSpace();
          LocalComponentConnector provider = getRegistry().getLocalComponentConnector(id);
            if (provider != null) {
                if (consumer.getComponent().isExchangeWithProviderOkay(endpoints[i], exchange) &&
                    provider.getComponent().isExchangeWithConsumerOkay(endpoints[i], exchange)) {
                 filtered.add(endpoints[i]);
              }
            } else {
                filtered.add(endpoints[i]);
            }
View Full Code Here

    public 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
        ComponentNameSpace copy = id.copy();
        copy.setContainerName(broker.getContainerName());
        LocalComponentConnector lcc = broker.getRegistry().getLocalComponentConnector(copy);
        if (lcc != null) {
            lcc.getDeliveryChannel().processInBound(me);
        }
        else {
            throw new MessagingException("No component with id (" + id + ") - Couldn't route MessageExchange " + me);
        }
    }
View Full Code Here

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

TOP

Related Classes of org.servicemix.jbi.framework.LocalComponentConnector

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.