1 23 24 38 39 package com.sun.enterprise.admin.monitor.registry.spi.reconfig; 40 41 import com.sun.enterprise.admin.monitor.registry.StatsHolder; 42 import com.sun.enterprise.admin.monitor.registry.MonitoredObjectType; 43 import com.sun.enterprise.admin.monitor.registry.MonitoringLevel; 44 import com.sun.enterprise.admin.monitor.registry.MonitoringLevelListener; 45 46 import com.sun.enterprise.admin.monitor.registry.spi.ValueListMap; 47 48 54 public final class DynamicReconfigurator implements ChangeHandler { 55 56 private final ValueListMap listeners; 57 private ChangeHandler successor; 58 59 public DynamicReconfigurator(ValueListMap listeners) { 60 this.listeners = listeners; 61 chain(); 62 } 63 public void addListener(MonitoredObjectType type, MonitoringLevelListener listener) { 64 if (listeners != null) 65 listeners.put(type, listener); 66 } 67 public void removeListener(MonitoringLevelListener listener) { 68 listeners.remove(listener); 69 } 70 public void handleChange(MonitoredObjectType type, MonitoringLevel from, MonitoringLevel to) { 71 successor.handleChange(type, from, to); 72 } 73 74 private void chain() { 75 final ChangeHandler c = new EmptyChangeHandler(); 77 final ChangeHandler j = new JVMChangeHandler(c, listeners); 78 final ChangeHandler w = new WebContainerChangeHandler(j, listeners); 79 final ChangeHandler e = new EjbContainerChangeHandler(w, listeners); 80 final ChangeHandler ts = new TransactionServiceChangeHandler(e, listeners); 81 final ChangeHandler hs = new HttpServiceChangeHandler(ts, listeners); 82 final ChangeHandler orb = new OrbChangeHandler(hs, listeners); 83 final ChangeHandler tp = new ThreadPoolChangeHandler(orb, listeners); 84 final ChangeHandler cp = new ConnectionPoolChangeHandler(tp, listeners); 85 this.successor = cp; 86 } 87 } 88 | Popular Tags |