Class DynamicGlue

java.lang.Object
org.eclipse.sisu.wire.DynamicGlue

final class DynamicGlue extends Object
Utility methods for generating dynamic Provider-based proxies.
  • Field Details

    • PROVIDER_NAME

      private static final String PROVIDER_NAME
    • PROVIDER_DESC

      private static final String PROVIDER_DESC
    • PROVIDER_HANDLE

      private static final String PROVIDER_HANDLE
      See Also:
    • OBJECT_NAME

      private static final String OBJECT_NAME
    • OBJECT_DESC

      private static final String OBJECT_DESC
    • ILLEGAL_STATE_NAME

      private static final String ILLEGAL_STATE_NAME
    • OBJECT_METHOD_MAP

      private static final Map<String,Method> OBJECT_METHOD_MAP
  • Constructor Details

    • DynamicGlue

      private DynamicGlue()
  • Method Details

    • generateProxyClass

      public static byte[] generateProxyClass(String proxyName, Class<?> facade)
      Generates a dynamic Provider-based proxy that reflects the given facade.
      Parameters:
      proxyName - The proxy name
      facade - The expected facade
      Returns:
      Generated proxy bytes
    • init

      private static void init(ClassWriter cw, String superName, String proxyName)
      Generates a constructor that accepts a Provider and stores it in an internal field.
    • wrap

      private static void wrap(ClassWriter cw, String proxyName, Method method)
      Generates a wrapper that dereferences the stored Provider and invokes the given method.
    • getInternalNames

      private static String[] getInternalNames(Class<?>... clazzes)
      Returns the internal names of the given classes.
    • getWrappableMethods

      private static Collection<Method> getWrappableMethods(Class<?> clazz)
      Returns the methods that should be wrapped for delegation in the given class.
    • isWrappable

      private static boolean isWrappable(Method method)
      Returns true if the given method should be wrapped; otherwise false.
    • signatureKey

      private static String signatureKey(Method method)
      Returns a signature-based key that identifies the given method in the current class.