T
- the type of interface to handle invocations forpublic class DynamicProxy<T> extends Object
Example:
private <T> T prepareProxy(T myInterface) {
T proxy = myInterface;
proxy = DynamicProxy.create(proxy, new LatencyEmulatorProxy
Modifier and Type | Method and Description |
---|---|
static <P,T extends P> |
create(Class<T> subjectClass,
NonDelegatorProxy<T> proxy)
Creates a dynamic proxy for all interfaces that the subject implements.
|
static <P,T extends P> |
create(Class<T> subjectClass,
NonDelegatorProxy<T> proxy,
Interfaces<T> interfaces)
Creates a dynamic proxy.
|
static <P,T extends P> |
create(T subject,
Proxy<T> proxy)
Creates a dynamic proxy for all interfaces that the subject implements.
|
static <P,T extends P> |
create(T subject,
Proxy<T> proxy,
Interfaces<T> interfaces)
Creates a dynamic proxy.
|
public static <P,T extends P> P create(T subject, Proxy<T> proxy)
P
- type of the interface to create a proxy for (It MUST BE an
interface)T
- type of the subject to catch invocations forsubject
- subject to create a proxy forproxy
- proxysubject
public static <P,T extends P> P create(T subject, Proxy<T> proxy, Interfaces<T> interfaces)
P
- type of the interface to create a proxy for (It MUST BE an
interface)T
- type of the subject to catch invocations forsubject
- subject to create a proxy forproxy
- proxyinterfaces
- the set of interfaces for the proxy to interceptsubject
public static <P,T extends P> P create(Class<T> subjectClass, NonDelegatorProxy<T> proxy)
P
- type of the interface to create a proxy for (It MUST BE an
interface)T
- type of the subject to catch invocations forsubjectClass
- subject' class to create a proxy forproxy
- proxysubject
public static <P,T extends P> P create(Class<T> subjectClass, NonDelegatorProxy<T> proxy, Interfaces<T> interfaces)
P
- type of the interface to create a proxy for (It MUST BE an
interface)T
- type of the subject to catch invocations forsubjectClass
- subject' class to create a proxy forproxy
- proxyinterfaces
- the set of interfaces for the proxy to interceptsubject
Copyright © 2015. All Rights Reserved.