public class HelperManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
HelperManager.LifecycleDetails
a record of a specific helper class tracking the number of installed rules which reference it
and referencing a table detailing the lifecycle methods it implements
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ACTIVATED_NAME
name of method invoked when helper installed count transitions from 0 to positive
|
private static java.lang.Class[] |
ACTIVATED_SIGNATURE
param types of method invoked when helper installed count transitions from 0 to positive
|
private static java.lang.String |
DEACTIVATED_NAME
name of method invoked when helper installed count transitions from positive to 0
|
private static java.lang.Class[] |
DEACTIVATED_SIGNATURE
param types of method invoked when helper installed count transitions from positive to 0
|
private java.util.concurrent.ConcurrentHashMap<java.lang.Class<?>,HelperManager.LifecycleDetails> |
helperDetailsMap
a hashmap from helper classes to their corresponding helper details.
|
private java.lang.instrument.Instrumentation |
inst
the instrumentation object used to install the transformer.
|
private static java.lang.String |
INSTALLED_NAME
name of method invoked when rule is installed for a given helper
|
private static java.lang.Class[] |
INSTALLED_RULE_SIGNATURE
param types of method invoked when rule is installed for a given helper
|
private static java.lang.Class[] |
INSTALLED_STRING_SIGNATURE
param types of method invoked when rule is installed for a given helper
|
private static java.lang.String |
UNINSTALLED_NAME
name of method invoked when rule is uninstalled for a given helper
|
private static java.lang.Class[] |
UNINSTALLED_RULE_SIGNATURE
param types of method invoked when rule is uninstalled for a given helper
|
private static java.lang.Class[] |
UNINSTALLED_STRING_SIGNATURE
param types of method invoked when rule is uninstalled for a given helper
|
Constructor and Description |
---|
HelperManager(java.lang.instrument.Instrumentation inst)
construct a manager
|
Modifier and Type | Method and Description |
---|---|
private HelperManager.LifecycleDetails |
getDetails(java.lang.Class<?> helperClass,
boolean createIfAbsent)
lookup or create a record describing the lifecycle methods of a helper class.
|
void |
installed(Rule rule) |
private java.lang.reflect.Method |
lookupLifecycleMethod(java.lang.Class<?> clazz,
java.lang.String name,
java.lang.Class<?>[] paramTypes)
return a static public method with the given parameter types it exists otherwise null
|
private void |
purgeDetails(HelperManager.LifecycleDetails details)
purge the details describing the lifecycle methods of a helper class.
|
void |
uninstalled(Rule rule) |
private java.lang.instrument.Instrumentation inst
private java.util.concurrent.ConcurrentHashMap<java.lang.Class<?>,HelperManager.LifecycleDetails> helperDetailsMap
private static final java.lang.String ACTIVATED_NAME
private static final java.lang.String DEACTIVATED_NAME
private static final java.lang.String INSTALLED_NAME
private static final java.lang.String UNINSTALLED_NAME
private static final java.lang.Class[] ACTIVATED_SIGNATURE
private static final java.lang.Class[] DEACTIVATED_SIGNATURE
private static final java.lang.Class[] INSTALLED_RULE_SIGNATURE
private static final java.lang.Class[] UNINSTALLED_RULE_SIGNATURE
private static final java.lang.Class[] INSTALLED_STRING_SIGNATURE
private static final java.lang.Class[] UNINSTALLED_STRING_SIGNATURE
public HelperManager(java.lang.instrument.Instrumentation inst)
inst
- will be non-null ifpublic void installed(Rule rule)
public void uninstalled(Rule rule)
private HelperManager.LifecycleDetails getDetails(java.lang.Class<?> helperClass, boolean createIfAbsent)
helperClass
- createIfAbsent
- if the details are not present and this is true then create and install new detailsprivate java.lang.reflect.Method lookupLifecycleMethod(java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>[] paramTypes)
name
- paramTypes
- private void purgeDetails(HelperManager.LifecycleDetails details)
details
-