Top Description Inners Fields Constructors Methods
javassist.util.proxy

public Class RuntimeSupport

extends Object
Class Inheritance
Imports
java.io.Serializable, java.lang.reflect.Method

Runtime support routines that the classes generated by ProxyFactory use.
See Also
ProxyFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
public static MethodHandler
default_interceptor

A method handler that only executes a method.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
error(Class<?> clazz, String name, String desc)

public static void
find2Methods(Class<?> clazz, String superMethod, String thisMethod, int index, String desc, Method[] methods)

Finds two methods specified by the parameters and stores them into the given array.

public static void
find2Methods(Object self, String superMethod, String thisMethod, int index, String desc, Method[] methods)

Finds two methods specified by the parameters and stores them into the given array.

public static Method
findMethod(Object self, String name, String desc)
Deprecated replaced by findMethod(Class, String, String)

Finds a method with the given name and descriptor.

public static Method
findMethod(Class<?> clazz, String name, String desc)

Finds a method with the given name and descriptor.

private static Method
findMethod2(Class<?> clazz, String name, String desc)

public static Method
findSuperClassMethod(Class<?> clazz, String name, String desc)

Finds a method that has the given name and descriptor and is declared in the super class.

public static Method
findSuperMethod(Object self, String name, String desc)

Finds a method that has the given name and descriptor and is declared in the super class.

private static Method
findSuperMethod2(Class<?> clazz, String name, String desc)

private static void
makeDesc(StringBuilder sbuf, Class<?> type)

public static String
makeDescriptor(Method m)

Makes a descriptor for a given method.

public static String
makeDescriptor(Class<?>[]
parameter types.
params
,
Class<?>
return type.
retType
)

Makes a descriptor for a given method.

public static String
makeDescriptor(String
the descriptor of parameter types.
params
,
Class<?>
return type.
retType
)

Makes a descriptor for a given method.

public static SerializedProxy
makeSerializedProxy(Object proxy)

Converts a proxy object to an object that is writable to an object stream.

private static Method
searchInterfaces(Class<?> clazz, String name, String desc)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

default_interceptorback to summary
public static MethodHandler default_interceptor

A method handler that only executes a method.

Constructor Detail

RuntimeSupportback to summary
public RuntimeSupport()

Method Detail

errorback to summary
private static void error(Class<?> clazz, String name, String desc)
find2Methodsback to summary
public static void find2Methods(Class<?> clazz, String superMethod, String thisMethod, int index, String desc, Method[] methods)

Finds two methods specified by the parameters and stores them into the given array.

Exceptions
RuntimeException:
if the methods are not found.
See Also
javassist.util.proxy.ProxyFactory
find2Methodsback to summary
public static void find2Methods(Object self, String superMethod, String thisMethod, int index, String desc, Method[] methods)

Finds two methods specified by the parameters and stores them into the given array.

Added back for JBoss Seam. See JASSIST-206.

Annotations
@Deprecated
Exceptions
RuntimeException:
if the methods are not found.
See Also
javassist.util.proxy.ProxyFactory
findMethodback to summary
public static Method findMethod(Object self, String name, String desc)

Deprecated

replaced by findMethod(Class, String, String)

Finds a method with the given name and descriptor. It searches only the class of self.

Added back for JBoss Seam. See JASSIST-206.

Annotations
@Deprecated
Exceptions
RuntimeException:
if the method is not found.
findMethodback to summary
public static Method findMethod(Class<?> clazz, String name, String desc)

Finds a method with the given name and descriptor. It searches only the class of self.

Exceptions
RuntimeException:
if the method is not found.
findMethod2back to summary
private static Method findMethod2(Class<?> clazz, String name, String desc)
findSuperClassMethodback to summary
public static Method findSuperClassMethod(Class<?> clazz, String name, String desc)

Finds a method that has the given name and descriptor and is declared in the super class.

Exceptions
RuntimeException:
if the method is not found.
findSuperMethodback to summary
public static Method findSuperMethod(Object self, String name, String desc)

Finds a method that has the given name and descriptor and is declared in the super class.

Exceptions
RuntimeException:
if the method is not found.
findSuperMethod2back to summary
private static Method findSuperMethod2(Class<?> clazz, String name, String desc)
makeDescback to summary
private static void makeDesc(StringBuilder sbuf, Class<?> type)
makeDescriptorback to summary
public static String makeDescriptor(Method m)

Makes a descriptor for a given method.

makeDescriptorback to summary
public static String makeDescriptor(Class<?>[] params, Class<?> retType)

Makes a descriptor for a given method.

Parameters
params:Class<?>[]

parameter types.

retType:Class<?>

return type.

makeDescriptorback to summary
public static String makeDescriptor(String params, Class<?> retType)

Makes a descriptor for a given method.

Parameters
params:String

the descriptor of parameter types.

retType:Class<?>

return type.

makeSerializedProxyback to summary
public static SerializedProxy makeSerializedProxy(Object proxy) throws 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.

Since
3.4
searchInterfacesback to summary
private static Method searchInterfaces(Class<?> clazz, String name, String desc)
javassist.util.proxy back to summary

pack-priv Class RuntimeSupport.DefaultMethodHandler

extends Object
implements MethodHandler, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javassist.util.proxy.MethodHandler

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

default serialVersionUID

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Object
invoke(Object
the proxy instance.
self
,
Method
the overridden method declared in the super class or interface.
m
,
Method
the forwarder method for invoking the overridden method. It is null if the overridden method is abstract or declared in the interface.
proceed
,
Object[]
an array of objects containing the values of the arguments passed in the method invocation on the proxy instance. If a parameter type is a primitive type, the type of the array element is a wrapper class.
args
)

Implements javassist.util.proxy.MethodHandler.invoke.

Is called when a method is invoked on a proxy instance associated with this handler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

default serialVersionUID

Constructor Detail

DefaultMethodHandlerback to summary
pack-priv DefaultMethodHandler()

Method Detail

invokeback to summary
public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Exception

Implements javassist.util.proxy.MethodHandler.invoke.

Doc from javassist.util.proxy.MethodHandler.invoke.

Is called when a method is invoked on a proxy instance associated with this handler. This method must process that method invocation.

Parameters
self:Object

the proxy instance.

m:Method

the overridden method declared in the super class or interface.

proceed:Method

the forwarder method for invoking the overridden method. It is null if the overridden method is abstract or declared in the interface.

args:Object[]

an array of objects containing the values of the arguments passed in the method invocation on the proxy instance. If a parameter type is a primitive type, the type of the array element is a wrapper class.

Returns:Object

the resulting value of the method invocation.

Annotations
@Override