org.eclipse.core.runtime.internal.stats
Class StatsManager

java.lang.Object
  extended by org.eclipse.core.runtime.internal.stats.StatsManager
All Implemented Interfaces:
HookConfigurator, ClassLoadingStatsHook, BundleWatcher

public class StatsManager
extends java.lang.Object
implements BundleWatcher, HookConfigurator, ClassLoadingStatsHook


Field Summary
static java.lang.String FRAMEWORK_SYMBOLICNAME
           
static boolean MONITOR_ACTIVATION
           
static boolean MONITOR_CLASSES
           
static boolean MONITOR_RESOURCES
           
static boolean TRACE_BUNDLES
           
static boolean TRACE_CLASSES
           
static java.lang.String TRACE_FILENAME
           
static java.lang.String TRACE_FILTERS
           
 
Fields inherited from interface org.eclipse.osgi.framework.adaptor.BundleWatcher
END_ACTIVATION, END_DEACTIVATION, END_INSTALLING, END_UNINSTALLING, START_ACTIVATION, START_DEACTIVATION, START_INSTALLING, START_UNINSTALLING
 
Constructor Summary
StatsManager()
           
 
Method Summary
 void addHooks(HookRegistry hookRegistry)
          Adds hooks to the specified hook registry.
static void doneBooting()
           
 void endActivation(Bundle symbolicName)
           
 BundleStats findBundle(java.lang.String symbolicName, long id)
           
static java.lang.String[] getArrayFromList(java.lang.String prop)
          Returns the result of converting a list of comma-separated tokens into an array
 BundleStats getBundle(long id)
           
 BundleStats[] getBundles()
           
static StatsManager getDefault()
           
static boolean isBooting()
           
 void postFindLocalClass(java.lang.String name, java.lang.Class clazz, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalClass(String) after searching the local classloader for a class.
 void postFindLocalResource(java.lang.String name, java.net.URL resource, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalResource(String) after searching the local classloader for a resource.
 void preFindLocalClass(java.lang.String name, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalClass(String) before searching the local classloader for a class.
 void preFindLocalResource(java.lang.String name, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalResource(String) before searching the local classloader for a resource.
 void recordClassDefine(java.lang.String name, java.lang.Class clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager)
          Gets called by a classpath manager after a successfully defining a class.
static void setDebugOptions()
           
 void startActivation(Bundle bundle)
           
 void watchBundle(Bundle bundle, int type)
          Receives notification that a lifecycle change is going to start or has ended.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONITOR_ACTIVATION

public static boolean MONITOR_ACTIVATION

MONITOR_CLASSES

public static boolean MONITOR_CLASSES

MONITOR_RESOURCES

public static boolean MONITOR_RESOURCES

TRACE_FILENAME

public static java.lang.String TRACE_FILENAME

TRACE_FILTERS

public static java.lang.String TRACE_FILTERS

TRACE_CLASSES

public static boolean TRACE_CLASSES

TRACE_BUNDLES

public static boolean TRACE_BUNDLES

FRAMEWORK_SYMBOLICNAME

public static final java.lang.String FRAMEWORK_SYMBOLICNAME
See Also:
Constant Field Values
Constructor Detail

StatsManager

public StatsManager()
Method Detail

getDefault

public static StatsManager getDefault()

setDebugOptions

public static void setDebugOptions()

doneBooting

public static void doneBooting()

isBooting

public static boolean isBooting()

getArrayFromList

public static java.lang.String[] getArrayFromList(java.lang.String prop)
Returns the result of converting a list of comma-separated tokens into an array

Parameters:
prop - the initial comma-separated string
Returns:
the array of string tokens

watchBundle

public void watchBundle(Bundle bundle,
                        int type)
Description copied from interface: BundleWatcher
Receives notification that a lifecycle change is going to start or has ended.

Specified by:
watchBundle in interface BundleWatcher
Parameters:
bundle - the bundle for which the lifecycle change is occurring on.
type - the type of lifecycle change which is occurring.
See Also:
BundleWatcher.START_INSTALLING, BundleWatcher.END_INSTALLING, BundleWatcher.START_ACTIVATION, BundleWatcher.END_ACTIVATION, BundleWatcher.START_DEACTIVATION, BundleWatcher.END_DEACTIVATION, BundleWatcher.START_UNINSTALLING, BundleWatcher.END_UNINSTALLING

startActivation

public void startActivation(Bundle bundle)

endActivation

public void endActivation(Bundle symbolicName)

findBundle

public BundleStats findBundle(java.lang.String symbolicName,
                              long id)

getBundles

public BundleStats[] getBundles()

getBundle

public BundleStats getBundle(long id)

preFindLocalClass

public void preFindLocalClass(java.lang.String name,
                              ClasspathManager manager)
                       throws java.lang.ClassNotFoundException
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during ClasspathManager.findLocalClass(String) before searching the local classloader for a class. A classpath manager will call this method for each configured class loading stat hook.

Specified by:
preFindLocalClass in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested class
manager - the classpath manager used to find and load the requested class
Throws:
java.lang.ClassNotFoundException - to prevent the requested class from loading

postFindLocalClass

public void postFindLocalClass(java.lang.String name,
                               java.lang.Class clazz,
                               ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during ClasspathManager.findLocalClass(String) after searching the local classloader for a class. A classpath manager will call this method for each configured class loading stat hook.

Specified by:
postFindLocalClass in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested class
clazz - the loaded class or null if not found
manager - the classpath manager used to find and load the requested class

preFindLocalResource

public void preFindLocalResource(java.lang.String name,
                                 ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during ClasspathManager.findLocalResource(String) before searching the local classloader for a resource. A classpath manager will call this method for each configured class loading stat hook.

Specified by:
preFindLocalResource in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested resource
manager - the classpath manager used to find the requested resource

postFindLocalResource

public void postFindLocalResource(java.lang.String name,
                                  java.net.URL resource,
                                  ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during ClasspathManager.findLocalResource(String) after searching the local classloader for a resource. A classpath manager will call this method for each configured class loading stat hook.

Specified by:
postFindLocalResource in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested resource
resource - the URL to the requested resource or null if not found
manager - the classpath manager used to find the requested resource

recordClassDefine

public void recordClassDefine(java.lang.String name,
                              java.lang.Class clazz,
                              byte[] classbytes,
                              ClasspathEntry classpathEntry,
                              BundleEntry entry,
                              ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager after a successfully defining a class. This method allows a class loading stat hook to record data about a class definition.

Specified by:
recordClassDefine in interface ClassLoadingStatsHook
Parameters:
name - the name of the class that got defined
clazz - the class object that got defined
classbytes - the class bytes used to define the class
classpathEntry - the ClasspathEntry where the class bytes got read from
entry - the BundleEntyr source of the class bytes
manager - the classpath manager used to define the class

addHooks

public void addHooks(HookRegistry hookRegistry)
Description copied from interface: HookConfigurator
Adds hooks to the specified hook registry.

Specified by:
addHooks in interface HookConfigurator
Parameters:
hookRegistry - the hook registry used to add hooks