The proxy class for class A is as follows:
public class A implements Proxy, Serializable {
private ObjectImporter importer;
private int objectId;
public int _getObjectId() { return objectId; }
public A(ObjectImporter oi, int id) {
importer = oi; objectId = id;
}
... the same methods that the original class A declares ...
}
Instances of the proxy class is created by an
ObjectImporter object.
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private ClassPool | |
| private CtClass[] | |
| private static final String | |
| private static final String | |
| private CtMethod | |
| private CtMethod | |
| private CtClass[] | |
| private Map | |
| private CtClass[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | isProxyClass(String
a fully-qualified class name name)Returns |
| public synchronized boolean | Returns: false if the proxy class
has been already produced.the class referenced
through the proxy class. clazz)Makes a proxy class. |
| private void | |
| public void | onLoad(ClassPool
the pool, String ClassPool that this translator
should use.the name of the class being loaded. classname)Implements javassist. Does nothing. |
| private CtClass | |
| public void | start(ClassPool
the pool)ClassPool that this translator
should use.Implements javassist. Initializes the object. |
| private CtClass | |
| private CtClass[] |
| accessorObjectId | back to summary |
|---|---|
| private static final String accessorObjectId | |
| classPool | back to summary |
|---|---|
| private ClassPool classPool | |
| exceptionForProxy | back to summary |
|---|---|
| private CtClass[] exceptionForProxy | |
| fieldImporter | back to summary |
|---|---|
| private static final String fieldImporter | |
| fieldObjectId | back to summary |
|---|---|
| private static final String fieldObjectId | |
| forwardMethod | back to summary |
|---|---|
| private CtMethod forwardMethod | |
| forwardStaticMethod | back to summary |
|---|---|
| private CtMethod forwardStaticMethod | |
| interfacesForProxy | back to summary |
|---|---|
| private CtClass[] interfacesForProxy | |
| proxyClasses | back to summary |
|---|---|
| private Map<String, CtClass> proxyClasses | |
| proxyConstructorParamTypes | back to summary |
|---|---|
| private CtClass[] proxyConstructorParamTypes | |
| sampleClass | back to summary |
|---|---|
| private static final String sampleClass | |
| StubGenerator | back to summary |
|---|---|
| public StubGenerator() Constructs a stub-code generator. | |
| addMethods | back to summary |
|---|---|
| private void addMethods(CtClass proxy, Method[] ms) throws CannotCompileException, NotFoundException | |
| isProxyClass | back to summary |
|---|---|
| public boolean isProxyClass(String name) Returns
| |
| makeProxyClass | back to summary |
|---|---|
| public synchronized boolean makeProxyClass(Class<?> clazz) throws CannotCompileException, NotFoundException Makes a proxy class. The produced class is substituted for the original class.
| |
| modifySuperclass | back to summary |
|---|---|
| private void modifySuperclass(CtClass orgclass) throws CannotCompileException, NotFoundException Adds a default constructor to the super classes. | |
| onLoad | back to summary |
|---|---|
| public void onLoad(ClassPool pool, String classname) Implements javassist. Does nothing. This is a method declared in javassist.Translator.
| |
| produceProxyClass | back to summary |
|---|---|
| private CtClass produceProxyClass(CtClass orgclass, Class<?> orgRtClass) throws CannotCompileException, NotFoundException | |
| start | back to summary |
|---|---|
| public void start(ClassPool pool) throws NotFoundException Implements javassist. Initializes the object. This is a method declared in javassist.Translator.
| |
| toCtClass | back to summary |
|---|---|
| private CtClass toCtClass(Class<?> rtclass) throws NotFoundException | |
| toCtClass | back to summary |
|---|---|
| private CtClass[] toCtClass(Class<?>[] rtclasses) throws NotFoundException | |