|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.fc.collections.RefreshHelper.Refresh
wt.fc.collections.RefreshHelper.UnionRefresh
Implements a refresh in which the 1st pass is UNIONed, since locking isn't necessary
Field Summary | |
(package private) WTCollection |
cachedObjects
Objects that were found in a cache. |
(package private) Map |
classesToRefreshDatas
Mapping of persistable classes to RefreshDatas |
(package private) WTCollection |
collection
|
(package private) WTCollection |
deletedObjects
Objects that were deleted and removed. |
(package private) int |
keyMask
|
(package private) Map |
keysToReferences
Mapping of QueryKeys to the WTReference or Collection of WTReference that refer to them |
(package private) RefreshHelper.LinkRefresh |
linkRefresh
Utility class for refreshes of links and their roles |
(package private) RefreshSpec |
spec
|
(package private) WTCollection |
staleObjects
Tracks all stale objects, so that the refresh can throw a multi-object message if necessary. |
Constructor Summary | |
(package private) |
RefreshHelper.UnionRefresh(WTCollection wtc,
RefreshSpec rs)
|
(package private) |
RefreshHelper.UnionRefresh(WTCollection wtc,
RefreshSpec rs,
int key_mask)
|
Method Summary | |
(package private) void |
add(WTReference r)
Adds the given WTReference to the Refresh's internal data structures |
(package private) void |
add(WTReference r,
boolean role_reference)
Adds the given WTReference to the Refresh's internal data structures |
(package private) void |
addStale(Persistable p,
QueryKey key)
Depending on the stale action, process the stale object |
(package private) void |
addToFirstPass(QueryKey key,
Class c)
Add the given QueryKey to the keys that are queried during the first pass |
(package private) void |
addToKeysToReferences(WTReference r)
Adds the reference to keysToReferences |
(package private) void |
addToSecondPass(QueryKey key,
Class c)
Add the key to the list of keys that are queried during the second pass |
(package private) void |
appendClassNameSelect(QuerySpec qs,
RefreshHelper.RefreshData data)
Allows subclasses to select the classname during the first pass query, if necessary. |
(package private) void |
appendPlaceHolderSelect(QuerySpec qs)
Allows subclasses to select a placeholder branch id if necessary |
(package private) void |
doFirstPass()
Select all first pass objects in a single UNION |
(package private) void |
doSecondPass(StatementSpec statementspec)
Inflate the objects selected by the spec and assign them to the references in keysToReferences. |
(package private) QuerySpec |
getFirstPassQuery(RefreshHelper.RefreshData data)
Get a statement that selects the oids, classnames, updatecounts, and possibly branch ids for the given RefreshData |
(package private) RefreshHelper.RefreshData |
getRefreshData(Class persistable_class)
|
(package private) StatementSpec |
getSecondPassQuery(RefreshHelper.RefreshData data)
Get a statment that selects the objects in the RefreshData with any of ids in secondPassBranchIDs or secondPassOids |
(package private) boolean |
inflateFromCache(WTReference r)
Inflate the reference from the refresh cache |
(package private) void |
log()
Reports debug information to the log |
(package private) void |
processDeletes()
At this point keysToReferences should only contain objects that were: 1) not found by the 1st query because they were deleted 2) not found by the 2nd query because there were deleted since the 1st query 3) filtered by access control by the 2nd query |
(package private) void |
processFirstPassRow(Object[] row,
Class oid_class)
Remove up-to-date objects from keysToReferences. |
(package private) void |
processSecondPassObject(Persistable p)
Inflate any references to the object in keysToReferences. |
(package private) void |
refresh()
Refresh the references in this object's data structures |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
final WTCollection collection
final RefreshSpec spec
final int keyMask
final Map keysToReferences
final Map classesToRefreshDatas
RefreshHelper.LinkRefresh linkRefresh
WTCollection staleObjects
WTCollection cachedObjects
WTCollection deletedObjects
Constructor Detail |
RefreshHelper.UnionRefresh(WTCollection wtc, RefreshSpec rs)
RefreshHelper.UnionRefresh(WTCollection wtc, RefreshSpec rs, int key_mask)
Method Detail |
void doFirstPass() throws WTException
doFirstPass
in class RefreshHelper.Refresh
WTException
void appendClassNameSelect(QuerySpec qs, RefreshHelper.RefreshData data) throws WTException
RefreshHelper.Refresh
appendClassNameSelect
in class RefreshHelper.Refresh
qs
- data
-
WTException
void appendPlaceHolderSelect(QuerySpec qs) throws WTException
RefreshHelper.Refresh
appendPlaceHolderSelect
in class RefreshHelper.Refresh
qs
-
WTException
final void add(WTReference r) throws WTException
r
-
WTException
final void add(WTReference r, boolean role_reference) throws WTException
r
- role_reference
- Whether or not this reference
is being added because it is the role
reference on a link in the input collection
WTException
boolean inflateFromCache(WTReference r) throws WTException
r
-
WTException
void addToFirstPass(QueryKey key, Class c)
key
- c
- void addToSecondPass(QueryKey key, Class c)
key
- c
- void addToKeysToReferences(WTReference r)
r
- void addStale(Persistable p, QueryKey key) throws CollectionContainsStaleException
p
- The stale persistablekey
- The key to use to add this persistable to
the refresh's data structures, so it gets
inflated. If the key is null, then the
object won't be inflated (used by
inflate from cache)
CollectionContainsStaleException
RefreshHelper.RefreshData getRefreshData(Class persistable_class)
void refresh() throws WTException
WTException
QuerySpec getFirstPassQuery(RefreshHelper.RefreshData data) throws WTException
data
-
WTException
void processFirstPassRow(Object[] row, Class oid_class) throws WTException
row
- A result row from the 1st pass queryoid_class
- The class of object for the row
WTException
void doSecondPass(StatementSpec statementspec) throws WTException
WTException
StatementSpec getSecondPassQuery(RefreshHelper.RefreshData data) throws WTException
data
-
WTException
void processSecondPassObject(Persistable p) throws WTException
p
-
WTException
void processDeletes() throws WTException
WTException
void log() throws WTException
WTException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |