Examples of DiscoveryEvent


Examples of org.apache.activemq.command.DiscoveryEvent

        }
    }

    private void fireServiceAddEvent(RemoteBrokerData data) {
        if (discoveryListener != null && started.get()) {
            final DiscoveryEvent event = new DiscoveryEvent(data.service);
            event.setBrokerName(data.brokerName);
           
            // Have the listener process the event async so that
            // he does not block this thread since we are doing time sensitive
            // processing of events.
            getExecutor().execute(new Runnable() {
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

    public void addService(JmDNS jmDNS, String type, String name) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("addService with type: " + type + " name: " + name);
        }
        if (listener != null) {
            listener.onServiceAdd(new DiscoveryEvent(name));
        }
        jmDNS.requestServiceInfo(type, name);
    }
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

    public void removeService(JmDNS jmDNS, String type, String name) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("removeService with type: " + type + " name: " + name);
        }
        if (listener != null) {
            listener.onServiceRemove(new DiscoveryEvent(name));
        }
    }
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

        }
    }

    private void fireServiceRemovedEvent(RemoteBrokerData data) {
        if (discoveryListener != null && started.get()) {
            final DiscoveryEvent event = new DiscoveryEvent(data.service);
            event.setBrokerName(data.brokerName);

            // Have the listener process the event async so that
            // he does not block this thread since we are doing time sensitive
            // processing of events.
            getExecutor().execute(new Runnable() {
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

        }
    }

    private void fireServiceAddEvent(RemoteBrokerData data) {
        if (discoveryListener != null && started.get()) {
            final DiscoveryEvent event = new DiscoveryEvent(data.service);
            event.setBrokerName(data.brokerName);
           
            // Have the listener process the event async so that
            // he does not block this thread since we are doing time sensitive
            // processing of events.
            getExecutor().execute(new Runnable() {
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

        CompositeData compositeData = URISupport.parseComposite(uri);
       
        StubCompositeTransport compositeTransport = new StubCompositeTransport();     
        DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport, compositeData);
       
        discoveryTransport.onServiceAdd(new DiscoveryEvent("tcp://localhost:61616"));       
        assertEquals("expected added URI after discovery event", compositeTransport.getTransportURIs().length, 1);
       
        URI discoveredServiceURI = compositeTransport.getTransportURIs()[0];
        Map<String, String> parameters = URISupport.parseParameters(discoveredServiceURI);
        assertTrue("unable to add parameter to discovered service", parameters.containsKey(extraParameterName));
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

       
        StubCompositeTransport compositeTransport = new StubCompositeTransport();     
        DiscoveryTransport discoveryTransport = DiscoveryTransportFactory.createTransport(compositeTransport, compositeData);
       
        final String serviceName = "tcp://localhost:61616";
        discoveryTransport.onServiceAdd(new DiscoveryEvent(serviceName));       
        assertEquals("expected added URI after discovery event", 1, compositeTransport.getTransportURIs().length);
       
        discoveryTransport.onServiceRemove(new DiscoveryEvent(serviceName));       
        assertEquals("expected URI removed after discovery event", 0, compositeTransport.getTransportURIs().length);
    }
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

        if(selfService == null || !service.equals(selfService)){
            AtomicLong lastKeepAlive=(AtomicLong) services.get(service);
            if(lastKeepAlive==null){
                brokers.put(service, brokerName);
                if(discoveryListener!=null){
                    final DiscoveryEvent event=new DiscoveryEvent(service);
                    event.setBrokerName(brokerName);
                   
                    // Have the listener process the event async so that
                    // he does not block this thread since we are doing time sensitive
                    // processing of events.
                    executor.execute(new Runnable() {
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

    private void processDead(String brokerName,String service){
        if(!service.equals(selfService)){
            if(services.remove(service)!=null){
                brokers.remove(service);
                if(discoveryListener!=null){
                    final DiscoveryEvent event=new DiscoveryEvent(service);
                    event.setBrokerName(brokerName);
                   
                    // Have the listener process the event async so that
                    // he does not block this thread since we are doing time sensitive
                    // processing of events.
                    executor.execute(new Runnable() {
View Full Code Here

Examples of org.apache.activemq.command.DiscoveryEvent

    public void addService(JmDNS jmDNS, String type, String name) {
        if (log.isDebugEnabled()) {
            log.debug("addService with type: " + type + " name: " + name);
        }
        if( listener!=null )
            listener.onServiceAdd(new DiscoveryEvent(name));
        jmDNS.requestServiceInfo(type, name);
    }
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.