Tabnine Logo
SimpleCache
Code IndexAdd Tabnine to your IDE (free)

How to use
SimpleCache
in
com.ctc.wstx.util

Best Java code snippets using com.ctc.wstx.util.SimpleCache (Showing top 18 results out of 315)

origin: org.codehaus.woodstox/woodstox-core-asl

public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: org.codehaus.woodstox/woodstox-core-asl

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ?
    null : (DTDSubset) mDTDCache.find(id);
}
origin: stackoverflow.com

 class SimpleCacheFactory implements CacheFactory {
 private final String cacheName; //example cache parameter

 public SimpleCacheFactory( String cacheName ) {
  this.cacheName = cacheName;
 }

 public Cache newCache() {
  return new SimpleCache( cacheName );
 }
}
origin: stackoverflow.com

 public void preparePlayer(String videoUri) {
  MediaSource videoSource =
      new ExtractorMediaSource( Uri.parse( videoUri ), dataSourceFactory, extractorsFactory, handler, null );
  exoPlayer.prepare( videoSource );
  exoPlayer.setPlayWhenReady( true );
}

public DataSource.Factory buildDataSourceFactory() {
  return new DataSource.Factory() {
    @Override
    public DataSource createDataSource() {
      LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor( CACHE_SIZE_BYTES );
      File cacheDir = //Your cache dir
      SimpleCache simpleCache = new SimpleCache( cacheDir, evictor );
      DataSource dataSource = buildMyDataSourceFactory().createDataSource();
      int cacheFlags = CacheDataSource.FLAG_BLOCK_ON_CACHE | CacheDataSource.FLAG_CACHE_UNBOUNDED_REQUESTS;
      return new CacheDataSource( simpleCache, dataSource, cacheFlags, CACHE_SIZE_BYTES );
    }
  };
}

private DefaultDataSource.Factory buildMyDataSourceFactory() {
  return new DefaultDataSourceFactory( context, "jesty-android", new DefaultBandwidthMeter() );
}
origin: com.fasterxml.woodstox/woodstox-core

@Override
public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache<DTDId,DTDSubset>(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: com.fasterxml.woodstox/woodstox-core

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
@Override
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ? null : mDTDCache.find(id);
}
origin: Nextdoor/bender

@Override
public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache<DTDId,DTDSubset>(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: FasterXML/woodstox

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
@Override
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ? null : mDTDCache.find(id);
}
origin: woodstox/wstx-lgpl

public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: woodstox/wstx-asl

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ?
    null : (DTDSubset) mDTDCache.find(id);
}
origin: woodstox/wstx-asl

public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: Nextdoor/bender

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
@Override
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ? null : mDTDCache.find(id);
}
origin: org.codehaus.woodstox/woodstox-core-lgpl

public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: org.codehaus.woodstox/woodstox-core-lgpl

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ?
    null : (DTDSubset) mDTDCache.find(id);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.woodstox

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ?
    null : (DTDSubset) mDTDCache.find(id);
}
origin: FasterXML/woodstox

@Override
public synchronized void addCachedDTD(DTDId id, DTDSubset extSubset)
{
  if (mDTDCache == null) {
    mDTDCache = new SimpleCache<DTDId,DTDSubset>(mConfig.getDtdCacheSize());
  }
  mDTDCache.add(id, extSubset);
}
origin: woodstox/wstx-lgpl

/**
 * Method readers created by this factory call, if DTD caching is
 * enabled, to see if an external DTD (subset) has been parsed
 * and cached earlier.
 */
public synchronized DTDSubset findCachedDTD(DTDId id)
{
  return (mDTDCache == null) ?
    null : (DTDSubset) mDTDCache.find(id);
}
com.ctc.wstx.utilSimpleCache

Javadoc

Simple Map implementation usable for caches where contents do not expire, but where size needs to remain bounded.

Note: we probably should use weak references, or something similar to limit maximum memory usage. This could be implemented in many ways, perhaps by using two areas: first, smaller one, with strong refs, and secondary bigger one that uses soft references.

Most used methods

  • <init>
  • add
  • find

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Path (java.nio.file)
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now