Codota Logo
ExpirableCache.getObject
Code IndexAdd Codota to your IDE (free)

How to use
getObject
method
in
com.ebay.cloud.cms.utils.ExpirableCache

Best Java code snippets using com.ebay.cloud.cms.utils.ExpirableCache.getObject (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: eBay/YiDB

/**
 * className is either metaclass name or pluralName
 * 
 * @param className
 * @return
 */
public MetaClass getMetaClassFromCache(String className) {
  MetaClass m = nameCache.getObject(className);
  if (m == null) {
    m = pluralNameCache.getObject(className);
  }
  return m;
}

origin: eBay/YiDB

public Integer getCountFromCache(String dbCollectionName){
  return countCache.getObject(dbCollectionName);
}

origin: eBay/YiDB

@Override
public Repository getRepository(String repositoryName) {
  Repository repo = null;
  BasicDBObject query = new BasicDBObject();
  query.put(Repository.REPOSITORY_FIELD_NAME, repositoryName);
  query.put(Repository.STATE_FIELD, Repository.StateEnum.normal.toString());
  boolean suggestRefresh = false;
  DBObject object = repoCollection.findOne(query);
  if (object != null) {
    repo = cache.getObject(repositoryName);
    if (repo == null) {
      suggestRefresh = true;
    }
  } else if (cache.getObject(repositoryName) != null) {
    suggestRefresh = true;
  }
  // find something different between the cache and the read db.
  if (suggestRefresh) {
    refreshRepositoryCache();
    repo = cache.getObject(repositoryName);
  }
  if (repo == null) {
    throw new RepositoryNotExistsException(repositoryName);
  }
  return repo;
}
origin: eBay/YiDB

@Test
public void expirationTest() throws InterruptedException {
  ExpirableCache<String> cache = new ExpirableCache<String>(100, 1);
  cache.putObject(c[0], c[0]);
  assertTrue(cache.getObject(c[0]) == c[0]);
  Thread.sleep(2000);
  assertNull(cache.getObject(c[0]));
}
 
origin: eBay/YiDB

@Test
public void deleteTest() {
  ExpirableCache<String> cache = new ExpirableCache<String>(100, 60);
  cache.putObject(c[0], c[0]);
  assertTrue(cache.getObject(c[0]) == c[0]);
  cache.deleteObject(c[0]);
  assertNull(cache.getObject(c[0]));
}
 
origin: eBay/YiDB

@Test
public void cacheTest() {
  ExpirableCache<String> cache = new ExpirableCache<String>(100, 60);
  
  for (String i : c) {
    cache.putObject(i, i);
  }
  
  for (String i : c) {
    String o = cache.getObject(i);
    assertTrue(o == c[Integer.valueOf(o)]);
  }
}
 
origin: eBay/YiDB

@Test
public void sizeTest() {
  ExpirableCache<String> cache = new ExpirableCache<String>(1, 60);
  cache.putObject(c[0], c[0]);
  cache.putObject(c[1], c[1]);
  assertNull(cache.getObject(c[0]));
  assertTrue(cache.getObject(c[1]) == c[1]);
}
 
com.ebay.cloud.cms.utilsExpirableCachegetObject

Popular methods of ExpirableCache

  • <init>
  • deleteObject
  • putObject
  • checkNotNull
  • cleanup
  • values

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • JCheckBox (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now