Package com.sun.appserv.util.cache

Examples of com.sun.appserv.util.cache.BaseCache


        } catch (Exception ex) {
            // ignore
        }
  Properties cacheProps = null;

        resourceTable = new BaseCache();
        ((BaseCache)resourceTable).init(maxEntries, loadFactor, cacheProps);
  // END IASRI 4705808 TTT001

        invMgr = Switch.getSwitch().getInvocationManager();
  if (invMgr == null) { // Stand Alone Clients
View Full Code Here


        StorePool.DEFAULT_UPPER_SIZE,
        StorePool.DEFAULT_POLL_TIME, haStoreFactory);
        this.setSingletonStore((ReplicatedEjbStore)haStoreFactory.createHAStore());

        //initialize locally passivated sessions cache
        locallyPassivatedSessions = new BaseCache();
        locallyPassivatedSessions.init(_maxBaseCacheSize, _loadFactor, null);
        replicatedSessionMonitors = new ReplicationSessionMonitors(_logger, _maxBaseCacheSize, _loadFactor);
        ServerConfigLookup lookup = new ServerConfigLookup();
        replicationCompressionEnabled = lookup.isReplicationCompression();
        cleanupThread = new CleanupThread();
View Full Code Here

        ; //no-op
    }
   
    public SFSBBeanState[] getLocallyPassivatedBeanStatesArray() {
       
        BaseCache passivatedSessions = locallyPassivatedSessions;
        SFSBBeanState[] beanStates = null;
        int numberOfIds = passivatedSessions.getEntryCount();
        ArrayList valuesList = new ArrayList(numberOfIds);
        Iterator valuesIter = passivatedSessions.values();
        while(valuesIter.hasNext()) {
            valuesList.add((SFSBBeanState)valuesIter.next());
        }
        SFSBBeanState[] template = new SFSBBeanState[valuesList.size()];
        beanStates = (SFSBBeanState[])valuesList.toArray(template);
View Full Code Here

    public void removeExpiredFromLocallyPassivated() {
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicatedSFSBStoreManager>>removeExpiredFromLocallyPassivated");
        }       
        ArrayList expiredLocallyPassivated = new ArrayList(30);
        BaseCache locallyPassivatedCache = this.getLocallyPassivatedSessions();
        for(Iterator it = locallyPassivatedCache.values(); it.hasNext();) {
            SFSBBeanState nextBeanState = (SFSBBeanState)it.next();
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("ReplicatedSFSBStoreManager>>removeExpiredFromLocallyPassivated:nextState=" + nextBeanState);
            }
            if(isBeanExpired(nextBeanState)) {
View Full Code Here

        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicatedSFSBStoreManager>>processRemoveExpired");
        }       
        //FIXME finish this
        ArrayList expiredReplicas = new ArrayList(30);
        BaseCache replicasCache = this.getReplicatedSessions();
        for(Iterator it = replicasCache.values(); it.hasNext();) {
            ReplicationState nextState = (ReplicationState)it.next();
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("ReplicatedSFSBStoreManager>>processRemoveExpired:nextState=" + nextState);
            }           
            if(nextState.isExpired()) {
View Full Code Here

            _logger.fine("IN" + this.getClass().getName() + ">>processRemoveids");
        }
        //state of this message contains serialized list of ids to remove
        byte[] idsToRemoveState = message.getState();
        List removedIdsList = new ArrayList();
        BaseCache replicatedSessionsCache = getReplicatedSessions();
        try {
            removedIdsList = (List)ReplicationState.getObjectValue(idsToRemoveState);
        } catch (Exception ex) {
            //deliberately do nothing
        }
        //ReplicationState.displayStringList(removedIdsList);
        for(int i=0; i<removedIdsList.size(); i++) {
            String nextIdToRemove = (String)removedIdsList.get(i);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine(">>processRemoveids:nextIdToRemove=" + nextIdToRemove);
            }           
            //_logger.info(">>processRemoveids:nextIdToRemove=" + nextIdToRemove);
            replicatedSessionsCache.remove(nextIdToRemove);
        }
    }   
View Full Code Here

             _logger.fine("processBroadcastfindsession:replicaStateResponseVersion:" + returnState.getVersion());                 
         }           
        
         //FIXME may want to wait for ack before doing this
         //FIXME waiting for Jxta fix to put this next line back in
         BaseCache replicatedSessionsCache = getReplicatedSessions();
         replicatedSessionsCache.remove(replicaState.getId());

         //while here check and remove from manager cache if present
         this.clearFromManagerCache((String)queryState.getId());
        
         if(_logger.isLoggable(Level.FINE)) {
View Full Code Here

    /** Creates a new instance of ReplicaCache */
    public ReplicaCache(ReplicationManager manager) {
        _manager = manager;
        _managerName = manager.getClass().getName();
        //initialize replicated sessions cache
        replicatedSessions = new BaseCache();
        replicatedSessions.init(_maxBaseCacheSize, _loadFactor, null);
        replicatedSessionUpdates = new BaseCache();
        replicatedSessionUpdates.init(_maxBaseCacheSize, _loadFactor, null);
        replicatedSessionRemovals = new ConcurrentHashMap(_maxBaseCacheSize, _loadFactor, _concurrencyLevel);
    }
View Full Code Here

    }

    public void readReplicatedSessionUpdates(ObjectInputStream ois)
        throws ClassNotFoundException, IOException {
        int count = ois.readInt();
        BaseCache replicatedSessionUpdates = getReplicatedSessionUpdates();
        for(int i=0; i<count; i++) {
            ReplicationStateUpdate nextState = (ReplicationStateUpdate)ois.readObject();
            replicatedSessionUpdates.put(nextState.getId(), nextState);
        }
    }
View Full Code Here

            throws IOException, BackingStoreException, RemoteLockException {
        /**
         * For the in-memory implementation, the restarted instance might
         * have the session in its replica cache, if the load-factor is used.
         */
        BaseCache replicaCache = getReplicaCache();
        if(replicaCache != null) {
            replicaCache.remove(id);
        }
        ReplicationState sessionState = loadDialogFragmentFromRemoteActiveCache(
                id, String.valueOf(expat.getVersion()), expat.getInstanceName());
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("DialogFragmentStoreImpl>>loadFromRemoteActiveCache:id= "
View Full Code Here

TOP

Related Classes of com.sun.appserv.util.cache.BaseCache

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.