1 6 package org.logicalcobwebs.proxool; 7 8 import java.util.Properties ; 9 10 import org.apache.commons.logging.Log; 11 import org.apache.commons.logging.LogFactory; 12 import org.logicalcobwebs.proxool.util.AbstractListenerContainer; 13 14 27 public class CompositeProxoolListener extends AbstractListenerContainer implements ProxoolListenerIF { 28 static final Log LOG = LogFactory.getLog(CompositeProxoolListener.class); 29 30 33 public void onRegistration( ConnectionPoolDefinitionIF connectionPoolDefinition, 34 Properties completeInfo) 35 { 36 Object [] listeners = getListeners(); 37 38 for(int i=0; i<listeners.length; i++) { 39 try { 40 ProxoolListenerIF proxoolListener = (ProxoolListenerIF) listeners[i]; 41 proxoolListener.onRegistration(connectionPoolDefinition, (Properties ) completeInfo.clone()); 42 } 43 catch (RuntimeException re) { 44 LOG.warn("RuntimeException received from listener "+listeners[i]+" when dispatching onRegistration event", re); 45 } 46 } 47 } 48 49 52 public void onShutdown(String alias) 53 { 54 Object [] listeners = getListeners(); 55 56 for(int i=0; i<listeners.length; i++) { 57 try { 58 ProxoolListenerIF proxoolListener = (ProxoolListenerIF) listeners[i]; 59 proxoolListener.onShutdown(alias); 60 } 61 catch (RuntimeException re) { 62 LOG.warn("RuntimeException received from listener "+listeners[i]+" when dispatching onShutdown event", re); 63 } 64 } 65 } 66 } 67 68 | Popular Tags |