HOLDER - holder type for any kind of resource.MRES - resource type to be holden.public class ResCollector<HOLDER extends Holder<MRES,HOLDER>,MRES> extends Object implements Collector<HOLDER,MRES>
| Modifier and Type | Field and Description |
|---|---|
static long |
TERMCHECKTIMEOUT |
static long |
WAITQUEUETIMEOUT |
static long |
WAITRECLAIMTIMEOUT |
static long |
WAITTERMTIMEOUT |
| Constructor and Description |
|---|
ResCollector(ResReclaim<MRES> reclaimer)
constructor to accept a resource reclaimer that is used to actual its
resource when needed.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
close() |
boolean |
close(long recltmout,
long termtmout)
close this collector.
|
void |
destroyRes(MRES mres)
destroy the resource
|
void |
destroyRes(Reference<? extends HOLDER> ref)
destroy a specified holden resource.
|
void |
register(HOLDER holder)
Register a holder and its resource to be managed.
|
void |
removeRef(Reference<HOLDER> ref)
Remove a Ref that cannot be used alone.
|
void |
unregister(HOLDER holder)
Unregister a managed resource.
|
void |
waitReclaimCoolDown(long timeout)
wait for reclaim termination.
|
public static final long WAITRECLAIMTIMEOUT
public static final long WAITQUEUETIMEOUT
public static final long WAITTERMTIMEOUT
public static final long TERMCHECKTIMEOUT
public ResCollector(ResReclaim<MRES> reclaimer)
reclaimer - a reclaimer object for managed resource reclaim.public void register(HOLDER holder)
Collectorpublic void unregister(HOLDER holder)
Collectorpublic void removeRef(Reference<HOLDER> ref)
Collectorpublic void destroyRes(Reference<? extends HOLDER> ref)
public void destroyRes(MRES mres)
Collectorpublic void waitReclaimCoolDown(long timeout)
timeout - specify a timeout to reclaimpublic boolean close(long recltmout,
long termtmout)
Collectorpublic boolean close()
Copyright © 2016 flowcomputing.org. All rights reserved.