The FragmentAtClassScope probe object

The FragmentAtClassScope probe object is a specification for the data and initialization requirements of a probe.

The FragmentAtClassScope object is optional. It can be used to include static data members, static helper functions, or any other Java construct in the probe class. For example, you can perform one-time initialization for a probe by creating a static initializer that will execute when the probe's class is loaded.

The contents of the FragmentAtClassScope object is placed in the generated source code for the probe class at class scope. That is, the contents will appear inside the generated probe class, but outside all methods.

This kind of fragment lets you insert code into the probe class that is generated by Probekit, the class that your other probe fragments are compiled into. It does not apply to instrumented (probed) classes. To insert a new static field in probed classes, see the staticField object. To insert code in a probed class that will run when the class loads, see the staticInitializer fragment type.

A probe can have only one FragmentAtClassScope object.

Example
<fragmentAtClassScope>
   static public int call_counter = 0;   
</fragmentAtClassScope>

Contained by
The Probe object

Parent topic: Probekit element reference

Related information
FragmentAtClassScope example

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.