Examples of LazyReplicatedMap


Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

     * @param channel - the Tribes channel object to be used for communication
     * @param mapName - the name of this map
     */
    public MapDemo(Channel channel, String mapName ) {
        //instantiate the replicated map
        map = new LazyReplicatedMap(null,channel,5000, mapName,null);
        //create a gui, name it with the member name of this JVM
        table = SimpleTableDemo.createAndShowGUI(map,channel.getLocalMember(false).getName());
        //add ourself as a listener for messages
        channel.addChannelListener(this);
        //add ourself as a listener for memberships

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap


    @Override
    public ClusterMessage requestCompleted(String sessionId) {
        if (!getState().isAvailable()) return null;
        LazyReplicatedMap map = (LazyReplicatedMap)sessions;
        map.replicate(sessionId,false);
        return null;
    }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

        super.startInternal();

        try {
            cluster.registerManager(this);
            CatalinaCluster catclust = cluster;
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          catclust.getChannel(),
                                                          DEFAULT_REPL_TIMEOUT,
                                                          getMapName(),
                                                          getClassLoaders());
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
        catch ( Exception x ) {
            log.error("Unable to start BackupManager",x);
            throw new LifecycleException("Failed to start BackupManager",x);
        }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

            log.debug("Stopping");

        setState(LifecycleState.STOPPING);

        if (sessions instanceof LazyReplicatedMap) {
            LazyReplicatedMap map = (LazyReplicatedMap)sessions;
            map.breakdown();
        }

        cluster.removeManager(this);
        this.randoms.clear();
        super.stopInternal();

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

        return result;
    }

    @Override
    public int getActiveSessionsFull() {
        LazyReplicatedMap map = (LazyReplicatedMap)sessions;
        return map.sizeFull();
    }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

    }

    @Override
    public Set<String> getSessionIdsFull() {
        Set<String> sessionIds = new HashSet<String>();
        LazyReplicatedMap map = (LazyReplicatedMap)sessions;
        @SuppressWarnings("unchecked") // sessions is of type Map<String, Session>
        Iterator<String> keys = map.keySetFull().iterator();
        while (keys.hasNext()) {
            sessionIds.add(keys.next());
        }
        return sessionIds;
    }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

     * @param channel - the Tribes channel object to be used for communication
     * @param mapName - the name of this map
     */
    public MapDemo(Channel channel, String mapName ) {
        //instantiate the replicated map
        map = new LazyReplicatedMap(null,channel,5000, mapName,null);
        //create a gui, name it with the member name of this JVM
        table = SimpleTableDemo.createAndShowGUI(map,channel.getLocalMember(false).getName());
        //add ourself as a listener for messages
        channel.addChannelListener(this);
        //add ourself as a listener for memberships

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap


    @Override
    public ClusterMessage requestCompleted(String sessionId) {
        if (!getState().isAvailable()) return null;
        LazyReplicatedMap map = (LazyReplicatedMap)sessions;
        map.replicate(sessionId,false);
        return null;
    }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

                    throw new LifecycleException(
                            sm.getString("backupManager.noCluster", getName()));
                }
            }
            cluster.registerManager(this);
            LazyReplicatedMap map = new LazyReplicatedMap(this,
                                                          cluster.getChannel(),
                                                          rpcTimeout,
                                                          getMapName(),
                                                          getClassLoaders(),
                                                          terminateOnStartFailure);
            map.setChannelSendOptions(mapSendOptions);
            this.sessions = map;
        catch ( Exception x ) {
            log.error(sm.getString("backupManager.startUnable", getName()),x);
            throw new LifecycleException(sm.getString("backupManager.startFailed", getName()),x);
        }

Examples of org.apache.catalina.tribes.tipis.LazyReplicatedMap

            log.debug(sm.getString("backupManager.stopped", getName()));

        setState(LifecycleState.STOPPING);

        if (sessions instanceof LazyReplicatedMap) {
            LazyReplicatedMap map = (LazyReplicatedMap)sessions;
            map.breakdown();
        }

        cluster.removeManager(this);
        super.stopInternal();
    }
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.