- * The supported wildcard characters can be escaped with a backslash '\', and a literal backslash can be included with '\\'
- *
- * WARN: Expressions starting with a leading wildcard character are potentially very expensive (ie. full scan) for indexed caches
- *

- * While Element implements Serializable, it is possible to create non Serializable elements
- * for use in MemoryStores. This method checks that an instance of Element really is Serializable
- * and will not throw a NonSerializableException if Serialized.
- *

- * This method checks that an instance of an Element's key really is Serializable
- * and will not throw a NonSerializableException if Serialized.
- *
- * @return true if the element's key is Serializable
- * @since 1.2
- */
- public final boolean isKeySerializable() {
- return key instanceof Serializable || key == null;
- }
-
- /**
- * If there is an Element in the Cache and it is replaced with a new Element for the same key,
- * then both the version number and lastUpdateTime should be updated to reflect that. The creation time
- * will be the creation time of the new Element, not the original one, so that TTL concepts still work.
- *
- * @return the time when the last update occured. If this is the original Element, the time will be null
- */
- public long getLastUpdateTime() {
- return lastUpdateTime;
- }
-
- /**
- * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past.
- *
- * @return true if the Element is expired, otherwise false. If no lifespan has been set for the Element it is
- * considered not able to expire.
- * @see #getExpirationTime()
- */
- public boolean isExpired() {
- if (!isLifespanSet() || isEternal()) {
- return false;
- }
-
- long now = getCurrentTime();
- long expirationTime = getExpirationTime();
-
- return now > expirationTime;
- }
-
- /**
- * An element is expired if the expiration time as given by {@link #getExpirationTime()} is in the past.
- *

- * This method is not meant to be used remotely. The replicator already needs to know this. It has
- * to throw RemoteException to comply with RMI requirements
- * @return the URL as a string
- */
- String getUrl() throws RemoteException;
-
-
- /**
- * The URL base for the remote replicator to connect. The value will have meaning
- * only to a specific implementation of replicator and remote peer.
- */
- String getUrlBase() throws RemoteException;
-
-
- /**
- * Returns a list of all elements in the cache, whether or not they are expired.
- *

- * The returned keys are unique and can be considered a set.
- *

- * The List returned is not live. It is a copy.
- *

- * The time taken is O(n). On a single cpu 1.8Ghz P4, approximately 8ms is required
- * for each 1000 entries.
- *
- * @return a list of {@link Object} keys
- */
- List getKeys() throws RemoteException;
-
-
- /**
- * Gets an element from the cache, without updating Element statistics. Cache statistics are
- * still updated.
- * @param key a serializable value
- * @return the element, or null, if it does not exist.
- */
- Element getQuiet(Serializable key) throws RemoteException;
-
- /**
- * Gets a list of elements from the cache, for a list of keys, without updating Element statistics. Time to
- * idle lifetimes are therefore not affected.
- *

- * If the shutdown occurs on the singleton, then the singleton is removed, so that if a singleton access method is called, a new
- * singleton will be created.
- */
- void shutdown();
-
- /**
- * Clears the contents of all caches in the CacheManager, but without
- * removing any caches.
- *