1 10 package org.picocontainer.defaults; 11 12 import java.io.Serializable ; 13 14 import org.picocontainer.ComponentAdapter; 15 import org.picocontainer.ComponentMonitor; 16 17 29 public abstract class MonitoringComponentAdapter implements ComponentAdapter, ComponentMonitorStrategy, Serializable { 30 private ComponentMonitor componentMonitor; 31 32 36 protected MonitoringComponentAdapter(ComponentMonitor monitor) { 37 if (monitor == null){ 38 throw new NullPointerException ("monitor"); 39 } 40 this.componentMonitor = monitor; 41 } 42 43 46 protected MonitoringComponentAdapter() { 47 this(new DelegatingComponentMonitor()); 48 } 49 50 51 public void changeMonitor(ComponentMonitor monitor) { 52 this.componentMonitor = monitor; 53 } 54 55 59 public ComponentMonitor currentMonitor(){ 60 return componentMonitor; 61 } 62 63 } 64 | Popular Tags |