org.terracotta.modules.ehcache.async.AsyncCoordinator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ehcache Show documentation
Show all versions of ehcache Show documentation
Ehcache is an open source, standards-based cache used to boost performance,
offload the database and simplify scalability. Ehcache is robust, proven and full-featured and
this has made it the most widely-used Java-based cache.
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*/
package org.terracotta.modules.ehcache.async;
import org.terracotta.modules.ehcache.async.scatterpolicies.ItemScatterPolicy;
import java.io.Serializable;
public interface AsyncCoordinator {
/**
* @throws IllegalArgumentException if processingConcurrency is less than 1 OR processor is null
*/
public void start(final ItemProcessor processor, final int processingConcurrency,
ItemScatterPolicy super E> policy);
/**
* @param item null item are ignored.
*/
public void add(E item);
/**
* Stops and waits for the current processing to finish.
* Calling this multiple times will result in {@link IllegalStateException}
*/
public void stop();
/**
* Sets a filter to filter out the items.
*/
public void setOperationsFilter(ItemsFilter filter);
/**
* @return the current items to be processed
*/
public long getQueueSize();
/**
* Destroy all clustered state associated with the given async coordinator.
*/
void destroy();
}