|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hd.d.pg2k.webSvr.exhibit.AbstractFilterBean.MyObserver
private static final class AbstractFilterBean.MyObserver
This object has only a WeakReference to the outer class to allow GC. This way it remains fairly safe for us to register with a DataSourceBean even if the outer class may be short-lived and churned in huge numbers.
FIXME: should find way to stop ourself from observing any DataSourceBean (there can be at most one) when the outer object is GCed or maybe when the cache is cleared. Else, lots of redundant (if small) MyObserver objects may accumulate in the DataSourceBean until the exhibit set changes.
| Field Summary | |
|---|---|
private java.lang.ref.WeakReference<AbstractFilterBean> |
beanWR
WeakReference to outer class; never null. |
| Constructor Summary | |
|---|---|
AbstractFilterBean.MyObserver(AbstractFilterBean outer)
Capture a SoftReference to the outer class. |
|
| Method Summary | |
|---|---|
void |
update(java.util.Observable o,
java.lang.Object arg)
This causes the cache to be cleared immediately. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final java.lang.ref.WeakReference<AbstractFilterBean> beanWR
| Constructor Detail |
|---|
AbstractFilterBean.MyObserver(AbstractFilterBean outer)
outer - non-null reference to outer class.| Method Detail |
|---|
public final void update(java.util.Observable o,
java.lang.Object arg)
We use [Observable] o to deregister ourself from the Observable on the grounds that our next select() operation will (re-)register us with whatever DataSourceBean we are then using. This removal avoids leaving references to us from multiple DataSourceBeans or after we have otherwise expired, which would otherwise make GC harder.
The cache-clearing code is synchronized so the caller may be briefly blocked and there may be a small risk of deadlocks if clearCache() does something foolish.
update in interface java.util.Observer
|
DHD Multimedia Gallery V1.53.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||