|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.snapshot.SnapshotManager
public class SnapshotManager
Manager for annotation snapshots. The manager keeps an internal cache in memory of snapshots that has been loaded. If an unload snapshot is needed the manager will first look in the static cache. If it is not found there the last resort is to generate a new snapshot.
Field Summary | |
---|---|
private Map<Integer,AnnotationSetSnapshot> |
snapshots
|
Constructor Summary | |
---|---|
SnapshotManager()
Create a new snapshot manager. |
Method Summary | |
---|---|
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
Annotatable item,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited)
Utility method for calling getSnapshot and findAnnotations
in one go. |
List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
AnnotationSetSnapshot snapshot,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited)
Search in a snapshot for all annotations of a specified annotation type. |
static String |
getCacheKey(int annotationSetId)
The static cache key under which the snapshot for the annotation set with the given id is cached. |
AnnotationSetSnapshot |
getSnapshot(DbControl dc,
int annotationSetId)
Get the annotation snapshot for the annotation set with the given id. |
static boolean |
removeSnapshot(int annotationSetId)
Removes a snapshot from the static cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final Map<Integer,AnnotationSetSnapshot> snapshots
Constructor Detail |
---|
public SnapshotManager()
Method Detail |
---|
public static String getCacheKey(int annotationSetId)
annotationSetId
- The ID of an annotation setpublic static boolean removeSnapshot(int annotationSetId)
annotationSetId
- The ID of the annotation set
public AnnotationSetSnapshot getSnapshot(DbControl dc, int annotationSetId)
dc
- A DbControl to use if the snapshot has to be created from
the database cacheannotationSetId
- The id of the annotation set
public List<AnnotationSnapshot> findAnnotations(DbControl dc, AnnotationSetSnapshot snapshot, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
dc
- A DbControl to use for database access if a snapshot doesn't
exists for an inherited annotation setsnapshot
- The snapshot to searchfilter
- A filter that should match the wanted annotation snapshots
or null to match all annotationssearchInherited
- TRUE if inherited annotations should be searched,
FALSE to only search primary annotations
public List<AnnotationSnapshot> findAnnotations(DbControl dc, Annotatable item, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
getSnapshot
and findAnnotations
in one go.
getSnapshot(DbControl, int)
,
findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |