Code example for CacheException

0
    String sessionId = session.getId();
    if ( sessionId != null ) {
      String newKey = sessionId + "\t" + key; //$NON-NLS-1$
      return newKey;
    } else { 
      throw new CacheException( Messages.getInstance().getErrorString( "CacheManager.ERROR_0001_NOSESSION" ) ); //$NON-NLS-1$
    } 
  } 
 
  private LastModifiedCache buildCache( String key, Properties cacheProperties ) {
    if ( getCacheProvider() != null ) { 
      Cache cache = getCacheProvider().buildCache( key, cacheProperties );
      LastModifiedCache lmCache = new LastModifiedCache( cache );
      if ( cacheExpirationRegistry != null ) {
        cacheExpirationRegistry.register( lmCache );
      } else { 
        logger.warn( Messages.getInstance().getErrorString( "CacheManager.WARN_0003_NO_CACHE_EXPIRATION_REGISTRY" ) );
      } 
      return lmCache;
    } else {