Package org.apache.activemq.command

Examples of org.apache.activemq.command.DiscoveryEvent


     * @throws IOException
     */
    public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException {
        super.looseUnmarshal(wireFormat, o, dataIn);

        DiscoveryEvent info = (DiscoveryEvent)o;
        info.setServiceName(looseUnmarshalString(dataIn));
        info.setBrokerName(looseUnmarshalString(dataIn));

    }
View Full Code Here


    /**
     * Write the booleans that this object uses to a BooleanStream
     */
    public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException {

        DiscoveryEvent info = (DiscoveryEvent)o;

        super.looseMarshal(wireFormat, o, dataOut);
        looseMarshalString(info.getServiceName(), dataOut);
        looseMarshalString(info.getBrokerName(), dataOut);

    }
View Full Code Here

    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

    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

        }
    }

    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

        }
    }

    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

    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

    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

        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

    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

TOP

Related Classes of org.apache.activemq.command.DiscoveryEvent

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.