|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ref.Reference<T>
java.lang.ref.PhantomReference<java.lang.Object>
org.jnetpcap.nio.DisposableReference
public abstract class DisposableReference
A reference, who's data can be disposed of using dispose() method
invokation. The Reference also implements the Link interface which allows the
object to be used in a linked-list of DisposableReference objects managed by
LinkSequence stored in global DisposableGC object.
DisposableReference extends WeakReference functionality by allowing
DisposableGC to keep a hardreference to the reference (not the referant) to
keep it in memory. Through the use of a ReferenceQueue, DisposableGC
is notified when real objects (referants) are garbage collected. This class
only keeps a weak reference to referants, but all cleanup information is also
stored in subclass of this class. Specifically by calling on subclassed
dispose() method, it allows the subclass to perform cleanup after an object,
that has already been deleted from memory. For example JMemoryReference
class, deallocates native memory, after the JMemory object that was using
that native memory is already gone. The JMemoryReference remains as our
subclass and has the address of native memory that needs to be reclaimed.
| Constructor Summary | |
|---|---|
DisposableReference(java.lang.Object referant)
Instantiates a new disposable reference. |
|
| Method Summary | |
|---|---|
void |
dispose()
Dispose. |
long |
getTs()
Gets the ts. |
LinkSequence<DisposableReference> |
linkCollection()
Link collection. |
void |
linkCollection(LinkSequence<DisposableReference> collection)
Link collection. |
DisposableReference |
linkElement()
Link element. |
Link<DisposableReference> |
linkNext()
Link next. |
void |
linkNext(Link<DisposableReference> l)
Link next. |
Link<DisposableReference> |
linkPrev()
Link prev. |
void |
linkPrev(Link<DisposableReference> l)
Link prev. |
void |
remove()
Removes the. |
void |
setTs(long ts)
Sets the ts. |
int |
size()
Size. |
java.lang.String |
toString()
To string. |
| Methods inherited from class java.lang.ref.PhantomReference |
|---|
get |
| Methods inherited from class java.lang.ref.Reference |
|---|
clear, enqueue, isEnqueued |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DisposableReference(java.lang.Object referant)
referant - the referant| Method Detail |
|---|
public void dispose()
dispose in interface DisposableDisposable.dispose()public DisposableReference linkElement()
linkElement in interface Link<DisposableReference>Link.linkElement()public LinkSequence<DisposableReference> linkCollection()
linkCollection in interface Link<DisposableReference>Link.linkCollection()public void linkCollection(LinkSequence<DisposableReference> collection)
linkCollection in interface Link<DisposableReference>collection - the collectionLink.linkCollection(org.jnetpcap.nio.LinkSequence)public Link<DisposableReference> linkNext()
linkNext in interface Link<DisposableReference>Link.linkNext()public void linkNext(Link<DisposableReference> l)
linkNext in interface Link<DisposableReference>l - the lLink.linkNext(org.jnetpcap.nio.Link)public Link<DisposableReference> linkPrev()
linkPrev in interface Link<DisposableReference>Link.linkPrev()public void linkPrev(Link<DisposableReference> l)
linkPrev in interface Link<DisposableReference>l - the lLink.linkPrev(org.jnetpcap.nio.Link)public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public void remove()
public int size()
public long getTs()
public void setTs(long ts)
ts - the ts to set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||