Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2003-2010 Terracotta, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package net.sf.ehcache.constructs.nonstop;
 
 import java.util.List;
 
Interface that defines behaviors for different get/put/remove operations on a cache. Different implementations can have different behaviors for each operation Methods in this interface contains those methods in Ehcache that can reach the Terracotta layer (and potentially block eg. when cluster goes offline)

Author(s):
Abhishek Sanoujam
 
 public interface NonStopCacheBehavior {

    
Method defining the get(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the type implementing this class
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
 
     Element get(Object keythrows IllegalStateExceptionCacheException;

    
Method defining the get(java.io.Serializable) behavior

Parameters:
key
Returns:
the value associated for the key
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
 
     Element get(final Serializable keythrows IllegalStateExceptionCacheException;

    
Method defining the getQuiet(java.lang.Object) behavior

Parameters:
key
Returns:
the value associated for the key
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
 
     Element getQuiet(Object keythrows IllegalStateExceptionCacheException;

    
Method defining the getQuiet(java.io.Serializable) behavior

Parameters:
key
Returns:
the value associated for the key
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
 
     Element getQuiet(final Serializable keythrows IllegalStateExceptionCacheException;

    
Method defining the getKeys() behavior

 
     List getKeys() throws IllegalStateExceptionCacheException;

    
Method defining the getKeysNoDuplicateCheck() behavior

Returns:
list of keys
Throws:
java.lang.IllegalStateException
 
Method defining the getKeysWithExpiryCheck() behavior

Method defining the getSizeBasedOnAccuracy(int) behavior

Parameters:
statisticsAccuracy
Returns:
the size of the cache based on the accuracy setting
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
net.sf.ehcache.CacheException
    int getSizeBasedOnAccuracy(int statisticsAccuracythrows IllegalArgumentExceptionIllegalStateExceptionCacheException;

    
Method defining the isKeyInCache(java.lang.Object) behavior

Parameters:
key
Returns:
true if the key is in the cache otherwise false
    boolean isKeyInCache(Object key);

    
Method defining the isValueInCache(java.lang.Object) behavior

Parameters:
value
Returns:
true if the value is in the cache otherwise false
    boolean isValueInCache(Object value);

    
    void put(Element elementboolean doNotNotifyCacheReplicatorsthrows IllegalArgumentExceptionIllegalStateException,
            CacheException;

    
    void put(Element elementthrows IllegalArgumentExceptionIllegalStateExceptionCacheException;

    
Method defining the remove(java.lang.Object,boolean) behavior

Parameters:
key
doNotNotifyCacheReplicators
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean remove(Object keyboolean doNotNotifyCacheReplicatorsthrows IllegalStateException;

    
Method defining the remove(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean remove(Object keythrows IllegalStateException;

    
Method defining the remove(java.io.Serializable,boolean) behavior

Parameters:
key
doNotNotifyCacheReplicators
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean remove(final Serializable keyfinal boolean doNotNotifyCacheReplicatorsthrows IllegalStateException;

    
Method defining the remove(java.io.Serializable) behavior

Parameters:
key
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean remove(final Serializable keythrows IllegalStateException;

    
Method defining the removeQuiet(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean removeQuiet(Object keythrows IllegalStateException;

    
Method defining the removeQuiet(java.io.Serializable) behavior

Parameters:
key
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    boolean removeQuiet(Serializable keythrows IllegalStateException;

    
    void removeAll() throws IllegalStateExceptionCacheException;

    
Method defining the removeAll() behavior

Parameters:
doNotNotifyCacheReplicators
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
    void removeAll(boolean doNotNotifyCacheReplicatorsthrows IllegalStateExceptionCacheException;

    
Method defining the removeWithWriter(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
    boolean removeWithWriter(Object keythrows IllegalStateExceptionCacheException;

    
Method defining the getInternalContext() behavior

Returns:
depends on the implementation
    Object getInternalContext();

    
Method defining the getStatistics() behavior

Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
Method defining the calculateInMemorySize() behavior

Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
Method defining the getMemoryStoreSize() behavior

Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    long getMemoryStoreSize() throws IllegalStateException;

    
Method defining the getDiskStoreSize() behavior

Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
    int getDiskStoreSize() throws IllegalStateException;

    
Method defining the isElementInMemory(java.io.Serializable) behavior

Parameters:
key
Returns:
depends on the implementation
    boolean isElementInMemory(Serializable key);

    
Method defining the isElementInMemory(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the implementation
    boolean isElementInMemory(Object key);

    
Method defining the isElementOnDisk(java.io.Serializable) behavior

Parameters:
key
Returns:
depends on the implementation
    boolean isElementOnDisk(Serializable key);

    
Method defining the isElementOnDisk(java.lang.Object) behavior

Parameters:
key
Returns:
depends on the implementation
    boolean isElementOnDisk(Object key);

    
Method defining the evictExpiredElements() behavior
    void evictExpiredElements();

    
Method defining the replace(net.sf.ehcache.Element,net.sf.ehcache.Element) behavior

Parameters:
old
element
Returns:
depends on the implementation
Throws:
java.lang.NullPointerException
java.lang.IllegalArgumentException
    boolean replace(Element oldElement elementthrows NullPointerExceptionIllegalArgumentException;

    
Method defining the replace(net.sf.ehcache.Element) behavior

Parameters:
element
Returns:
depends on the implementation
Throws:
java.lang.NullPointerException
    Element replace(Element elementthrows NullPointerException;

    
    void flush() throws IllegalStateExceptionCacheException;

    
Method defining the getSize() behavior

Returns:
depends on the implementation
Throws:
java.lang.IllegalStateException
net.sf.ehcache.CacheException
    int getSize() throws IllegalStateExceptionCacheException;

    
Method defining the removeElement(net.sf.ehcache.Element) behavior

Parameters:
element
Returns:
depends on the implementation
Throws:
java.lang.NullPointerException
    boolean removeElement(Element elementthrows NullPointerException;

    
Method defining the putIfAbsent(net.sf.ehcache.Element) behavior

Parameters:
element
Returns:
depends on the implementation
Throws:
java.lang.NullPointerException
    Element putIfAbsent(Element elementthrows NullPointerException;
New to GrepCode? Check out our FAQ X