org.apache.avalon.excalibur.profile
Interface Profilable
- public interface Profilable
The Profilable interface is to mark objects that can be sampled by a Profiler.
The interface provides a method to initialize the profiler, plus two methods
to provide an optimization cue for the object (when it is safe not to track
events).
- Author:
- Berin Loritsch
Method Summary |
Profilable[] |
getChildProfilables()
The Profiler will recursively call this method until it receives an
EMPTY_PROFILABLE_ARRAY. |
ProfilePoint[] |
getProfilePoints()
Obtain a reference to all the ProfilePoints that the Profilable
object wishes to expose. |
void |
startProfiling()
The Profiler will call this method when it begins taking samples. |
void |
stopProfiling()
The Profiler will call this method when it no longer is interested
in taking samples. |
EMPTY_PROFILABLE_ARRAY
public static final Profilable[] EMPTY_PROFILABLE_ARRAY
- Empty Profilable array for use in hierarchical Profilable systems.
getProfilePoints
public ProfilePoint[] getProfilePoints()
- Obtain a reference to all the ProfilePoints that the Profilable
object wishes to expose. All sampling is done directly through
the ProfilePoints as opposed to the Profilable interface.
startProfiling
public void startProfiling()
- The Profiler will call this method when it begins taking samples.
This is an optimization cue to the Profilable class. It does take
resources to hold ProfilePoints and update them. A class may keep
a
boolean
to flag whether the ProfilePoints are to be
maintained.
stopProfiling
public void stopProfiling()
- The Profiler will call this method when it no longer is interested
in taking samples. It is an optimization cue to the Profilable
class so that it can release resources and stop maintaining the
ProfilePoints.
getChildProfilables
public Profilable[] getChildProfilables()
- The Profiler will recursively call this method until it receives an
EMPTY_PROFILABLE_ARRAY. This method should never return null.
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.