1 package org.jacorb.poa; 2 3 22 23 import org.apache.avalon.framework.logger.Logger; 24 import org.apache.avalon.framework.configuration.*; 25 26 import org.jacorb.poa.util.*; 27 import org.jacorb.util.ObjectUtil; 28 29 import org.jacorb.orb.dsi.ServerRequest; 30 31 32 38 39 public class POAMonitorLightImpl 40 implements POAMonitor 41 { 42 private POA poaModel; 43 private AOM aomModel; 44 private RequestQueue queueModel; 45 private RPPoolManager pmModel; 46 47 48 private org.jacorb.config.Configuration configuration = null; 49 private Logger logger; 50 private boolean doMonitor; 51 52 private String prefix; 53 54 public void changeState(String state) 55 { 56 } 57 58 public void closeMonitor() 59 { 60 } 61 62 63 public void init(POA poa, AOM aom, RequestQueue queue, RPPoolManager pm, 64 String _prefix) 65 { 66 poaModel = poa; 67 aomModel = aom; 68 queueModel = queue; 69 pmModel = pm; 70 prefix = prefix; 71 } 72 73 74 public void configure(Configuration myConfiguration) 75 throws ConfigurationException 76 { 77 this.configuration = (org.jacorb.config.Configuration)myConfiguration; 78 logger = configuration.getNamedLogger("jacorb.poa.monitor"); 79 doMonitor = 80 configuration.getAttributeAsBoolean("jacorb.poa.monitoring",false); 81 } 82 83 public void openMonitor() 84 { 85 if ( doMonitor ) 86 { 87 try 88 { 89 POAMonitor newMonitor = 90 (POAMonitor)ObjectUtil.classForName("org.jacorb.poa.POAMonitorImpl").newInstance(); 91 newMonitor.init(poaModel, aomModel, queueModel, pmModel, prefix ); 92 newMonitor.configure(configuration); 93 poaModel.setMonitor(newMonitor); 94 newMonitor.openMonitor(); 95 } 96 catch (Throwable exception) 97 { 98 if (logger.isWarnEnabled()) 99 { 100 logger.warn("Exception during openMonitor() of POAMonitorLightImpl" + 101 exception.getMessage()); 102 } 103 } 104 } 105 } 106 } 107 | Popular Tags |