org.schemarepo
Interface SubjectCache

All Known Implementing Classes:
InMemoryCache, InMemorySubjectCache, RepositoryCache

public interface SubjectCache

A SubjectCache is a cache from a string subject name to a Subject

In a Repository subjects can be cached because they can only be created. However, a Subject can have its meta-data altered, so this cannot be cached.

add(Subject) and lookup(String) must be thread-safe with respect to each-other.


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.
 

Method Detail

lookup

Subject lookup(String name)
Look up a Subject by its name. Thread-safe.

Throws:
NullPointerException - if the provided name is null

add

Subject add(Subject entry)
Add or update the Subject entry in this cache.

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.


Copyright © 2015. All rights reserved.