org.ops4j.peaberry.cache
Class AbstractServiceImport<T>
java.lang.Object
org.ops4j.peaberry.cache.AbstractServiceImport<T>
- All Implemented Interfaces:
- Comparable<Import<T>>, Import<T>
public abstract class AbstractServiceImport<T>
- extends Object
- implements Import<T>, Comparable<Import<T>>
Partial Import implementation with generation based caching.
- Author:
- mcculls@gmail.com (Stuart McCulloch)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractServiceImport
protected AbstractServiceImport()
get
public final T get()
- Description copied from interface:
Import
- Start using the imported service instance.
- Specified by:
get in interface Import<T>
- Returns:
- service instance
unget
public final void unget()
- Description copied from interface:
Import
- Stop using the imported service instance.
- Specified by:
unget in interface Import<T>
available
public final boolean available()
- Description copied from interface:
Import
- Is the service instance available?
- Specified by:
available in interface Import<T>
- Returns:
- true if the service is available, otherwise false
setCacheGeneration
public static final void setCacheGeneration(int newGeneration)
acquireService
protected abstract T acquireService()
hasRankingChanged
protected abstract boolean hasRankingChanged()
releaseService
protected abstract void releaseService(T o)
Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.