|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjodd.proxetta.Proxetta
public abstract 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.
There are several options that describes how proxy class will be named. By default, proxy class name is created from target class name by adding default suffix. Suffix can be changed, also, name can be variable, so each time class is created it will have a new name.
It is also possible to set proxy simple class name and/or package name. This is useful when proxyfing JDK classes or any other that can't be loaded by some classloader. Requested proxy name can be in the following forms:
ProxettaBuilder| Field Summary | |
|---|---|
protected java.lang.ClassLoader |
classLoader
|
protected java.lang.String |
classNameSuffix
|
protected java.lang.String |
debugFolder
|
protected boolean |
forced
|
protected boolean |
variableClassName
|
| Constructor Summary | |
|---|---|
Proxetta()
|
|
| Method Summary | |
|---|---|
abstract ProxettaBuilder |
builder()
Creates ProxettaBuilder with current options. |
java.lang.ClassLoader |
getClassLoader()
|
java.lang.String |
getClassNameSuffix()
|
java.lang.String |
getDebugFolder()
|
boolean |
isForced()
|
boolean |
isVariableClassName()
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
Specifies classloaders for loading created classes.. |
void |
setClassNameSuffix(java.lang.String suffix)
Specifies custom classname suffix to be added to the class name of created proxy. |
void |
setDebugFolder(java.lang.String debugFolder)
Specifies the debug folder where all created classes will be written to, for debugging purposes. |
void |
setForced(boolean forced)
Specifies 'forced' mode. |
void |
setVariableClassName(boolean 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean forced
protected java.lang.ClassLoader classLoader
protected boolean variableClassName
protected java.lang.String classNameSuffix
protected java.lang.String debugFolder
| Constructor Detail |
|---|
public Proxetta()
| Method Detail |
|---|
public void setForced(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 boolean isForced()
public void setClassLoader(java.lang.ClassLoader classLoader)
public java.lang.ClassLoader getClassLoader()
public void setVariableClassName(boolean variableClassName)
This prevents "java.lang.LinkageError: duplicate class definition" errors.
public boolean isVariableClassName()
public void setClassNameSuffix(java.lang.String suffix)
public java.lang.String getClassNameSuffix()
public void setDebugFolder(java.lang.String debugFolder)
public java.lang.String getDebugFolder()
public abstract ProxettaBuilder builder()
ProxettaBuilder with current options.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||