org.logicalcobwebs.proxool.util
类 AbstractListenerContainer

java.lang.Object
  继承者 org.logicalcobwebs.proxool.util.AbstractListenerContainer
所有已实现的接口:
ListenerContainerIF
直接已知子类:
CompositeConfigurationListener, CompositeConnectionListener, CompositeProxoolListener, CompositeStateListener, CompositeStatisticsListener

public abstract class AbstractListenerContainer
extends Object
implements ListenerContainerIF

Implementation of ListenerContainerIF that uses a reads/write lock to handle concurrency in a safe and fast way.

The registered listeners are offered to subclasses through the protected getListeners() method. This method returns a reference to an array containing the registered listeners. A new array holding the listeners is created everytime a modification on the registration list is required (add/remove listener). Therefore, subclasses can safely iterate over the received array. Your code sould look like this:

     Object[] listeners = getListeners();
     for(int i=0; i
 
 

从以下版本开始:
Proxool 0.7
版本:
$Revision: 1.8 $, $Date: 2004/03/16 08:48:33 $
作者:
Christian Nedregaard (christian_nedregaard@email.com), $Author: brenuart $ (current maintainer)

构造方法摘要
AbstractListenerContainer()
           
 
方法摘要
 void addListener(Object listener)
          Add a listener to this container.
protected  Object[] getListeners()
          Get a reference to the array of registered listeners.
 boolean isEmpty()
          Get wether this container is empty or not.
 boolean removeListener(Object listener)
          Remove a listener from this container.
static String stringToUP(String str)
           
static String UPToString(String str)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

AbstractListenerContainer

public AbstractListenerContainer()
方法详细信息

addListener

public void addListener(Object listener)
从接口 ListenerContainerIF 复制的描述
Add a listener to this container.

指定者:
接口 ListenerContainerIF 中的 addListener
参数:
listener - the listener to add.
另请参见:
ListenerContainerIF.addListener(Object)

removeListener

public boolean removeListener(Object listener)
从接口 ListenerContainerIF 复制的描述
Remove a listener from this container.

指定者:
接口 ListenerContainerIF 中的 removeListener
参数:
listener - the listener to be removed.
返回:
wether the listnener was found and removed or not.
另请参见:
ListenerContainerIF.removeListener(Object)

getListeners

protected Object[] getListeners()
Get a reference to the array of registered listeners.

返回:
reference to the array containing registered listeners (always not NULL)

isEmpty

public boolean isEmpty()
从接口 ListenerContainerIF 复制的描述
Get wether this container is empty or not.

指定者:
接口 ListenerContainerIF 中的 isEmpty
返回:
wether this container is empty or not.
另请参见:
ListenerContainerIF.isEmpty()

UPToString

public static String UPToString(String str)

stringToUP

public static String stringToUP(String str)


Copyright © 2014. All rights reserved.