All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxifier.mxcache.caches.CleaningNode Maven / Gradle / Ivy

Go to download

Constains all classes necessary for launching a MxCache-instrumentated application

There is a newer version: 2.6.9
Show newest version
/*
 * Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
 */
package com.maxifier.mxcache.caches;

import com.maxifier.mxcache.impl.resource.DependencyNode;
import javax.annotation.Nullable;

import java.util.concurrent.locks.Lock;

/**
 * @author Alexander Kochurov ([email protected])
 */
public interface CleaningNode {
    /**
     * @return lock if any
     */
    @Nullable
    Lock getLock();

    /**
     * Clears the cache.
     * This method requires a lock, but it doesn't lock anything.
     * Calling it without proper locking may result in undefined behaviour
     * (e.g. ConcurrentModificationException or deadlocks)
     *
     * Lock must be obtained first with {@link #getLock()} and locked.
     */
    void clear();

    DependencyNode getDependencyNode();

    /**
     * @return owner of cache, null for static caches.
     */
    @Nullable
    Object getCacheOwner();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy