Package org.apache.jcs.access.exception

Examples of org.apache.jcs.access.exception.CacheException


        {
            attrNameSet = new HashSet();
        }
        else
        {
            throw new CacheException( "createGroup(group,attr) > group " + group + " already exists " );
        }
        try
        {
            CacheElement ceID = new CacheElement( this.getCacheName(), groupId, attrNameSet );
            ceID.setElementAttributes( attrE );
View Full Code Here


    public void put( Object key, Object val, IElementAttributes attr )
        throws CacheException
    {
        if ( key == null  )
        {
            throw new CacheException( "Key must not be null" );
        }
        else if ( val == null )
        {
            throw new CacheException( "Value must not be null" );
        }

        // Create the element and update. This may throw an IOException which
        // should be wrapped by cache access.

        try
        {
            CacheElement ce = new CacheElement( cacheControl.getCacheName(),
                              (Serializable) key,
                              (Serializable) val );

            ce.setElementAttributes( attr );

            cacheControl.update( ce );
        }
        catch ( Exception e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

        {
            cacheControl.removeAll();
        }
        catch( IOException e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

        {
            cacheControl.removeAll();
        }
        catch( IOException e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

            this.cacheControl.update( ce );
        }
        catch ( Exception e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

        {
            this.cacheControl.removeAll();
        }
        catch ( IOException e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

        {
            this.cacheControl.removeAll();
        }
        catch ( IOException e )
        {
            throw new CacheException( e );
        }
    }
View Full Code Here

        }
        catch ( IOException ioe )
        {
            String message = "Failure freeing memory elements.  ";
            log.error( message, ioe );
            throw new CacheException( message + ioe.getMessage() );
        }
        return numFreed;
    }
View Full Code Here

                JCS.setConfigFilename(configFilePath);
        } catch (Exception e) {
            // Trace the exception
            log.error(e.getMessage());
            // Throw a new sophisticated exception
            throw new CacheException("Could not set cache config file.\n");
        }

        log.info("Successfully set config file to::" + configFilePath);

        // Fetch the region
        try {
            cache = JCS.getInstance(regionName);
        } catch (Exception e) {
            // Trace the exception
            log.error(e.getMessage());
            // Throw a new sophisticated exception
            throw new CacheException("Could not fetch the cache region::" + regionName + ".\n");
        }

        log.info("Successfully fetched the cache region::" + regionName);
        return cache;
    }
View Full Code Here

     * @param object object to be cached
     * @throws CacheException: thrown if the cache instance is found to be null
     */
    public static void addToCache(JCS cache, String key, Object object) throws CacheException {
        if (cache == null)
            throw new CacheException("Null cache");
        cache.put(key, object);
    }
View Full Code Here

TOP

Related Classes of org.apache.jcs.access.exception.CacheException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.