|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.tools.OPP.srcgen.builder.ProxyBuilder
Builds an ozone Proxy. The code is lifted out of the proxy generator and adapted to the builder director pattern. A lot oof code changes has to do with the absence of reflection dependency in the implementation of the builder director pattern implementation. The proxy builder still depends heavily on reflection, something that could probably be dealt with. The changes we have now is a lot of String lookup functionality for classes. We'd like to support static inner classes as OzoneObjects, but where should the proxy classes be defined? Within the the proxy class of the enclosing class? If so, what if the enclosing class is not OzoneCompatible?
Nested Class Summary |
Nested classes inherited from class org.ozoneDB.tools.OPP.srcgen.ClassBuilder |
ClassBuilder.Parameter |
Field Summary | |
private boolean |
cache
|
private java.lang.String |
className
|
private java.lang.Class |
implementationClass
|
private MessageWriter |
msgWriter
|
private OutputStreamFactory |
osFactory
|
private java.io.PrintWriter |
out
|
private java.lang.String |
postfix
|
private boolean |
printStackTrace
|
private java.lang.String |
proxyClassName
|
private java.util.Collection |
remoteInterfaces
|
private java.lang.reflect.Method[] |
sortedMethods
|
Constructor Summary | |
ProxyBuilder(OutputStreamFactory osFactory,
java.lang.String postfix,
boolean printStackTrace,
boolean cache,
MessageWriter listener)
|
Method Summary | |
void |
beginClass(int modifer,
java.lang.String fullName,
java.lang.String superClass,
java.lang.String[] interfaces)
Called for each new class. |
void |
endClass()
Called at the end of each generated class. |
private java.util.Collection |
findRemoteInterfaces(java.lang.String[] interfaces)
|
private java.lang.Class |
getClassForType(java.lang.String type)
|
private int |
getMethodIndex(java.lang.String method,
ClassBuilder.Parameter[] parameters)
|
private java.lang.String[] |
getTypes(ClassBuilder.Parameter[] parameters)
|
void |
init(MessageWriter msgWriter)
Initializes the builder for each new build. |
void |
makeConstructor(int modifier,
ClassBuilder.Parameter[] parameters,
java.lang.String[] exceptions)
Called for each constructor in the current class |
private void |
makeCreateMethod(ClassBuilder.Parameter[] parameters,
java.lang.String[] exceptions)
|
private void |
makeCstr(ClassBuilder.Parameter[] parameters,
java.lang.String[] exceptions)
|
private void |
makeCtrs()
|
private void |
makeGlobalHeader(java.lang.String implementationClass)
|
private void |
makeLocalHeader(java.lang.String proxyClassName)
|
void |
makeMethod(int modifier,
java.lang.String name,
ClassBuilder.Parameter[] parameters,
java.lang.String returnType,
java.lang.String[] exceptions,
int lockLevel)
Called for each method in the current class |
private java.lang.Class[] |
parametersToClasses(ClassBuilder.Parameter[] parameters)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.PrintWriter out
private OutputStreamFactory osFactory
private java.lang.String postfix
private java.util.Collection remoteInterfaces
private boolean printStackTrace
private boolean cache
private MessageWriter msgWriter
private java.lang.String className
private java.lang.String proxyClassName
private java.lang.Class implementationClass
private java.lang.reflect.Method[] sortedMethods
Constructor Detail |
public ProxyBuilder(OutputStreamFactory osFactory, java.lang.String postfix, boolean printStackTrace, boolean cache, MessageWriter listener)
Method Detail |
private int getMethodIndex(java.lang.String method, ClassBuilder.Parameter[] parameters) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
private java.lang.Class[] parametersToClasses(ClassBuilder.Parameter[] parameters) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
private java.lang.Class getClassForType(java.lang.String type) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
private java.lang.String[] getTypes(ClassBuilder.Parameter[] parameters)
private void makeCtrs()
private void makeGlobalHeader(java.lang.String implementationClass)
private void makeLocalHeader(java.lang.String proxyClassName)
private void makeCstr(ClassBuilder.Parameter[] parameters, java.lang.String[] exceptions)
private void makeCreateMethod(ClassBuilder.Parameter[] parameters, java.lang.String[] exceptions)
private java.util.Collection findRemoteInterfaces(java.lang.String[] interfaces) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
public void init(MessageWriter msgWriter)
ClassBuilder
init
in interface ClassBuilder
msgWriter
- The writer the builder should use to report messages.public void beginClass(int modifer, java.lang.String fullName, java.lang.String superClass, java.lang.String[] interfaces) throws BuilderException
ClassBuilder
beginClass
in interface ClassBuilder
modifer
- The modifiers for this classfullName
- The full name including package path of this classsuperClass
- The full name including package pathh for this classinterfaces
- The interfaces implemented by this class
BuilderException
public void makeConstructor(int modifier, ClassBuilder.Parameter[] parameters, java.lang.String[] exceptions) throws BuilderException
ClassBuilder
makeConstructor
in interface ClassBuilder
modifier
- The modifier for this constructorparameters
- The parameters for this constructorexceptions
- The exceptions thrown by this constructor
BuilderException
public void makeMethod(int modifier, java.lang.String name, ClassBuilder.Parameter[] parameters, java.lang.String returnType, java.lang.String[] exceptions, int lockLevel) throws BuilderException
ClassBuilder
makeMethod
in interface ClassBuilder
modifier
- The modifiers for the methodname
- The name of the methodparameters
- The parameter list for the methodreturnType
- The return type of the method, use null for voidexceptions
- The exceptions thrown by the methodlockLevel
- The lock level for this method
BuilderException
public void endClass() throws BuilderException
ClassBuilder
endClass
in interface ClassBuilder
BuilderException
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |