org.schemarepo
Class InMemorySubjectCache

java.lang.Object
  extended by org.schemarepo.InMemorySubjectCache
All Implemented Interfaces:
SubjectCache

public class InMemorySubjectCache
extends Object
implements SubjectCache

An unbounded in memory SubjectCache that never evicts any values.


Constructor Summary
InMemorySubjectCache()
           
 
Method Summary
 Subject add(Subject subject)
          Add or update the Subject entry in this cache.
 Subject lookup(String name)
          Look up a Subject by its name.
 Iterable<Subject> values()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemorySubjectCache

public InMemorySubjectCache()
Method Detail

lookup

public Subject lookup(String name)
Description copied from interface: SubjectCache
Look up a Subject by its name. Thread-safe.

Specified by:
lookup in interface SubjectCache

add

public Subject add(Subject subject)
Description copied from interface: SubjectCache
Add or update the Subject entry in this cache.

Specified by:
add in interface SubjectCache
Returns:
the Subject that is in the cache after the call completes. If the entry already exists this is the pre-existing value, otherwise it is the value provided. If the value provided is null, returns null. Thread-safe.

values

public Iterable<Subject> values()
Returns:
All fo the Subject values in this InMemorySubjectCache


Copyright © 2015. All rights reserved.