public class StatsManager extends Object implements BundleWatcher, HookConfigurator, ClassLoadingStatsHook
Modifier and Type | Field and Description |
---|---|
static String |
FRAMEWORK_SYMBOLICNAME |
static boolean |
MONITOR_ACTIVATION |
static boolean |
MONITOR_CLASSES |
static boolean |
MONITOR_RESOURCES |
static boolean |
TRACE_BUNDLES |
static boolean |
TRACE_CLASSES |
static String |
TRACE_FILENAME |
static String |
TRACE_FILTERS |
END_ACTIVATION, END_DEACTIVATION, END_INSTALLING, END_UNINSTALLING, START_ACTIVATION, START_DEACTIVATION, START_INSTALLING, START_UNINSTALLING
Constructor and Description |
---|
StatsManager() |
Modifier and Type | Method and Description |
---|---|
void |
addHooks(HookRegistry hookRegistry)
Adds hooks to the specified hook registry.
|
static void |
doneBooting() |
void |
endActivation(Bundle symbolicName) |
BundleStats |
findBundle(String symbolicName,
long id) |
static String[] |
getArrayFromList(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(String name,
Class<?> clazz,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalClass(String) after
searching the local classloader for a class. |
void |
postFindLocalResource(String name,
URL resource,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalResource(String) after
searching the local classloader for a resource. |
void |
preFindLocalClass(String name,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalClass(String) before
searching the local classloader for a class. |
void |
preFindLocalResource(String name,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalResource(String) before
searching the local classloader for a resource. |
void |
recordClassDefine(String name,
Class<?> clazz,
byte[] classbytes,
ClasspathEntry classpathEntry,
BundleEntry entry,
ClasspathManager manager)
Gets called by a classpath manager after an attempt is made to define 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.
|
public static boolean MONITOR_ACTIVATION
public static boolean MONITOR_CLASSES
public static boolean MONITOR_RESOURCES
public static String TRACE_FILENAME
public static String TRACE_FILTERS
public static boolean TRACE_CLASSES
public static boolean TRACE_BUNDLES
public static final String FRAMEWORK_SYMBOLICNAME
public static StatsManager getDefault()
public static void setDebugOptions()
public static void doneBooting()
public static boolean isBooting()
public static String[] getArrayFromList(String prop)
prop
- the initial comma-separated stringpublic void watchBundle(Bundle bundle, int type)
BundleWatcher
watchBundle
in interface BundleWatcher
bundle
- the bundle for which the lifecycle change is occurring on.type
- the type of lifecycle change which is occurring.BundleWatcher.START_INSTALLING
,
BundleWatcher.END_INSTALLING
,
BundleWatcher.START_ACTIVATION
,
BundleWatcher.END_ACTIVATION
,
BundleWatcher.START_DEACTIVATION
,
BundleWatcher.END_DEACTIVATION
,
BundleWatcher.START_UNINSTALLING
,
BundleWatcher.END_UNINSTALLING
public void startActivation(Bundle bundle)
public void endActivation(Bundle symbolicName)
public BundleStats findBundle(String symbolicName, long id)
public BundleStats[] getBundles()
public BundleStats getBundle(long id)
public void preFindLocalClass(String name, ClasspathManager manager) throws ClassNotFoundException
ClassLoadingStatsHook
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.preFindLocalClass
in interface ClassLoadingStatsHook
name
- the name of the requested classmanager
- the classpath manager used to find and load the requested classClassNotFoundException
public void postFindLocalClass(String name, Class<?> clazz, ClasspathManager manager)
ClassLoadingStatsHook
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.postFindLocalClass
in interface ClassLoadingStatsHook
name
- the name of the requested classclazz
- the loaded class or null if not foundmanager
- the classpath manager used to find and load the requested classpublic void preFindLocalResource(String name, ClasspathManager manager)
ClassLoadingStatsHook
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.preFindLocalResource
in interface ClassLoadingStatsHook
name
- the name of the requested resourcemanager
- the classpath manager used to find the requested resourcepublic void postFindLocalResource(String name, URL resource, ClasspathManager manager)
ClassLoadingStatsHook
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.postFindLocalResource
in interface ClassLoadingStatsHook
name
- the name of the requested resourceresource
- the URL to the requested resource or null if not foundmanager
- the classpath manager used to find the requested resourcepublic void recordClassDefine(String name, Class<?> clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager)
ClassLoadingStatsHook
recordClassDefine
in interface ClassLoadingStatsHook
name
- the name of the class that got definedclazz
- the class object that got defined or null if an error occurred while defining a classclassbytes
- the class bytes used to define the classclasspathEntry
- the ClasspathEntry where the class bytes got read fromentry
- the BundleEntyr source of the class bytesmanager
- the classpath manager used to define the classpublic void addHooks(HookRegistry hookRegistry)
HookConfigurator
addHooks
in interface HookConfigurator
hookRegistry
- the hook registry used to add hooksCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.