|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.proxy.StubCreator<E>
public class StubCreator<E>
Helper to create stubs easily based on CGLIB.
There are several static creation methods but the StubCreator can be instantiated also. If instantiated it will cache a
prototype of a generated stub for the given type and its interfaces and creates any new instance based on this prototype
instance which is much more faster.
| Constructor Summary | |
|---|---|
StubCreator(Class<? extends E> type)
|
|
StubCreator(Class<? extends E> type,
Class<?>[] interfaces)
|
|
StubCreator(Class<? extends E> type,
Class<?>[] interfaces,
ExceptionHandler exceptionHandler)
|
|
StubCreator(Class<? extends E> type,
ExceptionHandler exceptionHandler)
|
|
| Method Summary | ||
|---|---|---|
protected static net.sf.cglib.proxy.MethodInterceptor |
adapter(MethodInvocationHandler methodInvocationHandler)
Returns a adapter which acts as MethodInterceptor for a given MethodInvocationHandler |
|
E |
build(MethodInvocationHandler methodInvocationHandler)
|
|
static
|
newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
Returns a new proxy stub for the given class or interface but takes additional interfaces. |
|
static
|
newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor,
ExceptionHandler exceptionHandler)
Returns a new proxy stub for the given class or interface but takes additional interfaces. |
|
static
|
newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
MethodInvocationHandler methodInvocationHandler)
Same as newStubInstance(Class, Class[], MethodInterceptor) but uses a MethodInvocationHandler instead. |
|
static
|
newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
MethodInvocationHandler methodInvocationHandler,
ExceptionHandler exceptionHandler)
Same as newStubInstance(Class, Class[], MethodInterceptor) but uses a MethodInvocationHandler instead. |
|
static
|
newStubInstance(Class<? extends E> clazz,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
|
|
static
|
newStubInstance(Class<? extends E> clazz,
MethodInvocationHandler methodInvocationHandler)
Returns a new proxy stub for the given class or interface. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StubCreator(Class<? extends E> type)
type - StubCreator
public StubCreator(Class<? extends E> type,
ExceptionHandler exceptionHandler)
type - exceptionHandler - StubCreator
public StubCreator(Class<? extends E> type,
Class<?>[] interfaces)
type - interfaces - StubCreator
public StubCreator(Class<? extends E> type,
Class<?>[] interfaces,
ExceptionHandler exceptionHandler)
type - interfaces - exceptionHandler - ExceptionHandlerStubCreator| Method Detail |
|---|
public E build(MethodInvocationHandler methodInvocationHandler)
methodInvocationHandler -
newStubInstance(Class, Class[], MethodInvocationHandler)
public static <E> E newStubInstance(Class<? extends E> clazz,
MethodInvocationHandler methodInvocationHandler)
E - clazz - methodInvocationHandler -
public static <E> E newStubInstance(Class<? extends E> clazz,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
clazz - methodInterceptor -
public static <E> E newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
MethodInvocationHandler methodInvocationHandler)
newStubInstance(Class, Class[], MethodInterceptor) but uses a MethodInvocationHandler instead.
E - clazz - interfaces - methodInvocationHandler -
public static <E> E newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
MethodInvocationHandler methodInvocationHandler,
ExceptionHandler exceptionHandler)
newStubInstance(Class, Class[], MethodInterceptor) but uses a MethodInvocationHandler instead.
E - clazz - interfaces - methodInvocationHandler - exceptionHandler -
protected static net.sf.cglib.proxy.MethodInterceptor adapter(MethodInvocationHandler methodInvocationHandler)
MethodInterceptor for a given MethodInvocationHandler
methodInvocationHandler -
public static <E> E newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor)
E - clazz - interfaces - methodInterceptor -
public static <E> E newStubInstance(Class<? extends E> clazz,
Class<?>[] interfaces,
net.sf.cglib.proxy.MethodInterceptor methodInterceptor,
ExceptionHandler exceptionHandler)
E - clazz - interfaces - methodInterceptor - exceptionHandler -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||