Class RuntimeSupport


  • public class RuntimeSupport
    extends java.lang.Object
    Runtime support routines that the classes generated by ProxyFactory use.
    See Also:
    ProxyFactory
    • Constructor Summary

      Constructors 
      Constructor Description
      RuntimeSupport()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void find2Methods​(java.lang.Class<?> clazz, java.lang.String superMethod, java.lang.String thisMethod, int index, java.lang.String desc, java.lang.reflect.Method[] methods)
      Finds two methods specified by the parameters and stores them into the given array.
      static void find2Methods​(java.lang.Object self, java.lang.String superMethod, java.lang.String thisMethod, int index, java.lang.String desc, java.lang.reflect.Method[] methods)
      static java.lang.reflect.Method findMethod​(java.lang.Class<?> clazz, java.lang.String name, java.lang.String desc)
      Finds a method with the given name and descriptor.
      static java.lang.reflect.Method findMethod​(java.lang.Object self, java.lang.String name, java.lang.String desc)
      Deprecated.
      static java.lang.reflect.Method findSuperClassMethod​(java.lang.Class<?> clazz, java.lang.String name, java.lang.String desc)
      Finds a method that has the given name and descriptor and is declared in the super class.
      static java.lang.reflect.Method findSuperMethod​(java.lang.Object self, java.lang.String name, java.lang.String desc)
      Finds a method that has the given name and descriptor and is declared in the super class.
      static java.lang.String makeDescriptor​(java.lang.Class<?>[] params, java.lang.Class<?> retType)
      Makes a descriptor for a given method.
      static java.lang.String makeDescriptor​(java.lang.reflect.Method m)
      Makes a descriptor for a given method.
      static java.lang.String makeDescriptor​(java.lang.String params, java.lang.Class<?> retType)
      Makes a descriptor for a given method.
      static javassist.util.proxy.SerializedProxy makeSerializedProxy​(java.lang.Object proxy)
      Converts a proxy object to an object that is writable to an object stream.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • default_interceptor

        public static MethodHandler default_interceptor
        A method handler that only executes a method.
    • Constructor Detail

      • RuntimeSupport

        public RuntimeSupport()
    • Method Detail

      • find2Methods

        public static void find2Methods​(java.lang.Class<?> clazz,
                                        java.lang.String superMethod,
                                        java.lang.String thisMethod,
                                        int index,
                                        java.lang.String desc,
                                        java.lang.reflect.Method[] methods)
        Finds two methods specified by the parameters and stores them into the given array.
        Throws:
        java.lang.RuntimeException - if the methods are not found.
        See Also:
        ProxyFactory
      • find2Methods

        @Deprecated
        public static void find2Methods​(java.lang.Object self,
                                        java.lang.String superMethod,
                                        java.lang.String thisMethod,
                                        int index,
                                        java.lang.String desc,
                                        java.lang.reflect.Method[] methods)
        Finds two methods specified by the parameters and stores them into the given array.

        Added back for JBoss Seam. See JASSIST-206.

        Throws:
        java.lang.RuntimeException - if the methods are not found.
        See Also:
        ProxyFactory
      • findMethod

        @Deprecated
        public static java.lang.reflect.Method findMethod​(java.lang.Object self,
                                                          java.lang.String name,
                                                          java.lang.String desc)
        Deprecated.
        Finds a method with the given name and descriptor. It searches only the class of self.

        Added back for JBoss Seam. See JASSIST-206.

        Throws:
        java.lang.RuntimeException - if the method is not found.
      • findMethod

        public static java.lang.reflect.Method findMethod​(java.lang.Class<?> clazz,
                                                          java.lang.String name,
                                                          java.lang.String desc)
        Finds a method with the given name and descriptor. It searches only the class of self.
        Throws:
        java.lang.RuntimeException - if the method is not found.
      • findSuperMethod

        public static java.lang.reflect.Method findSuperMethod​(java.lang.Object self,
                                                               java.lang.String name,
                                                               java.lang.String desc)
        Finds a method that has the given name and descriptor and is declared in the super class.
        Throws:
        java.lang.RuntimeException - if the method is not found.
      • findSuperClassMethod

        public static java.lang.reflect.Method findSuperClassMethod​(java.lang.Class<?> clazz,
                                                                    java.lang.String name,
                                                                    java.lang.String desc)
        Finds a method that has the given name and descriptor and is declared in the super class.
        Throws:
        java.lang.RuntimeException - if the method is not found.
      • makeDescriptor

        public static java.lang.String makeDescriptor​(java.lang.reflect.Method m)
        Makes a descriptor for a given method.
      • makeDescriptor

        public static java.lang.String makeDescriptor​(java.lang.Class<?>[] params,
                                                      java.lang.Class<?> retType)
        Makes a descriptor for a given method.
        Parameters:
        params - parameter types.
        retType - return type.
      • makeDescriptor

        public static java.lang.String makeDescriptor​(java.lang.String params,
                                                      java.lang.Class<?> retType)
        Makes a descriptor for a given method.
        Parameters:
        params - the descriptor of parameter types.
        retType - return type.
      • makeSerializedProxy

        public static javassist.util.proxy.SerializedProxy makeSerializedProxy​(java.lang.Object proxy)
                                                                        throws java.io.InvalidClassException
        Converts a proxy object to an object that is writable to an object stream. This method is called by writeReplace() in a proxy class.
        Throws:
        java.io.InvalidClassException
        Since:
        3.4