Package org.pentaho.reporting.libraries.resourceloader.cache

Examples of org.pentaho.reporting.libraries.resourceloader.cache.ResourceDataCache


  }

  public synchronized ResourceData loadRawData(final ResourceKey key)
      throws UnrecognizedLoaderException, ResourceLoadingException
  {
    final ResourceDataCache dataCache = getDataCache();
    // Alternative 3: This is a plain resource and not contained in a bundle. Load as binary data
    final ResourceDataCacheEntry cached = dataCache.get(key);
    if (cached != null)
    {
      final ResourceData data = cached.getData();
      if (data != null)
      {
        if (isValidData(cached, data))
        {
          return data;
        }
        dataCache.remove(data);
      }
    }

    final ResourceData data = backend.loadRawData(this, key);
    if (data != null && isResourceDataCacheable(data))
    {
      dataCache.put(this, data);
    }
    return data;
  }
View Full Code Here


  {
    try
    {
      final ObjectFactory objectFactory = LibLoaderBoot.getInstance().getObjectFactory();
      final ResourceDataCacheProvider maybeDataCacheProvider = objectFactory.get(ResourceDataCacheProvider.class);
      final ResourceDataCache cache = maybeDataCacheProvider.createDataCache();
      if (cache != null)
      {
        setDataCache(cache);
      }
    }
View Full Code Here

  }

  public synchronized ResourceData loadRawData(final ResourceKey key)
      throws UnrecognizedLoaderException, ResourceLoadingException
  {
    final ResourceDataCache dataCache = getDataCache();
    // Alternative 3: This is a plain resource and not contained in a bundle. Load as binary data
    final ResourceDataCacheEntry cached = dataCache.get(key);
    if (cached != null)
    {
      final ResourceData data = cached.getData();
      if (data != null)
      {
        if (isValidData(cached, data))
        {
          return data;
        }
        dataCache.remove(data);
      }
    }

    final ResourceData data = backend.loadRawData(this, key);
    dataCache.put(this, data);
    return data;
  }
View Full Code Here

    if (maybeDataCacheProvider instanceof ResourceDataCacheProvider)
    {
      final ResourceDataCacheProvider provider = (ResourceDataCacheProvider) maybeDataCacheProvider;
      try
      {
        final ResourceDataCache cache = provider.createDataCache();
        if (cache != null)
        {
          setDataCache(cache);
        }
      }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.resourceloader.cache.ResourceDataCache

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.