org.schemarepo
Class RepositoryCache

java.lang.Object
  extended by org.schemarepo.RepositoryCache
All Implemented Interfaces:
SubjectCache
Direct Known Subclasses:
InMemoryCache

public class RepositoryCache
extends Object
implements SubjectCache

A RepositoryCache composes a SubjectCache with a SchemaEntryCache.Factory, using Subject.cacheWith(Subject, SchemaEntryCache) to wrap Subject instances prior to insertion into the SubjectCache.


Constructor Summary
RepositoryCache(SubjectCache subjects, SchemaEntryCache.Factory entryCacheFactory)
           
 
Method Summary
 Subject add(Subject entry)
          Add or update the Subject entry in this cache.
 Subject lookup(String name)
          Look up a Subject by its name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryCache

@Inject
public RepositoryCache(SubjectCache subjects,
                              SchemaEntryCache.Factory entryCacheFactory)
Method Detail

add

public Subject add(Subject entry)
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.

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


Copyright © 2015. All rights reserved.