Package org.eclipse.sisu.wire
Class GlueLoader
java.lang.Object
java.lang.ClassLoader
org.eclipse.sisu.wire.GlueLoader
Weak cache of
ClassLoader
s that can generate proxy classes on-demand.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<Integer,
GlueLoader> private static final String
private static final String
private static final String
private static final Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static GlueLoader
createGlue
(ClassLoader parent) Returns newGlueLoader
that delegates to the givenClassLoader
.static <T> T
dynamicGlue
(com.google.inject.TypeLiteral<T> type, javax.inject.Provider<T> provider) Generates a new dynamic proxy instance for the given facade type and provider.private static Class<?>
dynamicGlue
(Class<?> facade) Loads the dynamic proxy class for the given facade class.protected Class<?>
private static GlueLoader
glue
(ClassLoader parent) Returns theGlueLoader
associated with the givenClassLoader
.protected Class<?>
private static String
Unwraps the proxy decoration from around the given class name.private static String
Wraps the given class name with the appropriate proxy decoration.Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
SYSTEM_LOADER_LOCK
-
PROVIDER_NAME
-
GLUE_SUFFIX
- See Also:
-
DYNAMIC
- See Also:
-
cachedGlue
-
-
Constructor Details
-
GlueLoader
GlueLoader() -
GlueLoader
GlueLoader(ClassLoader parent)
-
-
Method Details
-
dynamicGlue
public static <T> T dynamicGlue(com.google.inject.TypeLiteral<T> type, javax.inject.Provider<T> provider) Generates a new dynamic proxy instance for the given facade type and provider.- Parameters:
type
- The facade typeprovider
- The provider- Returns:
- Generated proxy instance
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findClass
- Overrides:
findClass
in classClassLoader
- Throws:
ClassNotFoundException
-
dynamicGlue
Loads the dynamic proxy class for the given facade class.- Throws:
ClassNotFoundException
-
wrap
Wraps the given class name with the appropriate proxy decoration. -
unwrap
Unwraps the proxy decoration from around the given class name. -
glue
Returns theGlueLoader
associated with the givenClassLoader
. -
createGlue
Returns newGlueLoader
that delegates to the givenClassLoader
.
-