public static enum AgentBuilder.DescriptionStrategy.Default extends Enum<AgentBuilder.DescriptionStrategy.Default> implements AgentBuilder.DescriptionStrategy
AgentBuilder.DescriptionStrategy
.Modifier and Type | Class and Description |
---|---|
protected static class |
AgentBuilder.DescriptionStrategy.Default.LazyTypeDescriptionWithEagerProperties
A type description that lazily resolves a instance of
AgentBuilder.DescriptionStrategy.Default.LazyTypeDescriptionWithEagerProperties . |
protected static class |
AgentBuilder.DescriptionStrategy.Default.TypeDescriptionWithFallbackProperties
A type description that falls back to a
TypePool description if the type's declared types,
fields or methods cannot be resolved successfully. |
AgentBuilder.DescriptionStrategy.Default
Enum Constant and Description |
---|
HYBRID
A description type strategy represents a type as a
TypeDescription.ForLoadedType if a
retransformation or redefinition is applied on a type. |
POOL_FIRST
|
POOL_LAST
A description strategy that attempts to describe a type using its loaded
Class representation if available. |
POOL_LAST_DEFERRED
A description strategy that applies the same resolution as
POOL_LAST but only resolves the actual
TypeDescription if any property that cannot be derived by the type name is accessed. |
POOL_LAST_FALLBACK
A description strategy that falls back to the type pool if a field, method or name cannot be resolved from a loaded type.
|
POOL_ONLY
A description strategy that always describes Java types using a
TypePool . |
Modifier and Type | Method and Description |
---|---|
TypeDescription |
apply(Class<?> type,
AgentBuilder.TypeLocator typeLocator,
AgentBuilder.LocationStrategy locationStrategy)
Describes the given type.
|
String |
toString() |
static AgentBuilder.DescriptionStrategy.Default |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AgentBuilder.DescriptionStrategy.Default[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
apply
public static final AgentBuilder.DescriptionStrategy.Default HYBRID
TypeDescription.ForLoadedType
if a
retransformation or redefinition is applied on a type. Using a loaded type typically results in better performance as no
I/O is required for resolving type descriptions. However, any interaction with the type is carried out via the Java reflection
API. Using the reflection API triggers eager loading of any type that is part of a method or field signature. If any of these
types are missing from the class path, this eager loading will cause a NoClassDefFoundError
. Some Java code declares
optional dependencies to other classes which are only realized if the optional dependency is present. Such code relies on the
Java reflection API not being used for types using optional dependencies.POOL_LAST
public static final AgentBuilder.DescriptionStrategy.Default POOL_ONLY
A description strategy that always describes Java types using a TypePool
. This requires that any type - even if it is already
loaded and a Class
instance is available - is processed as a non-loaded type description. Doing so can cause overhead as processing
loaded types is supported very efficiently by a JVM.
Avoiding the usage of loaded types can improve robustness as this approach does not rely on the Java reflection API which triggers eager
validation of this loaded type which can fail an application if optional types are used by any types field or method signatures. Also, it
is possible to guarantee debugging meta data to be available also for retransformed or redefined types if a AgentBuilder.TypeStrategy
specifies
the extraction of such meta data.
public static final AgentBuilder.DescriptionStrategy.Default POOL_FIRST
A description strategy that always describes Java types using a TypePool
unless a type cannot be resolved by a pool and a loaded
Class
instance is available. Doing so can cause overhead as processing loaded types is supported very efficiently by a JVM.
Avoiding the usage of loaded types can improve robustness as this approach does not rely on the Java reflection API which triggers eager
validation of this loaded type which can fail an application if optional types are used by any types field or method signatures. Also, it
is possible to guarantee debugging meta data to be available also for retransformed or redefined types if a AgentBuilder.TypeStrategy
specifies
the extraction of such meta data.
public static final AgentBuilder.DescriptionStrategy.Default POOL_LAST
Class
representation if available. If such a type
is available, it is attempted to resolve all direct properties of this type what can cause a NoClassDefFoundError
if any
signature contains an optional type. In this case, or if a loaded type is not available, a type description is resolved via the
configured TypePool
.public static final AgentBuilder.DescriptionStrategy.Default POOL_LAST_DEFERRED
POOL_LAST
but only resolves the actual
TypeDescription
if any property that cannot be derived by the type name is accessed.public static final AgentBuilder.DescriptionStrategy.Default POOL_LAST_FALLBACK
public static AgentBuilder.DescriptionStrategy.Default[] values()
for (AgentBuilder.DescriptionStrategy.Default c : AgentBuilder.DescriptionStrategy.Default.values()) System.out.println(c);
public static AgentBuilder.DescriptionStrategy.Default valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic TypeDescription apply(Class<?> type, AgentBuilder.TypeLocator typeLocator, AgentBuilder.LocationStrategy locationStrategy)
AgentBuilder.DescriptionStrategy
apply
in interface AgentBuilder.DescriptionStrategy
type
- The loaded type to be described.typeLocator
- The type locator to use.locationStrategy
- The location strategy to use.public String toString()
toString
in class Enum<AgentBuilder.DescriptionStrategy.Default>
Copyright © 2014–2016. All rights reserved.