org.enhydra.apache.xerces.dom
Class LCount

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.LCount

class LCount
extends Object

Internal class LCount is used to track the number of listeners registered for a given event name, as an entry in a global hashtable. This should allow us to avoid generating, or discard, events for which no listeners are registered. There should undoubtedly be methods here to manipulate this table. At the moment that code's residing in NodeImpl. Move it when we have a chance to do so. Sorry; we were rushed. Also, I'm currently asking "are there any listeners" by testing captures+bubbles+defaults =? 0. It would probably make sense to have a separate "total" field, calculated at add/remove, to save a few cycles during dispatch. Fix. ???? CONCERN: Hashtables are known to be "overserialized" in current versions of Java. That may impact performance. ???? CONCERN: The hashtable should probably be a per-document object. Finer granularity would be even better, but would cost more cycles to resolve and might not save enough event traffic to be worth the investment.


Field Summary
 int bubbles
           
 int captures
           
 int defaults
           
(package private) static Hashtable lCounts
           
 
Constructor Summary
(package private) LCount()
           
 
Method Summary
(package private) static LCount lookup(String evtName)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lCounts

static Hashtable lCounts

captures

public int captures

bubbles

public int bubbles

defaults

public int defaults
Constructor Detail

LCount

LCount()
Method Detail

lookup

static LCount lookup(String evtName)


Copyright © 1999 The Apache Software Foundation. All Rights reserved.