|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springsource.loaded.TypeRegistry
public class TypeRegistry
The type registry tracks all reloadable types loaded by a specific class loader. It is configurable via a springloaded.properties file (which it will discover as resources through the classloader) or directly via a configure(Properties) method call.
| Field Summary | |
|---|---|
boolean |
directlyDefineTypes
Controls if the registry will define types or will allow the caller (possibly a transformer running under an agent) to define it. |
java.util.Map<java.lang.String,java.util.Set<ReloadableType>> |
jdkProxiesForInterface
|
static java.lang.String |
Key_ExcludedLoaders
|
static java.lang.String |
Key_Exclusions
|
static java.lang.String |
Key_Inclusions
|
static java.lang.String |
Key_Profile
|
static java.lang.String |
Key_ReloadableRebase
|
static int |
nextFreeRegistryId
|
static boolean |
nothingReloaded
|
| Method Summary | |
|---|---|
ReloadableType |
addType(java.lang.String dottedname,
byte[] initialbytes)
Add a type to the registry. |
static java.lang.Object |
ccheck(int ids,
java.lang.String descriptor)
|
void |
checkChildClassLoader(ReloadableType currentlyDefining)
To avoid leaking permgen we want to periodically discard the child classloader and recreate a new one. |
void |
configure(java.util.Properties properties)
Configure this TypeRegistry using a specific set of properties - this will override any previous configuration. |
void |
ensureConfigured()
Configure (if not already done) this TypeRegistry by locating springloaded.properties (through a findResources call) then loading it then processing any directives within it. |
void |
fireReloadEvent(ReloadableType reloadableType,
java.lang.String versionsuffix)
|
boolean |
fireUnableToReloadEvent(ReloadableType reloadableType,
TypeDelta td,
java.lang.String versionsuffix)
|
ChildClassLoader |
getChildClassLoader()
|
java.lang.Class<?> |
getClass_ClassInfo()
|
java.lang.Class<?> |
getClass_GroovySystem()
|
java.lang.ClassLoader |
getClassLoader()
|
TypeDescriptor |
getDescriptorFor(java.lang.String slashedname)
|
TypeDescriptor |
getDescriptorForReloadableType(java.lang.String slashedname)
Only checks the reloadable types this registry knows about, it doesn't search beyond that. |
java.util.List<TypePattern> |
getExclusionPatterns()
|
TypeDescriptorExtractor |
getExtractor()
|
java.lang.reflect.Field |
getField_ClassInfo_cachedClassRef()
|
int |
getId()
|
java.util.List<TypePattern> |
getInclusionPatterns()
|
java.util.Set<ReloadableType> |
getJDKProxiesFor(java.lang.String slashedInterfaceTypeName)
|
TypeDescriptor |
getLatestDescriptorFor(java.lang.String slashedname)
|
java.lang.reflect.Method |
getMethod_ClassInfo_getClassInfo()
|
TypeRegistry |
getParentRegistry()
|
java.util.Map<java.lang.String,java.lang.String> |
getRebasePaths()
|
ReloadableType |
getReloadableSuperType(java.lang.String slashedClassname)
|
ReloadableType |
getReloadableType(java.lang.Class<?> clazz)
|
ReloadableType |
getReloadableType(int typeId)
|
static ReloadableType |
getReloadableType(int typeRegistryId,
int typeId)
This method discovers the reloadable type instance for the registry and type id specified. |
ReloadableType |
getReloadableType(java.lang.String slashedClassname)
Determine the reloadabletype object representation for a specified class. |
ReloadableType |
getReloadableType(java.lang.String slashedClassname,
boolean allocateIdIfNotYetLoaded)
Find the ReloadableType object for a given classname. |
ReloadableType[] |
getReloadableTypes()
|
int |
getTypeIdFor(java.lang.String slashname,
boolean allocateIfNotFound)
Lookup the type ID for a string. |
static TypeRegistry |
getTypeRegistryFor(java.lang.ClassLoader classloader)
Factory access method for obtaining TypeRegistry instances. |
static boolean |
iincheck(int ids,
java.lang.String nameAndDescriptor)
Determine if something has changed in a particular type related to a particular descriptor and so the dispatcher interface should be used. |
static boolean |
instanceFieldInterceptionRequired(int ids,
java.lang.String name)
Called for a field operation - trying to determine whether a particular field needs special handling. |
static java.lang.Object |
invokespecialSearch(ReloadableType rt,
java.lang.String nameAndDescriptor)
|
static __DynamicallyDispatchable |
ispcheck(int ids,
java.lang.String nameAndDescriptor)
|
boolean |
isReloadableTypeName(java.lang.String slashedName)
|
boolean |
isReloadableTypeName(java.lang.String slashedName,
java.security.ProtectionDomain protectionDomain,
byte[] bytes)
Determine if the type specified is a reloadable type. |
boolean |
isResolved(java.lang.Class<?> clazz)
|
static java.lang.Object |
istcheck(int ids,
java.lang.String nameAndDescriptor)
Determine if something has changed in a particular type related to a particular descriptor and so the dispatcher interface should be used. |
static boolean |
ivicheck(int ids,
java.lang.String nameAndDescriptor)
Used in code the generated code replaces invokevirtual calls. |
void |
loadNewVersion(ReloadableType rtype,
java.io.File file)
|
byte[] |
methodCallRewrite(byte[] bytes)
Rewrite the call sites in some class in the context of this registry (which knows about a particular set of types as being Reloadable). |
byte[] |
methodCallRewriteUseCacheIfAvailable(java.lang.String slashedClassName,
byte[] bytes)
This version will attempt to use a cache if one is being managed. |
void |
monitorForUpdates(ReloadableType rtype,
java.lang.String externalForm)
|
static void |
reinitialize()
|
void |
rememberReloadableType(int typeId,
ReloadableType rtype)
Sometimes we discover the reloadabletype during program execution, for example A calls B and we haven't yet seen B. |
static void |
resetAllConfiguration()
|
void |
resetConfiguration()
|
void |
setShouldDefineClasses(boolean should)
|
boolean |
shouldDefineClasses()
|
boolean |
shouldRerunStaticInitializer(ReloadableType reloadableType,
java.lang.String versionsuffix)
|
static boolean |
staticFieldInterceptionRequired(int ids,
java.lang.String name)
Called for a field operation - trying to determine whether a particular field needs special handling. |
java.lang.String |
toString()
|
static boolean |
typeRegistryExistsForId(int typeRegistryId)
Check if a type registry exists for a specific type registry ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static boolean nothingReloaded
public static final java.lang.String Key_ExcludedLoaders
public static final java.lang.String Key_Inclusions
public static final java.lang.String Key_Exclusions
public static final java.lang.String Key_ReloadableRebase
public static final java.lang.String Key_Profile
public static int nextFreeRegistryId
public boolean directlyDefineTypes
public java.util.Map<java.lang.String,java.util.Set<ReloadableType>> jdkProxiesForInterface
| Method Detail |
|---|
public static void reinitialize()
public static boolean typeRegistryExistsForId(int typeRegistryId)
typeRegistryId - the ID of a type registry
public static TypeRegistry getTypeRegistryFor(java.lang.ClassLoader classloader)
public TypeDescriptor getDescriptorForReloadableType(java.lang.String slashedname)
public TypeDescriptor getDescriptorFor(java.lang.String slashedname)
public TypeDescriptor getLatestDescriptorFor(java.lang.String slashedname)
public void ensureConfigured()
public void configure(java.util.Properties properties)
properties - the properties to use to configure this type registrypublic void resetConfiguration()
public static void resetAllConfiguration()
public java.util.List<TypePattern> getInclusionPatterns()
public java.util.List<TypePattern> getExclusionPatterns()
public boolean isReloadableTypeName(java.lang.String slashedName)
public boolean isReloadableTypeName(java.lang.String slashedName,
java.security.ProtectionDomain protectionDomain,
byte[] bytes)
slashedName - the type name, eg. a/b/c/D
public int getTypeIdFor(java.lang.String slashname,
boolean allocateIfNotFound)
slashname - the slashed type name, eg. a/b/c/DallocateIfNotFound - determines whether an id should be allocated for the type if it cannot be found
public byte[] methodCallRewrite(byte[] bytes)
public byte[] methodCallRewriteUseCacheIfAvailable(java.lang.String slashedClassName,
byte[] bytes)
public void loadNewVersion(ReloadableType rtype,
java.io.File file)
public java.lang.ClassLoader getClassLoader()
public int getId()
public ReloadableType addType(java.lang.String dottedname,
byte[] initialbytes)
dottedtypename - type name of the form a.b.c.Dinitialbytes - the first version of the bytes as loaded
public ReloadableType getReloadableType(int typeId)
public void rememberReloadableType(int typeId,
ReloadableType rtype)
public ReloadableType getReloadableType(java.lang.String slashedClassname)
public ReloadableType getReloadableSuperType(java.lang.String slashedClassname)
public ReloadableType getReloadableType(java.lang.String slashedClassname,
boolean allocateIdIfNotYetLoaded)
slashedClassname - allocateIdIfNotYetLoaded -
public TypeDescriptorExtractor getExtractor()
public java.util.Map<java.lang.String,java.lang.String> getRebasePaths()
public boolean shouldDefineClasses()
public void setShouldDefineClasses(boolean should)
public static java.lang.Object istcheck(int ids,
java.lang.String nameAndDescriptor)
public static java.lang.Object invokespecialSearch(ReloadableType rt,
java.lang.String nameAndDescriptor)
public static __DynamicallyDispatchable ispcheck(int ids,
java.lang.String nameAndDescriptor)
public static java.lang.Object ccheck(int ids,
java.lang.String descriptor)
public static boolean iincheck(int ids,
java.lang.String nameAndDescriptor)
Methods on interfaces cannot really 'change' - the visibility is always public and they are never static. This means everything that the descriptor embodies everything about a method interface. Therefore, if something changes about the descriptor it is considered an entirely different method (and the old form is a deleted method). For this reason there is no need to consider 'changed' methods, because the static-ness nor visibility cannot change.
public static boolean instanceFieldInterceptionRequired(int ids,
java.lang.String name)
public static boolean staticFieldInterceptionRequired(int ids,
java.lang.String name)
public static boolean ivicheck(int ids,
java.lang.String nameAndDescriptor)
public static ReloadableType getReloadableType(int typeRegistryId,
int typeId)
public java.lang.String toString()
toString in class java.lang.Object
public void monitorForUpdates(ReloadableType rtype,
java.lang.String externalForm)
public boolean shouldRerunStaticInitializer(ReloadableType reloadableType,
java.lang.String versionsuffix)
public void fireReloadEvent(ReloadableType reloadableType,
java.lang.String versionsuffix)
public boolean fireUnableToReloadEvent(ReloadableType reloadableType,
TypeDelta td,
java.lang.String versionsuffix)
public java.lang.Class<?> getClass_GroovySystem()
public java.lang.Class<?> getClass_ClassInfo()
public java.lang.reflect.Method getMethod_ClassInfo_getClassInfo()
public java.lang.reflect.Field getField_ClassInfo_cachedClassRef()
public void checkChildClassLoader(ReloadableType currentlyDefining)
public ChildClassLoader getChildClassLoader()
public boolean isResolved(java.lang.Class<?> clazz)
public ReloadableType getReloadableType(java.lang.Class<?> clazz)
public TypeRegistry getParentRegistry()
public ReloadableType[] getReloadableTypes()
public java.util.Set<ReloadableType> getJDKProxiesFor(java.lang.String slashedInterfaceTypeName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||