1 19 20 package org.apache.excalibur.instrument.manager.impl; 21 22 import org.apache.excalibur.instrument.manager.CounterInstrumentListener; 23 import org.apache.excalibur.instrument.manager.InstrumentableDescriptor; 24 import org.apache.excalibur.instrument.manager.InstrumentDescriptor; 25 import org.apache.excalibur.instrument.manager.InstrumentSampleDescriptor; 26 import org.apache.excalibur.instrument.manager.NoSuchInstrumentSampleException; 27 import org.apache.excalibur.instrument.manager.ValueInstrumentListener; 28 29 37 public class InstrumentDescriptorImpl 38 implements InstrumentDescriptor 39 { 40 41 private InstrumentProxy m_instrumentProxy; 42 43 46 51 InstrumentDescriptorImpl( InstrumentProxy instrumentProxy ) 52 { 53 m_instrumentProxy = instrumentProxy; 54 } 55 56 59 65 public boolean isConfigured() 66 { 67 return m_instrumentProxy.isConfigured(); 68 } 69 70 76 public boolean isRegistered() 77 { 78 return m_instrumentProxy.isRegistered(); 79 } 80 81 89 public String getName() 90 { 91 return m_instrumentProxy.getName(); 92 } 93 94 99 public String getDescription() 100 { 101 return m_instrumentProxy.getDescription(); 102 } 103 104 112 public int getType() 113 { 114 return m_instrumentProxy.getType(); 115 } 116 117 124 public InstrumentableDescriptor getInstrumentableDescriptor() 125 { 126 return m_instrumentProxy.getInstrumentableProxy().getDescriptor(); 127 } 128 129 139 public void addCounterInstrumentListener( CounterInstrumentListener listener ) 140 { 141 m_instrumentProxy.addCounterInstrumentListener( listener ); 142 } 143 144 154 public void removeCounterInstrumentListener( CounterInstrumentListener listener ) 155 { 156 m_instrumentProxy.removeCounterInstrumentListener( listener ); 157 } 158 159 169 public void addValueInstrumentListener( ValueInstrumentListener listener ) 170 { 171 m_instrumentProxy.addValueInstrumentListener( listener ); 172 } 173 174 184 public void removeValueInstrumentListener( ValueInstrumentListener listener ) 185 { 186 m_instrumentProxy.removeValueInstrumentListener( listener ); 187 } 188 189 199 public InstrumentSampleDescriptor getInstrumentSampleDescriptor( String instrumentSampleName ) 200 throws NoSuchInstrumentSampleException 201 { 202 InstrumentSample instrumentSample = 203 m_instrumentProxy.getInstrumentSample( instrumentSampleName ); 204 if ( instrumentSample == null ) 205 { 206 throw new NoSuchInstrumentSampleException( 207 "No instrument sample can be found using name: " + instrumentSampleName ); 208 } 209 210 return instrumentSample.getDescriptor(); 211 } 212 213 235 public InstrumentSampleDescriptor createInstrumentSample( String sampleDescription, 236 long sampleInterval, 237 int sampleSize, 238 long sampleLease, 239 int sampleType ) 240 { 241 InstrumentSample sample = m_instrumentProxy.createInstrumentSample( 242 sampleDescription, sampleInterval, sampleSize, sampleLease, sampleType ); 243 return sample.getDescriptor(); 244 } 245 246 253 public InstrumentSampleDescriptor[] getInstrumentSampleDescriptors() 254 { 255 return m_instrumentProxy.getInstrumentSampleDescriptors(); 256 } 257 258 267 public int getStateVersion() 268 { 269 return m_instrumentProxy.getStateVersion(); 270 } 271 } 272 | Popular Tags |