1 10 package org.picocontainer.defaults; 11 12 import java.io.Serializable ; 13 14 import org.picocontainer.ComponentMonitor; 15 16 27 public abstract class MonitoringComponentAdapterFactory implements ComponentAdapterFactory, ComponentMonitorStrategy, Serializable { 28 private ComponentMonitor componentMonitor; 29 30 34 protected MonitoringComponentAdapterFactory(ComponentMonitor monitor) { 35 if (monitor == null){ 36 throw new NullPointerException ("componentMonitor"); 37 } 38 this.componentMonitor = monitor; 39 } 40 41 44 protected MonitoringComponentAdapterFactory() { 45 this(new DelegatingComponentMonitor()); 46 } 47 48 public void changeMonitor(ComponentMonitor monitor) { 49 this.componentMonitor = monitor; 50 } 51 52 56 public ComponentMonitor currentMonitor(){ 57 return componentMonitor; 58 } 59 60 } 61 | Popular Tags |