1 50 package org.apache.excalibur.instrument.manager; 51 52 import org.apache.excalibur.instrument.manager.interfaces.InstrumentSampleDescriptor; 53 import org.apache.excalibur.instrument.manager.interfaces.NoSuchInstrumentSampleException; 54 55 63 public class InstrumentDescriptorLocalImpl 64 implements InstrumentDescriptorLocal 65 { 66 67 private InstrumentProxy m_instrumentProxy; 68 69 72 77 InstrumentDescriptorLocalImpl( InstrumentProxy instrumentProxy ) 78 { 79 m_instrumentProxy = instrumentProxy; 80 } 81 82 85 91 public boolean isConfigured() 92 { 93 return m_instrumentProxy.isConfigured(); 94 } 95 96 102 public boolean isRegistered() 103 { 104 return m_instrumentProxy.isRegistered(); 105 } 106 107 115 public String getName() 116 { 117 return m_instrumentProxy.getName(); 118 } 119 120 125 public String getDescription() 126 { 127 return m_instrumentProxy.getDescription(); 128 } 129 130 138 public int getType() 139 { 140 return m_instrumentProxy.getType(); 141 } 142 143 153 public InstrumentSampleDescriptor getInstrumentSampleDescriptor( String instrumentSampleName ) 154 throws NoSuchInstrumentSampleException 155 { 156 return getInstrumentSampleDescriptorLocal( instrumentSampleName ); 157 } 158 159 181 public InstrumentSampleDescriptor createInstrumentSample( String sampleDescription, 182 long sampleInterval, 183 int sampleSize, 184 long sampleLease, 185 int sampleType ) 186 { 187 return createInstrumentSampleLocal( 188 sampleDescription, sampleInterval, sampleSize, sampleLease, sampleType ); 189 } 190 191 198 public InstrumentSampleDescriptor[] getInstrumentSampleDescriptors() 199 { 200 return getInstrumentSampleDescriptorLocals(); 201 } 202 203 204 213 public int getStateVersion() 214 { 215 return m_instrumentProxy.getStateVersion(); 216 } 217 218 221 231 public void addCounterInstrumentListener( CounterInstrumentListener listener ) 232 { 233 m_instrumentProxy.addCounterInstrumentListener( listener ); 234 } 235 236 246 public void removeCounterInstrumentListener( CounterInstrumentListener listener ) 247 { 248 m_instrumentProxy.removeCounterInstrumentListener( listener ); 249 } 250 251 261 public void addValueInstrumentListener( ValueInstrumentListener listener ) 262 { 263 m_instrumentProxy.addValueInstrumentListener( listener ); 264 } 265 266 276 public void removeValueInstrumentListener( ValueInstrumentListener listener ) 277 { 278 m_instrumentProxy.removeValueInstrumentListener( listener ); 279 } 280 281 291 public InstrumentSampleDescriptorLocal getInstrumentSampleDescriptorLocal( 292 String instrumentSampleName ) 293 throws NoSuchInstrumentSampleException 294 { 295 InstrumentSample instrumentSample = 296 m_instrumentProxy.getInstrumentSample( instrumentSampleName ); 297 if ( instrumentSample == null ) 298 { 299 throw new NoSuchInstrumentSampleException( 300 "No instrument sample can be found using name: " + instrumentSampleName ); 301 } 302 303 return instrumentSample.getDescriptor(); 304 } 305 306 328 public InstrumentSampleDescriptorLocal createInstrumentSampleLocal( String sampleDescription, 329 long sampleInterval, 330 int sampleSize, 331 long sampleLease, 332 int sampleType ) 333 { 334 InstrumentSample sample = m_instrumentProxy.createInstrumentSample( 335 sampleDescription, sampleInterval, sampleSize, sampleLease, sampleType ); 336 return sample.getDescriptor(); 337 } 338 339 346 public InstrumentSampleDescriptorLocal[] getInstrumentSampleDescriptorLocals() 347 { 348 return m_instrumentProxy.getInstrumentSampleDescriptors(); 349 } 350 } 351 | Popular Tags |