Package org.eclipse.sisu.wire
Class DynamicGlue
java.lang.Object
org.eclipse.sisu.wire.DynamicGlue
Utility methods for generating dynamic
Provider
-based proxies.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
generateProxyClass
(String proxyName, Class<?> facade) Generates a dynamicProvider
-based proxy that reflects the given facade.private static String[]
getInternalNames
(Class<?>... clazzes) Returns the internal names of the given classes.private static Collection<Method>
getWrappableMethods
(Class<?> clazz) Returns the methods that should be wrapped for delegation in the given class.private static void
init
(ClassWriter cw, String superName, String proxyName) Generates a constructor that accepts aProvider
and stores it in an internal field.private static boolean
isWrappable
(Method method) Returnstrue
if the given method should be wrapped; otherwisefalse
.private static String
signatureKey
(Method method) Returns a signature-based key that identifies the given method in the current class.private static void
wrap
(ClassWriter cw, String proxyName, Method method) Generates a wrapper that dereferences the storedProvider
and invokes the given method.
-
Field Details
-
PROVIDER_NAME
-
PROVIDER_DESC
-
PROVIDER_HANDLE
- See Also:
-
OBJECT_NAME
-
OBJECT_DESC
-
ILLEGAL_STATE_NAME
-
OBJECT_METHOD_MAP
-
-
Constructor Details
-
DynamicGlue
private DynamicGlue()
-
-
Method Details
-
generateProxyClass
Generates a dynamicProvider
-based proxy that reflects the given facade.- Parameters:
proxyName
- The proxy namefacade
- The expected facade- Returns:
- Generated proxy bytes
-
init
Generates a constructor that accepts aProvider
and stores it in an internal field. -
wrap
Generates a wrapper that dereferences the storedProvider
and invokes the given method. -
getInternalNames
Returns the internal names of the given classes. -
getWrappableMethods
Returns the methods that should be wrapped for delegation in the given class. -
isWrappable
Returnstrue
if the given method should be wrapped; otherwisefalse
. -
signatureKey
Returns a signature-based key that identifies the given method in the current class.
-