org.apache.cocoon.webservices.instrument
Class InstrumentationServiceImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.webservices.instrument.InstrumentationServiceImpl
All Implemented Interfaces:
Component, LogEnabled, InstrumentationService, InstrumentManageable

public final class InstrumentationServiceImpl
extends AbstractLogEnabled
implements InstrumentationService

Implementation of InstrumentationService component. This component allows you to access sample information from the InstrumentManager.

Version:
$Id: InstrumentationServiceImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Marcus Crafter

Field Summary
 
Fields inherited from interface org.apache.cocoon.webservices.instrument.InstrumentationService
ROLE
 
Constructor Summary
InstrumentationServiceImpl()
           
 
Method Summary
 String[] getSampleNames()
          Obtain a list of available samples, useful for browsing available samples.
 int[] getSampleSnapshot(String path)
          Obtain an array of samples from a specified sample name.
 void setInstrumentManager(InstrumentManager iManager)
          Sets the InstrumentManager for this service object.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstrumentationServiceImpl

public InstrumentationServiceImpl()
Method Detail

setInstrumentManager

public void setInstrumentManager(InstrumentManager iManager)
Sets the InstrumentManager for this service object.

Specified by:
setInstrumentManager in interface InstrumentManageable
Parameters:
iManager - an InstrumentManager instance

getSampleSnapshot

public int[] getSampleSnapshot(String path)
                        throws Exception
Obtain an array of samples from a specified sample name.

The specified path parameter identifies a sample, hierarchically from Instrumentable name to Instrument name, to Instrument sample name (including any child Instrumentables) using the '.' character as a separator.

  eg: instrument-manager.active-thread-count.maximum_1000_600
 

The above example identifies the sample 'maximum_1000_600' on instrument 'active-thread-count', on instrumentable 'instrument-manager'.

The length of the returned array is dependant on the configuration of the sample being accessed. Check instrumentation.xconf for the length of pre- defined samples that operate constantly, when instrumentation is enabled.

Specified by:
getSampleSnapshot in interface InstrumentationService
Parameters:
path - path value
Returns:
an int[] array of samples
Throws:
Exception - if an error occurs

getSampleNames

public String[] getSampleNames()
Obtain a list of available samples, useful for browsing available samples.

Specified by:
getSampleNames in interface InstrumentationService
Returns:
an String[] array of sample names


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.