public class ObjectResource extends HandleChain
This will allow the object chaining to work naturally as with other legacy resources, help with reference management and resource delete.
| Modifier and Type | Field and Description |
|---|---|
private java.util.Deque<InternalEntry> |
destructors
The destructors to be executed on delete.
|
private boolean |
pendingDelete
Flag indicating if this resource is being deleted.
|
private _BaseObject_ |
ref
The contained object instance.
|
private long |
references
The reference counter.
|
name, nextSibling, prevSibling, wainstProc, pm| Constructor and Description |
|---|
ObjectResource(_BaseObject_ reference)
Initialize this object with the given reference.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decrement()
Decrement the reference counter.
|
void |
delete()
Perform actual delete of an resource.
|
(package private) void |
deleteSilent()
Silently delete this object, by ignoring all conditions.
|
(package private) long |
getReferences()
Get the current reference counter.
|
(package private) boolean |
hasActiveDestructors()
Checks whether the object has any destructor pushed on stack ready to be executed when the
lifetime of the object ends.
|
void |
increment()
Increment the reference counter.
|
(package private) boolean |
isPendingDelete()
Check if this resource is being deleted.
|
protected boolean |
processResource()
Check if this resource must be processed via
ProcedureManager.processResource(com.goldencode.p2j.util.WrappedResource, boolean), once
it has been instantiated. |
(package private) void |
pushDestructor(InternalEntry mthd)
Add a new destructor on the stack.
|
_BaseObject_ |
ref()
Return the wrapped reference.
|
protected boolean |
resourceDelete()
Check if the resource can be deleted (is not
delayed). |
boolean |
unknown()
Check if this resource is unknown.
|
boolean |
valid()
Check if this pseudo-resource is valid.
|
_name, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameConstraints, hasNameReadOnly, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, name, readOnlyError, readOnlyError, resolveChainType, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, registerResource, resourceType, setInstantiatingProcedure, toString, type, unableToAssignUnknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitresourceTypeid, idallowDeleteprivate _BaseObject_ ref
null is unknown value.private long references
private java.util.Deque<InternalEntry> destructors
private boolean pendingDelete
public ObjectResource(_BaseObject_ reference)
reference - The reference.public boolean unknown()
unknown in interface WrappedResourceunknown in class HandleResourcefalsepublic boolean valid()
true if ref is not null.public _BaseObject_ ref()
protected boolean processResource()
ProcedureManager.processResource(com.goldencode.p2j.util.WrappedResource, boolean), once
it has been instantiated.processResource in class HandleResourcefalse.public void increment()
public void decrement()
public void delete()
delete in interface Deletabledelete in class HandleChainprotected boolean resourceDelete()
delayed).resourceDelete in class HandleResourcetrueboolean hasActiveDestructors()
true if when the object is deleted at least one destructor will be
executed.void pushDestructor(InternalEntry mthd)
mthd - The destructor method.long getReferences()
references.void deleteSilent()
boolean isPendingDelete()
pendingDelete state.