Examples of EventConsumer


Examples of org.apache.karaf.cellar.core.event.EventConsumer

    }

    public void destroy() {
        bundleContext.removeServiceListener(this);
        for (Map.Entry<String, EventConsumer> consumerEntry : consumers.entrySet()) {
            EventConsumer consumer = consumerEntry.getValue();
            consumer.stop();
        }
        consumers.clear();
    }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

                    }

                    remoteEndpoints.put(endpointId, endpoint);

                    // register the endpoint consumer
                    EventConsumer consumer = consumers.get(endpointId);
                    if (consumer == null) {
                        consumer = eventTransportFactory.getEventConsumer(Constants.INTERFACE_PREFIX + Constants.SEPARATOR + endpointId, false);
                        consumers.put(endpointId, consumer);
                    } else if (!consumer.isConsuming()) {
                        consumer.start();
                    }
                }
            }
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassLoader);
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

                    // if the endpoint is used for export from other nodes too, then put it back.
                    if (endpointDescription.getNodes().size() > 0) {
                        remoteEndpoints.put(endpointId, endpointDescription);
                    }

                    EventConsumer eventConsumer = consumers.remove(endpointId);
                    eventConsumer.stop();
                }
            }
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassLoader);
        }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

        for (Map.Entry<EndpointDescription, ServiceRegistration> entry : registrations.entrySet()) {
            ServiceRegistration registration = entry.getValue();
            registration.unregister();
        }
        for (Map.Entry<String, EventConsumer> consumerEntry : consumers.entrySet()) {
            EventConsumer consumer = consumerEntry.getValue();
            consumer.stop();
        }
        consumers.clear();
        producers.clear();
    }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

        if (requestProducer == null) {
            requestProducer = eventTransportFactory.getEventProducer(Constants.INTERFACE_PREFIX + Constants.SEPARATOR + endpoint.getId(), Boolean.FALSE);
            producers.put(endpoint.getId(), requestProducer);
        }

        EventConsumer resultConsumer = consumers.get(endpoint.getId());
        if (resultConsumer == null) {
            resultConsumer = eventTransportFactory.getEventConsumer(Constants.RESULT_PREFIX + Constants.SEPARATOR + clusterManager.getNode().getId() + endpoint.getId(), Boolean.FALSE);
            consumers.put(endpoint.getId(), resultConsumer);
        } else if (!resultConsumer.isConsuming()) {
            resultConsumer.start();
        }

        producers.put(endpoint.getId(), requestProducer);
        consumers.put(endpoint.getId(), resultConsumer);
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

        for (Map.Entry<EndpointDescription, ServiceRegistration> entry : registrations.entrySet()) {
            ServiceRegistration registration = entry.getValue();
            registration.unregister();
        }
        for (Map.Entry<String, EventConsumer> consumerEntry : consumers.entrySet()) {
            EventConsumer consumer = consumerEntry.getValue();
            consumer.stop();
        }
        consumers.clear();
        producers.clear();
    }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

        if (requestProducer == null) {
            requestProducer = eventTransportFactory.getEventProducer(Constants.INTERFACE_PREFIX + Constants.SEPARATOR + endpoint.getId(), Boolean.FALSE);
            producers.put(endpoint.getId(), requestProducer);
        }

        EventConsumer resultConsumer = consumers.get(endpoint.getId());
        if (resultConsumer == null) {
            resultConsumer = eventTransportFactory.getEventConsumer(Constants.RESULT_PREFIX + Constants.SEPARATOR + clusterManager.getNode().getId() + endpoint.getId(), Boolean.FALSE);
            consumers.put(endpoint.getId(), resultConsumer);
        } else if (!resultConsumer.isConsuming()) {
            resultConsumer.start();
        }

        producers.put(endpoint.getId(), requestProducer);
        consumers.put(endpoint.getId(), resultConsumer);
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

    private void unimportService(EndpointDescription endpoint) {
        ServiceRegistration registration = registrations.get(endpoint);
        registration.unregister();

        producers.remove(endpoint.getId());
        EventConsumer consumer = consumers.remove(endpoint.getId());
        if (consumer != null) {
            consumer.stop();
        }
    }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

    }

    public void destroy() {
        bundleContext.removeServiceListener(this);
            for(Map.Entry<String,EventConsumer> consumerEntry:consumers.entrySet()) {
                EventConsumer consumer = consumerEntry.getValue();
                consumer.stop();
            }
            consumers.clear();
    }
View Full Code Here

Examples of org.apache.karaf.cellar.core.event.EventConsumer

                    }

                    remoteEndpoints.put(endpointId, endpoint);

                    //Register the endpoint consumer
                    EventConsumer consumer = consumers.get(endpointId);
                    if(consumer == null) {
                        consumer = eventTransportFactory.getEventConsumer(Constants.INTERFACE_PREFIX + Constants.SEPARATOR + endpointId, false);
                        consumers.put(endpointId, consumer);
                    } else if(!consumer.isConsuming()) {
                        consumer.start();
                    }
                }
            }
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassLoader);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.