public class StaleProcedureManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
StaleProcedureManager.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static ContextLocal<StaleProcedureManager.WorkArea> |
work
The stale procedure managers are private per each context.
|
Constructor and Description |
---|
StaleProcedureManager() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addStaleReferent(java.lang.Object referent)
Used for marking the fact that a referent is in a stale state.
|
private static boolean |
canDeleteNow(StaleProcedureManager.WorkArea wa,
java.lang.Object referent,
java.lang.Integer handlingBlock)
Check if the referent of the ExternalProcedureWrapper can be deleted now or it should be
delayed.
|
private static int |
getHandlingBlock(StaleProcedureManager.WorkArea wa,
java.lang.Object referent)
Core method for obtaining the index of the block which is responsible with the deletion of the
resource.
|
static boolean |
invalidateResource(java.lang.Object referent)
Invalidates the resource in terms of stale attributes.
|
static boolean |
invalidateResource(StaleProcedureManager.WorkArea wa,
java.lang.Object referent)
Invalidates the resource in terms of stale attributes.
|
static void |
notifyResourceDelete(java.lang.Object referent)
This should be called when a persistent procedure is deleted.
|
static void |
notifyResourceDelete(StaleProcedureManager.WorkArea wa,
java.lang.Object referent)
This should be called when a persistent procedure is deleted.
|
private static final ContextLocal<StaleProcedureManager.WorkArea> work
public static boolean addStaleReferent(java.lang.Object referent)
referent
- The persistent procedure which needs to be marked as stale.true
if the marking was done for the first time.public static boolean invalidateResource(java.lang.Object referent)
referent
- The persistent procedure which should be invalidated.true
if the referent was invalidated, false
if the referent was
already deleted.public static boolean invalidateResource(StaleProcedureManager.WorkArea wa, java.lang.Object referent)
wa
- The StaleProcedureManager.WorkArea
instance. If null
, a context lookup will be triggered.referent
- The persistent procedure which should be invalidated.true
if the referent was invalidated, false
if the referent was
already deleted.public static void notifyResourceDelete(java.lang.Object referent)
referent
- The wrapper which contains the referent for which the clear should be done.public static void notifyResourceDelete(StaleProcedureManager.WorkArea wa, java.lang.Object referent)
wa
- The StaleProcedureManager.WorkArea
instance. If null
, a context lookup will be triggered.referent
- The wrapper which contains the referent for which the clear should be done.private static int getHandlingBlock(StaleProcedureManager.WorkArea wa, java.lang.Object referent)
persistentProcstack
of one procedure (the stack snapshot of the moment when the first
global static buffer was used) and the current block stack. The handling block here is considered
to be the first block which does not appear in both stacks. This means that when the common block
is reached, the referent shouldn't be stale - but deleted altogether.wa
- The StaleProcedureManager.WorkArea
instance. If null
, a context lookup will be triggered.referent
- The resource which is used in order to detect if the deletion of it should be delayed
or not.private static boolean canDeleteNow(StaleProcedureManager.WorkArea wa, java.lang.Object referent, java.lang.Integer handlingBlock)
wa
- The StaleProcedureManager.WorkArea
instance. If null
, a context lookup will be triggered.referent
- The referent container which should be checked in order to detect if it need invalidation.handlingBlock
- The value of the block which is responsible for deleting this procedure. If null
,
the value will be computed using the getHandlingBlock
.true
if the referent can be deleted now or false
if the deletion
should be postponed