congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Cache.addElement
Code IndexAdd Tabnine to your IDE (free)

How to use
addElement
method
in
org.apache.shindig.common.cache.Cache

Best Java code snippets using org.apache.shindig.common.cache.Cache.addElement (Showing top 20 results out of 315)

origin: org.apache.shindig/shindig-gadgets

@Override
protected void addResponseImpl(String key, HttpResponse response) {
 cache.addElement(key, response);
}
origin: org.apache.shindig/shindig-common

 public void put(String expression, Tree tree) {
  resolvedTreeCache.addElement(expression, tree);
 }
};
origin: com.lmco.shindig/shindig-gadgets

@Override
protected void addResponseImpl(String key, HttpResponse response) {
 cache.addElement(key, response);
}
origin: org.gatein.shindig/shindig-common

 public void put(String expression, Tree tree) {
  resolvedTreeCache.addElement(expression, tree);
 }
};
origin: apache/shindig

 public void put(String expression, Tree tree) {
  resolvedTreeCache.addElement(expression, tree);
 }
};
origin: com.lmco.shindig/shindig-gadgets

/**
 * Invalidate all fetched content that was signed on behalf of the specified set of users.
 *
 * @param opensocialIds
 * @param token
 */
public void invalidateUserResources(Set<String> opensocialIds, SecurityToken token) {
 for (String userId : opensocialIds) {
  // Allocate a new mark for each user
  invalidationEntries.addElement(getKey(userId, token), marker.incrementAndGet());
 }
}
origin: org.apache.shindig/shindig-gadgets

public void store(Key k, List<? extends Job> derivatives) {
 if (!(k instanceof ModuleCacheKey)) {
  throw new IllegalArgumentException(k.getClass().getName());
 }
 ModuleCacheKey key = (ModuleCacheKey) k;
 backingCache.addElement(key, cloneJobs(derivatives));
}
origin: org.gatein.shindig/shindig-gadgets

/**
 * Invalidate all fetched content that was signed on behalf of the specified set of users.
 *
 * @param opensocialIds
 * @param token
 */
public void invalidateUserResources(Set<String> opensocialIds, SecurityToken token) {
 for (String userId : opensocialIds) {
  // Allocate a new mark for each user
  invalidationEntries.addElement(getKey(userId, token), marker.incrementAndGet());
 }
}
origin: org.apache.shindig/shindig-gadgets

/**
 * Invalidate all fetched content that was signed on behalf of the specified set of users.
 *
 * @param opensocialIds
 * @param token
 */
public void invalidateUserResources(Set<String> opensocialIds, SecurityToken token) {
 for (String userId : opensocialIds) {
  // Allocate a new mark for each user
  invalidationEntries.addElement(getKey(userId, token), marker.incrementAndGet());
 }
}
origin: org.apache.shindig/shindig-common

/**
 * Add an element to the cache, with the intended max age for its cache entry provided in
 * milliseconds.
 *
 * @param key The key to store the entry for.
 * @param value The value to store.
 * @param maxAge The maximum age for this entry before it is deemed expired.
 */
public void addElement(K key, V value, long maxAge) {
 long now = timeSource.currentTimeMillis();
 cache.addElement(key, value);
 expirationTimes.put(value, now + maxAge);
}
origin: org.gatein.shindig/shindig-common

/**
 * Add an element to the cache, with the intended max age for its cache entry provided in
 * milliseconds.
 *
 * @param key The key to store the entry for.
 * @param value The value to store.
 * @param maxAge The maximum age for this entry before it is deemed expired.
 */
public void addElement(K key, V value, long maxAge) {
 long now = timeSource.currentTimeMillis();
 cache.addElement(key, value);
 expirationTimes.put(value, now + maxAge);
}
origin: org.wso2.org.apache.shindig/shindig-common

/**
 * Add an element to the cache, with the intended max age for its cache entry provided in
 * milliseconds.
 *
 * @param key The key to store the entry for.
 * @param value The value to store.
 * @param maxAge The maximum age for this entry before it is deemed expired.
 */
public void addElement(K key, V value, long maxAge) {
 long now = timeSource.currentTimeMillis();
 cache.addElement(key, value);
 expirationTimes.put(value, now + maxAge);
}
origin: com.lmco.shindig/shindig-common

/**
 * Add an element to the cache, with the intended max age for its cache entry provided in
 * milliseconds.
 *
 * @param key The key to store the entry for.
 * @param value The value to store.
 * @param maxAge The maximum age for this entry before it is deemed expired.
 */
public void addElement(K key, V value, long maxAge) {
 long now = timeSource.currentTimeMillis();
 cache.addElement(key, value);
 expirationTimes.put(value, now + maxAge);
}
origin: org.apache.shindig/shindig-gadgets

 @Override
 public CompileResult call() throws Exception {
  // Create the options anew. Passing in the parent options, even cloning it, is not thread safe.
  CompileResult result = doCompileContent(content, getCompilerOptions(jsUri), buildExterns(externs));
  synchronized (compiling) {
   // Other threads should pick this up in the cache now.
   cache.addElement(cacheKey, result);
   compiling.remove(cacheKey);
  }
  return result;
 }
});
origin: org.apache.shindig/shindig-gadgets

@Test
public void getResponse() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 HttpResponse response = new HttpResponse("response");
 String key = httpCache.createKey(request);
 cache.addElement(key, response);
 assertEquals(response, httpCache.getResponse(request));
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

@Test
public void getResponse() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 HttpResponse response = new HttpResponse("response");
 String key = httpCache.createKey(request);
 cache.addElement(key, response);
 assertEquals(response, httpCache.getResponse(request));
}
origin: com.lmco.shindig/shindig-gadgets

@Test
public void getResponse() {
 HttpRequest request = new HttpRequest(DEFAULT_URI);
 HttpResponse response = new HttpResponse("response");
 String key = httpCache.createKey(request);
 cache.addElement(key, response);
 assertEquals(response, httpCache.getResponse(request));
}
origin: org.apache.shindig/shindig-gadgets

 @Test
 public void removeResponse() {
  HttpRequest request = new HttpRequest(DEFAULT_URI);
  HttpResponse response = new HttpResponse("response");

  String key = httpCache.createKey(request);

  cache.addElement(key, response);

  assertEquals(response, httpCache.removeResponse(request));

  assertEquals(0, cache.getSize());
 }
}
origin: org.wso2.org.apache.shindig/shindig-gadgets

 @Test
 public void removeResponse() {
  HttpRequest request = new HttpRequest(DEFAULT_URI);
  HttpResponse response = new HttpResponse("response");

  String key = httpCache.createKey(request);

  cache.addElement(key, response);

  assertEquals(response, httpCache.removeResponse(request));

  assertEquals(0, cache.getSize());
 }
}
origin: com.lmco.shindig/shindig-gadgets

 @Test
 public void removeResponse() {
  HttpRequest request = new HttpRequest(DEFAULT_URI);
  HttpResponse response = new HttpResponse("response");

  String key = httpCache.createKey(request);

  cache.addElement(key, response);

  assertEquals(response, httpCache.removeResponse(request));

  assertEquals(0, cache.getSize());
 }
}
org.apache.shindig.common.cacheCacheaddElement

Javadoc

Stores an entry into the cache.

Popular methods of Cache

  • getElement
    Retrieves an entry for the cache.
  • getCapacity
    Returns the capacity of the cache.
  • getSize
  • removeElement
    Removes an entry from the cache.

Popular in Java

  • Making http post requests using okhttp
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • startActivity (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Top 12 Jupyter Notebook extensions
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