|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjodd.proxetta.Proxetta
public class Proxetta
Proxetta creates dynamic proxy classes in the run-time.
To wrap a class with proxy Proxetta needs a target class (or its name or InputStream
)
and one or more proxy aspects
that will be applied to target.
Proxetta will examine target class and check if there are any methods to wrap, as defined by aspects pointcut.
If there is at least one matched method, new proxy class will be created that extends target class.
If no matching method founded, Proxetta may or may not create an empty proxy class. This behaviour is defined by forced mode during creation.
Field Summary | |
---|---|
protected ProxyAspect[] |
aspects
|
protected java.lang.ClassLoader |
classLoader
|
protected boolean |
forced
|
protected boolean |
variableClassName
|
Constructor Summary | |
---|---|
Proxetta(ProxyAspect... aspects)
|
Method Summary | ||
---|---|---|
Proxetta |
constantClassName()
Sets constant proxy class name so each time created proxy class will have the same name. |
|
protected ProxettaCreator |
createProxettaCreator()
Creates ProxettaCreator with current options. |
|
byte[] |
createProxy(java.lang.Class target)
Generates proxy bytecode for provided class. |
|
byte[] |
createProxy(java.io.InputStream in)
Generates proxy bytecode for class provided as InputStream . |
|
protected byte[] |
createProxy(ProxettaCreator pc)
Returns byte array of invoked proxetta creator. |
|
byte[] |
createProxy(java.lang.String targetName)
Generates proxy bytecode for provided class. |
|
|
createProxyInstance(java.lang.Class<T> target)
|
|
java.lang.Object |
createProxyInstance(java.lang.String targetName)
|
|
java.lang.Class |
defineProxy(java.lang.Class target)
Defines new proxy class. |
|
java.lang.Class |
defineProxy(java.lang.String targetName)
Defines new proxy class. |
|
Proxetta |
forced(boolean forced)
Specifies 'forced' mode. |
|
Proxetta |
loadsWith(java.lang.ClassLoader classLoader)
Specifies classloaders for use. |
|
Proxetta |
variableClassName()
Sets variable proxy class name so every time when new proxy class is created its name will be different, so one classloader may load it without a problem. |
|
static Proxetta |
withAspects(ProxyAspect... aspects)
Specifies aspects for the target and creates Proxetta instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final ProxyAspect[] aspects
protected boolean forced
protected java.lang.ClassLoader classLoader
protected boolean variableClassName
Constructor Detail |
---|
public Proxetta(ProxyAspect... aspects)
Method Detail |
---|
public static Proxetta withAspects(ProxyAspect... aspects)
public Proxetta forced(boolean forced)
true
, new proxy class will be created even if there are no
matching pointcuts. If false
, new proxy class will be created only if there is at least one
matching pointcut - otherwise, original class will be returned.
public Proxetta loadsWith(java.lang.ClassLoader classLoader)
public Proxetta variableClassName()
public Proxetta constantClassName()
protected ProxettaCreator createProxettaCreator()
ProxettaCreator
with current options.
public byte[] createProxy(java.lang.Class target)
null
if
there was no matching pointcuts and forced mode is off.
public byte[] createProxy(java.lang.String targetName)
null
if
there was no matching pointcuts and forced mode is off.
public byte[] createProxy(java.io.InputStream in)
InputStream
. Returns null
if
there was no matching pointcuts and forced mode is off.
protected byte[] createProxy(ProxettaCreator pc)
public java.lang.Class defineProxy(java.lang.Class target)
public java.lang.Class defineProxy(java.lang.String targetName)
public <T> T createProxyInstance(java.lang.Class<T> target)
public java.lang.Object createProxyInstance(java.lang.String targetName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |