Package javassist.tools.rmi
Class StubGenerator
java.lang.Object
javassist.tools.rmi.StubGenerator
- All Implemented Interfaces:
Translator
A stub-code generator. It is used for producing a proxy class.
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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isProxyClass
(String name) Returnstrue
if the specified class is a proxy class recorded bymakeProxyClass()
.boolean
makeProxyClass
(Class<?> clazz) Makes a proxy class.void
Does nothing.void
Initializes the object.
-
Constructor Details
-
StubGenerator
public StubGenerator()Constructs a stub-code generator.
-
-
Method Details
-
start
Initializes the object. This is a method declared in javassist.Translator.- Specified by:
start
in interfaceTranslator
- Parameters:
pool
- theClassPool
that this translator should use.- Throws:
NotFoundException
- if aCtClass
cannot be found.- See Also:
-
onLoad
Does nothing. This is a method declared in javassist.Translator.- Specified by:
onLoad
in interfaceTranslator
- Parameters:
pool
- theClassPool
that this translator should use.classname
- the name of the class being loaded.- See Also:
-
isProxyClass
Returnstrue
if the specified class is a proxy class recorded bymakeProxyClass()
.- Parameters:
name
- a fully-qualified class name
-
makeProxyClass
Makes a proxy class. The produced class is substituted for the original class.- Parameters:
clazz
- the class referenced through the proxy class.- Returns:
false
if the proxy class has been already produced.- Throws:
CannotCompileException
NotFoundException
-