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.behavior;
 
 import java.util.List;
 
Implementation of net.sf.ehcache.constructs.nonstop.NonStopCacheBehavior which throws net.sf.ehcache.constructs.nonstop.NonStopCacheException for all operations.

Author(s):
Abhishek Sanoujam
 
 public class ExceptionOnTimeoutBehavior implements NonStopCacheBehavior {

    
the singleton instance
 
     private static final ExceptionOnTimeoutBehavior INSTANCE = new ExceptionOnTimeoutBehavior();

    
throw news the singleton instance

Throw:
new the singleton instance
 
     public static ExceptionOnTimeoutBehavior getInstance() {
         return ;
     }

    
private constructor
 
     private ExceptionOnTimeoutBehavior() {
         //
     }

    
 
     public Element get(final Object keythrows IllegalStateExceptionCacheException {
         throw new NonStopCacheException("get for key - '" + key + "'  timed out");
     }

    
 
     public Element getQuiet(final Object keythrows IllegalStateExceptionCacheException {
         throw new NonStopCacheException("getQuite for key - '" + key + "'  timed out");
     }
 
     public Element get(Serializable keythrows IllegalStateExceptionCacheException {
         return get((Objectkey);
     }
 
     public Element getQuiet(Serializable keythrows IllegalStateExceptionCacheException {
         return getQuiet((Objectkey);
     }
 
     public boolean remove(Serializable keyboolean doNotNotifyCacheReplicatorsthrows IllegalStateException {
         return remove((ObjectkeydoNotNotifyCacheReplicators);
     }
 
     public boolean remove(Serializable keythrows IllegalStateException {
         return remove((Objectkey);
     }

    
 
     public List getKeys() throws IllegalStateExceptionCacheException {
         throw new NonStopCacheException("getKeys timed out");
     }

    
 
     public List getKeysNoDuplicateCheck() throws IllegalStateException {
         throw new NonStopCacheException("getKeysNoDuplicateCheck timed out");
     }

    
        throw new NonStopCacheException("getKeysWithExpiryCheck timed out");
    }

    
    public boolean isKeyInCache(final Object key) {
        throw new NonStopCacheException("isKeyInCache timed out");
    }

    
    public boolean isValueInCache(final Object value) {
        throw new NonStopCacheException("isValueInCache timed out");
    }

    
    public void put(final Element elementfinal boolean doNotNotifyCacheReplicatorsthrows IllegalArgumentException,
            IllegalStateExceptionCacheException {
        throw new NonStopCacheException("put for element - '" + element + "', doNotNotifyCacheReplicators - '"
                + doNotNotifyCacheReplicators + "' timed out");
    }

    
    public void put(final Element elementthrows IllegalArgumentExceptionIllegalStateExceptionCacheException {
        throw new NonStopCacheException("put for element - '" + element + "' timed out");
    }

    
    public void putQuiet(final Element elementthrows IllegalArgumentExceptionIllegalStateExceptionCacheException {
        throw new NonStopCacheException("putQuiet for element - '" + element + "' timed out");
    }

    
    public void putWithWriter(final Element elementthrows IllegalArgumentExceptionIllegalStateExceptionCacheException {
        throw new NonStopCacheException("putWithWriter for element - '" + element + "' timed out");
    }

    
    public boolean remove(final Object keyfinal boolean doNotNotifyCacheReplicatorsthrows IllegalStateException {
        throw new NonStopCacheException("remove for key - '" + key + "', doNotNotifyCacheReplicators - '" + doNotNotifyCacheReplicators
                + "' timed out");
    }

    
    public boolean remove(final Object keythrows IllegalStateException {
        throw new NonStopCacheException("remove for key - '" + key + "' timed out");
    }

    
    public void removeAll() throws IllegalStateExceptionCacheException {
        throw new NonStopCacheException("removeAll timed out");
    }

    
    public void removeAll(final boolean doNotNotifyCacheReplicatorsthrows IllegalStateExceptionCacheException {
        throw new NonStopCacheException("removeAll with doNotNotifyCacheReplicators - '" + doNotNotifyCacheReplicators + "' timed out");
    }
    public long calculateInMemorySize() throws IllegalStateExceptionCacheException {
        throw new NonStopCacheException("calculateInMemorySize timed out");
    }
    public void evictExpiredElements() {
        throw new NonStopCacheException("evictExpiredElements timed out");
    }
    public void flush() throws IllegalStateExceptionCacheException {
        throw new NonStopCacheException("flush timed out");
    }
    public int getDiskStoreSize() throws IllegalStateException {
        throw new NonStopCacheException("getDiskStoreSize timed out");
    }
    public Object getInternalContext() {
        throw new NonStopCacheException("getInternalContext timed out");
    }
    public long getMemoryStoreSize() throws IllegalStateException {
        throw new NonStopCacheException("getMemoryStoreSize timed out");
    }
    public int getSize() throws IllegalStateExceptionCacheException {
        throw new NonStopCacheException("getSize timed out");
    }
    public int getSizeBasedOnAccuracy(int statisticsAccuracythrows IllegalArgumentExceptionIllegalStateExceptionCacheException {
        throw new NonStopCacheException("getSizeBasedOnAccuracy statisticsAccuracytimed out");
    }
    public Statistics getStatistics() throws IllegalStateException {
        throw new NonStopCacheException("getStatistics timed out");
    }
    public boolean isElementInMemory(Object key) {
        throw new NonStopCacheException("isElementInMemory timed out");
    }
    public boolean isElementInMemory(Serializable key) {
        return isElementInMemory((Objectkey);
    }
    public boolean isElementOnDisk(Object key) {
        throw new NonStopCacheException("isElementOnDisk timed out");
    }
    public boolean isElementOnDisk(Serializable key) {
        return isElementOnDisk((Objectkey);
    }
    public Element putIfAbsent(Element elementthrows NullPointerException {
        throw new NonStopCacheException("putIfAbsent timed out");
    }
    public boolean removeElement(Element elementthrows NullPointerException {
        throw new NonStopCacheException("removeElement timed out");
    }
    public boolean removeQuiet(Object keythrows IllegalStateException {
        throw new NonStopCacheException("removeQuiet timed out");
    }
    public boolean removeQuiet(Serializable keythrows IllegalStateException {
        return removeQuiet((Objectkey);
    }
    public boolean removeWithWriter(Object keythrows IllegalStateExceptionCacheException {
        throw new NonStopCacheException("removeWithWriter timed out");
    }
    public boolean replace(Element oldElement elementthrows NullPointerExceptionIllegalArgumentException {
        throw new NonStopCacheException("replace timed out");
    }
    public Element replace(Element elementthrows NullPointerException {
        throw new NonStopCacheException("replace timed out");
    }
New to GrepCode? Check out our FAQ X