1 16 package org.apache.commons.net.util; 17 18 import java.io.Serializable ; 19 import java.util.Enumeration ; 20 import java.util.EventListener ; 21 import java.util.Vector ; 22 23 26 27 public class ListenerList implements Serializable 28 { 29 private Vector __listeners; 30 31 public ListenerList() 32 { 33 __listeners = new Vector (); 34 } 35 36 public synchronized void addListener(EventListener listener) 37 { 38 __listeners.addElement(listener); 39 } 40 41 public synchronized void removeListener(EventListener listener) 42 { 43 __listeners.removeElement(listener); 44 } 45 46 public synchronized Enumeration getListeners() 47 { 48 return ((Vector )__listeners.clone()).elements(); 49 } 50 51 public int getListenerCount() 52 { 53 return __listeners.size(); 54 } 55 56 } 57 | Popular Tags |