Package org.redisson.connection

Examples of org.redisson.connection.PubSubConnectionEntry


        RedisPubSubTopicListenerWrapper<M> pubSubListener = new RedisPubSubTopicListenerWrapper<M>(listener, getName());
        return addListener(pubSubListener);
    }

    private int addListener(RedisPubSubTopicListenerWrapper<M> pubSubListener) {
        PubSubConnectionEntry entry = connectionManager.subscribe(getName());
        synchronized (entry) {
            if (entry.isActive()) {
                entry.addListener(getName(), pubSubListener);
                return pubSubListener.hashCode();
            }
        }
        // entry is inactive trying add again
        return addListener(pubSubListener);
View Full Code Here


        return addListener(pubSubListener);
    }

    @Override
    public void removeListener(int listenerId) {
        PubSubConnectionEntry entry = connectionManager.getEntry(getName());
        if (entry == null) {
            return;
        }
        synchronized (entry) {
            if (entry.isActive()) {
                entry.removeListener(getName(), listenerId);
                if (entry.getListeners(getName()).isEmpty()) {
                    connectionManager.unsubscribe(getName());
                }
                return;
            }
        }
View Full Code Here

TOP

Related Classes of org.redisson.connection.PubSubConnectionEntry

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.