Package com.volantis.cache.impl.group

Examples of com.volantis.cache.impl.group.InternalGroup


                }

                // If the entry is still in the cache then make sure that
                // it is in the correct group.
                if (entry.inCache()) {
                    InternalGroup newGroup = (InternalGroup) result.getGroup();
                    postSynchronizationAction = updateGroup(entry, newGroup);
                }

                if (result.isCacheable()) {
                    // Mark the entry as ready so that other thread will pick
View Full Code Here


        PostSynchronizationAction postSynchronizationAction = null;
        // Get the old group, will be null if this is a new entry
        // rather than an expired one, or if the entry has already
        // been removed.
        InternalGroup oldGroup = entry.getGroup();

        // If the group has changed then remove the entry from the
        // old group, if any and add it to the new group.
        if (oldGroup != newGroup) {
            if (oldGroup != null) {
                oldGroup.detachEntry(entry);
            }

            // Add the entry to the new group, this may cause an
            // entry to be purged. It may also return an action
            // that needs performing after updating the entry.
View Full Code Here

                    if (entry.inCache()) {
                        // Inform the group that one of its entries was hit so
                        // it can update the structure to support the least
                        // recently used strategy.
                        InternalGroup group = entry.getGroup();
                        group.hitEntry(entry);
                    }
                } else {
                    // remove cache entry with ERROR saved, we can't cache it
                    removeEntry(key);
View Full Code Here

        if (filter == null) {
            filter = CacheEntryFilter.SELECT_ALL_ENTRIES;
        }

        InternalGroup group = null;
        synchronized(this) {

            // If this entry is not in the cache anymore then there is nothing
            // to do.
            if (!inCache) {
                return false;
            }

            // If the filter selects this entry then remove it.
            if (filter.select(this)) {

                // Remember that the entry is no longer in the cache.
                inCache = false;

                // Remove the entry from the cache map.
                cache.removeFromMap(key);

                // Save away the group so that events can be dispatched.
                group = this.group;

                // It may be that this entry has not yet been added to a group
                // before it has been removed.
                if (group != null) {
                    // Remove the entry from the group's entry list and clear the
                    // group.
                    group.detachEntry(this);
                }
            }
        }

        // Dispatch the events outside the synchronization block so that it
        // does not interfere with the normal running of the cache and prevents
        // listeners from causing deadlocks, e.g. by calling back into the
        // cache.
        boolean removed;
        if (group == null) {
            removed = false;
        } else {
            removed = true;

            // Make sure that the entryRemoved events are generated properly.
            group.bubbleEntryRemovedEvent(this);
        }

        return removed;
    }
View Full Code Here

TOP

Related Classes of com.volantis.cache.impl.group.InternalGroup

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.