public final class ProxyFactory extends Object
Modifier and Type | Method and Description |
---|---|
static <T> T |
create(Class<T> intf,
InvocationHandler h)
Returns an instance of a proxy class for the specified interfaces
that dispatches method invocations to the specified invocation
handler.
|
static <T> T |
create(ClassLoader loader,
Class<T> intf,
InvocationHandler h)
Returns an instance of a proxy class for the specified interfaces
that dispatches method invocations to the specified invocation
handler.
|
public static <T> T create(Class<T> intf, InvocationHandler h)
intf
- the interface for the proxy to implementh
- the invocation handler to dispatch method invocations toIllegalArgumentException
- if any of the restrictions on the
parameters that may be passed to getProxyClass
are violatedNullPointerException
- if the interfaces
array
argument or any of its elements are null
, or
if the invocation handler, h
, is
null
public static <T> T create(ClassLoader loader, Class<T> intf, InvocationHandler h)
loader
- the class loader to define the proxy classintf
- the interface for the proxy to implementh
- the invocation handler to dispatch method invocations toIllegalArgumentException
- if any of the restrictions on the
parameters that may be passed to getProxyClass
are violatedNullPointerException
- if the interfaces
array
argument or any of its elements are null
, or
if the invocation handler, h
, is
null
Copyright © 2023. All rights reserved.