Package org.eclipse.sisu.wire
Class GlueLoader
java.lang.Object
java.lang.ClassLoader
org.eclipse.sisu.wire.GlueLoader
Weak cache of
ClassLoaders that can generate proxy classes on-demand.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConcurrentMap<Integer,GlueLoader> private static final Stringprivate static final Stringprivate static final Stringprivate static final Object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static GlueLoadercreateGlue(ClassLoader parent) Returns newGlueLoaderthat delegates to the givenClassLoader.static <T> TdynamicGlue(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 GlueLoaderglue(ClassLoader parent) Returns theGlueLoaderassociated with the givenClassLoader.protected Class<?>private static StringUnwraps the proxy decoration from around the given class name.private static StringWraps 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:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
findClass
- Overrides:
findClassin 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 theGlueLoaderassociated with the givenClassLoader. -
createGlue
Returns newGlueLoaderthat delegates to the givenClassLoader.
-