java.lang.Object | |
↳ | java.lang.reflect.Proxy |
Proxy
defines methods for creating dynamic proxy classes and instances.
A proxy class implements a declared set of interfaces and delegates method
invocations to an InvocationHandler
.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
h | The invocation handler on which the method calls are dispatched. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new
Proxy instance with the specified invocation
handler.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the invocation handler of the specified proxy instance.
| |||||||||||
Returns the dynamically built
Class for the specified interfaces.
| |||||||||||
Indicates whether or not the specified class is a dynamically generated
proxy class.
| |||||||||||
Returns an instance of the dynamically built class for the specified
interfaces.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
The invocation handler on which the method calls are dispatched.
Constructs a new Proxy
instance with the specified invocation
handler.
h | the invocation handler for the newly created proxy |
---|
Returns the invocation handler of the specified proxy instance.
proxy | the proxy instance |
---|
IllegalArgumentException | if the supplied proxy is not a proxy object
|
---|
Returns the dynamically built Class
for the specified interfaces.
Creates a new Class
when necessary. The order of the interfaces
is relevant. Invocations of this method with the same interfaces but
different order result in different generated classes. The interfaces
must be visible from the supplied class loader; no duplicates are
permitted. All non-public interfaces must be defined in the same package.
loader | the class loader that will define the proxy class |
---|---|
interfaces | an array of Class objects, each one identifying an
interface that will be implemented by the returned proxy
class |
interfaces
IllegalArgumentException | if any of the interface restrictions are violated |
---|---|
NullPointerException | if either interfaces or any of its elements are
null
|
Indicates whether or not the specified class is a dynamically generated proxy class.
cl | the class |
---|
true
if the class is a proxy class, false
otherwiseNullPointerException | if the class is null
|
---|
Returns an instance of the dynamically built class for the specified interfaces. Method invocations on the returned instance are forwarded to the specified invocation handler. The interfaces must be visible from the supplied class loader; no duplicates are permitted. All non-public interfaces must be defined in the same package.
loader | the class loader that will define the proxy class |
---|---|
interfaces | an array of Class objects, each one identifying an
interface that will be implemented by the returned proxy
object |
invocationHandler | the invocation handler that handles the dispatched method invocations |
h
IllegalArgumentException | if any of the interface restrictions are violated |
---|---|
NullPointerException | if the interfaces or any of its elements are null |