org.hd.d.pg2k.webSvr.exhibit
Class DataSourceBean.BackGroundThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.hd.d.pg2k.webSvr.exhibit.DataSourceBean.BackGroundThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
DataSourceBean

private static final class DataSourceBean.BackGroundThread
extends java.lang.Thread

Operates the poll()ing/background Thread. Retains only a WeakReference to the bean instance to as to allow GC.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  int basicBgInterval
          Approx average interval between calls to doBG() in ms; maximum interval no more than twice this.
private  java.lang.ref.WeakReference<DataSourceBean> beanInstance
          Non-strong reference back to the bean instance; never null but the referent may be.
private  int maxBgInterval
          We'll back off to an upper limit if we encounter errors in polling.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private DataSourceBean.BackGroundThread(DataSourceBean dsb)
           
 
Method Summary
 void run()
          Call poll().
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

beanInstance

private final java.lang.ref.WeakReference<DataSourceBean> beanInstance
Non-strong reference back to the bean instance; never null but the referent may be.


basicBgInterval

private final int basicBgInterval
Approx average interval between calls to doBG() in ms; maximum interval no more than twice this. Of the order of a second to allow processing of resource-usage monitoring, which requires the fastest processing.

Different per instance to make collisions, etc, less likely.


maxBgInterval

private final int maxBgInterval
We'll back off to an upper limit if we encounter errors in polling. We do this mainly to avoid flooding logs if things are badly broken, but we usually expect to stay at or close to the minimum bg interval.

This is short enough not to completely wreck performance/interaction, or (eg) break the variable pipeline.

Constructor Detail

DataSourceBean.BackGroundThread

private DataSourceBean.BackGroundThread(DataSourceBean dsb)
Method Detail

run

public final void run()
Call poll().

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

DHD Multimedia Gallery V1.53.0

Copyright (c) 1996-2009, Damon Hart-Davis. All rights reserved.