1 6 package org.logicalcobwebs.proxool; 7 8 import org.apache.commons.logging.Log; 9 import org.apache.commons.logging.LogFactory; 10 import org.logicalcobwebs.proxool.util.AbstractListenerContainer; 11 12 25 public class CompositeStateListener extends AbstractListenerContainer implements StateListenerIF { 26 static final Log LOG = LogFactory.getLog(CompositeStateListener.class); 27 28 31 public void upStateChanged(int upState) 32 { 33 Object [] listeners = getListeners(); 34 35 for(int i=0; i<listeners.length; i++) { 36 try { 37 StateListenerIF stateListener = (StateListenerIF) listeners[i]; 38 stateListener.upStateChanged(upState); 39 } 40 catch (RuntimeException re) { 41 LOG.warn("RuntimeException received from listener "+listeners[i]+" when dispatching upStateChanged event", re); 42 } 43 } 44 } 45 } 46 47 | Popular Tags |