Commit 43753251 authored by Lionel Seinturier's avatar Lionel Seinturier

Refactor AbstractProxyClassGenerator as a class generator.

parent e8277db3
...@@ -93,9 +93,9 @@ extends AbstractProxyClassGenerator { ...@@ -93,9 +93,9 @@ extends AbstractProxyClassGenerator {
} }
@Override @Override
public void generateConstructors( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateConstructors( ClassSourceCodeVisitor cv ) {
super.generateConstructors(cv, proxycl); super.generateConstructors(cv);
// public constructor() // public constructor()
BlockSourceCodeVisitor mv = BlockSourceCodeVisitor mv =
...@@ -118,7 +118,7 @@ extends AbstractProxyClassGenerator { ...@@ -118,7 +118,7 @@ extends AbstractProxyClassGenerator {
@Override @Override
public void generateProxyMethodBodyBeforeCode( public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
/* /*
* Regiqter the request context and get the content instance which * Regiqter the request context and get the content instance which
...@@ -136,7 +136,7 @@ extends AbstractProxyClassGenerator { ...@@ -136,7 +136,7 @@ extends AbstractProxyClassGenerator {
@Override @Override
public void generateProxyMethodBodyAfterCode( public void generateProxyMethodBodyAfterCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
// End of the try block // End of the try block
mv.visitln(" }"); mv.visitln(" }");
...@@ -156,7 +156,7 @@ extends AbstractProxyClassGenerator { ...@@ -156,7 +156,7 @@ extends AbstractProxyClassGenerator {
mv.visitln(" }"); mv.visitln(" }");
} }
public String getDelegatingInstance( Class<?> proxycl, Method proxym ) { public String getDelegatingInstance( Method proxym ) {
return "impl"; return "impl";
} }
} }
...@@ -103,9 +103,9 @@ extends ServerInterfaceClassGenerator { ...@@ -103,9 +103,9 @@ extends ServerInterfaceClassGenerator {
} }
@Override @Override
public void generateMethods( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethods( ClassSourceCodeVisitor cv ) {
super.generateMethods(cv, proxycl); super.generateMethods(cv);
BlockSourceCodeVisitor mv = BlockSourceCodeVisitor mv =
cv.visitMethod( cv.visitMethod(
...@@ -126,7 +126,7 @@ extends ServerInterfaceClassGenerator { ...@@ -126,7 +126,7 @@ extends ServerInterfaceClassGenerator {
@Override @Override
public void generateProxyMethod( public void generateProxyMethod(
ClassSourceCodeVisitor cv, Class<?> proxycl, Method proxym ) { ClassSourceCodeVisitor cv, Method proxym ) {
/* /*
* Indeed nothing. * Indeed nothing.
* Proxy methods are inherited from the component server interface * Proxy methods are inherited from the component server interface
......
...@@ -47,13 +47,13 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -47,13 +47,13 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
} }
@Override @Override
public String getDelegatingInstance( Class<?> proxycl, Method proxym ) { public String getDelegatingInstance( Method proxym ) {
return "impl"; return "impl";
} }
@Override @Override
public void generateProxyMethodBodyDelegatingCode( public void generateProxyMethodBodyDelegatingCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
String rtypename = UClass.getGenericReturnType(proxym,proxycl); String rtypename = UClass.getGenericReturnType(proxym,proxycl);
...@@ -93,7 +93,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -93,7 +93,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
* @since 1.1.1 * @since 1.1.1
*/ */
@Override @Override
public void generateFieldImpl( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateFieldImpl( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the impl field is inherited from * The implementation of the impl field is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
...@@ -104,7 +104,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -104,7 +104,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
* @since 1.1.1 * @since 1.1.1
*/ */
@Override @Override
public void generateMethodGetFcItfDelegate( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethodGetFcItfDelegate( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the getFcItfDelegate method is inherited from * The implementation of the getFcItfDelegate method is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
...@@ -115,7 +115,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -115,7 +115,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
* @since 1.1.1 * @since 1.1.1
*/ */
@Override @Override
public void generateMethodSetFcItfDelegate( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethodSetFcItfDelegate( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the setFcItfDelegate method is inherited from * The implementation of the setFcItfDelegate method is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
......
...@@ -93,7 +93,7 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -93,7 +93,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override @Override
public void generateProxyMethodBodyBeforeCode( public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
/* /*
* Regiqter the request context and get the content instance which * Regiqter the request context and get the content instance which
...@@ -118,7 +118,7 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -118,7 +118,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override @Override
public void generateProxyMethodBodyFinallyCode( public void generateProxyMethodBodyFinallyCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
// End of the try block // End of the try block
mv.visitln(" }"); mv.visitln(" }");
......
...@@ -88,7 +88,7 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -88,7 +88,7 @@ extends AbstractInterceptorSourceCodeGenerator {
} }
@Override @Override
public void generateStaticParts( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateStaticParts( ClassSourceCodeVisitor cv ) {
/* /*
* Initialize the METHODS field (declared below in method * Initialize the METHODS field (declared below in method
...@@ -137,7 +137,7 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -137,7 +137,7 @@ extends AbstractInterceptorSourceCodeGenerator {
} }
@Override @Override
public void generateFields( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateFields( ClassSourceCodeVisitor cv ) {
/* /*
* Generate a METHODS field to store the array of component methods * Generate a METHODS field to store the array of component methods
...@@ -254,18 +254,18 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -254,18 +254,18 @@ extends AbstractInterceptorSourceCodeGenerator {
} }
@Override @Override
public void generateMethodInitFcController( BlockSourceCodeVisitor mv, Class<?> proxycl ) { public void generateMethodInitFcController( BlockSourceCodeVisitor mv ) {
mv.visitln(" initIntentHandlersMap(METHODS);"); mv.visitln(" initIntentHandlersMap(METHODS);");
} }
@Override @Override
public void generateMethodClone( BlockSourceCodeVisitor mv, Class<?> proxycl ) { public void generateMethodClone( BlockSourceCodeVisitor mv ) {
mv.visitln(" clone.initIntentHandlersMap(METHODS);"); mv.visitln(" clone.initIntentHandlersMap(METHODS);");
} }
@Override @Override
public void generateProxyMethodBodyBeforeCode( public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
/* /*
* Retrieve the index of proxym in the array of methods for proxycl. * Retrieve the index of proxym in the array of methods for proxycl.
...@@ -382,7 +382,7 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -382,7 +382,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override @Override
public void generateProxyMethodBodyFinallyCode( public void generateProxyMethodBodyFinallyCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
// End of else block // End of else block
mv.visitln(" }"); mv.visitln(" }");
......
...@@ -99,12 +99,12 @@ extends AbstractInterceptorSourceCodeGenerator { ...@@ -99,12 +99,12 @@ extends AbstractInterceptorSourceCodeGenerator {
} }
@Override @Override
public void generateMethodInitFcController( BlockSourceCodeVisitor mv, Class<?> proxycl ) { public void generateMethodInitFcController( BlockSourceCodeVisitor mv ) {
mv.visitIns("super.initFcController(ic)"); mv.visitIns("super.initFcController(ic)");
} }
@Override @Override
public void generateMethodClone( BlockSourceCodeVisitor mv, Class<?> proxycl ) { public void generateMethodClone( BlockSourceCodeVisitor mv ) {
mv.visitIns("initFcClone(clone)"); mv.visitIns("initFcClone(clone)");
} }
} }
...@@ -80,7 +80,7 @@ extends InterfaceImplementationClassGenerator { ...@@ -80,7 +80,7 @@ extends InterfaceImplementationClassGenerator {
} }
@Override @Override
public void generateFieldImpl( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateFieldImpl( ClassSourceCodeVisitor cv ) {
/* /*
* Indeed nothing. * Indeed nothing.
* The field is managed by TinfiComponentInterface. * The field is managed by TinfiComponentInterface.
...@@ -88,7 +88,7 @@ extends InterfaceImplementationClassGenerator { ...@@ -88,7 +88,7 @@ extends InterfaceImplementationClassGenerator {
} }
@Override @Override
public void generateMethodGetFcItfImpl( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethodGetFcItfImpl( ClassSourceCodeVisitor cv ) {
/* /*
* Indeed nothing. * Indeed nothing.
* The method is inherited from TinfiComponentInterface. * The method is inherited from TinfiComponentInterface.
...@@ -96,7 +96,7 @@ extends InterfaceImplementationClassGenerator { ...@@ -96,7 +96,7 @@ extends InterfaceImplementationClassGenerator {
} }
@Override @Override
public void generateMethodSetFcItfImpl( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethodSetFcItfImpl( ClassSourceCodeVisitor cv ) {
/* /*
* Indeed nothing. * Indeed nothing.
* The method is inherited from TinfiComponentInterface. * The method is inherited from TinfiComponentInterface.
......
...@@ -130,10 +130,9 @@ extends AbstractProxyClassGenerator { ...@@ -130,10 +130,9 @@ extends AbstractProxyClassGenerator {
} }
@Override @Override
public void generateConstructors( public void generateConstructors( ClassSourceCodeVisitor cv ) {
ClassSourceCodeVisitor cv, Class<?> proxycl ) {
super.generateConstructors(cv,proxycl); super.generateConstructors(cv);
/* /*
* Create the signature of the proxy interface with generic parameters * Create the signature of the proxy interface with generic parameters
...@@ -161,7 +160,7 @@ extends AbstractProxyClassGenerator { ...@@ -161,7 +160,7 @@ extends AbstractProxyClassGenerator {
* @since 1.4.1 * @since 1.4.1
*/ */
@Override @Override
public void generateMethods( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateMethods( ClassSourceCodeVisitor cv ) {
/* /*
* Override the getService method inherited from ServiceReferenceImpl. * Override the getService method inherited from ServiceReferenceImpl.
* The idea is that in generated subclasses of ServiceReferenceImpl we * The idea is that in generated subclasses of ServiceReferenceImpl we
...@@ -181,9 +180,9 @@ extends AbstractProxyClassGenerator { ...@@ -181,9 +180,9 @@ extends AbstractProxyClassGenerator {
@Override @Override
public void generateProxyMethodBodyBeforeCode( public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
super.generateProxyMethodBodyBeforeCode(mv,proxycl,proxym); super.generateProxyMethodBodyBeforeCode(mv,proxym);
conversationalItf = proxycl.getAnnotation(Conversational.class); conversationalItf = proxycl.getAnnotation(Conversational.class);
oneWayMeth = oneWayMeth =
...@@ -259,9 +258,9 @@ extends AbstractProxyClassGenerator { ...@@ -259,9 +258,9 @@ extends AbstractProxyClassGenerator {
@Override @Override
public void generateProxyMethodBodyAfterCode( public void generateProxyMethodBodyAfterCode(
BlockSourceCodeVisitor mv, Class<?> proxycl, Method proxym ) { BlockSourceCodeVisitor mv, Method proxym ) {
super.generateProxyMethodBodyAfterCode(mv,proxycl,proxym); super.generateProxyMethodBodyAfterCode(mv,proxym);
EndsConversation end = proxym.getAnnotation(EndsConversation.class); EndsConversation end = proxym.getAnnotation(EndsConversation.class);
if( end != null ) { if( end != null ) {
...@@ -289,7 +288,7 @@ extends AbstractProxyClassGenerator { ...@@ -289,7 +288,7 @@ extends AbstractProxyClassGenerator {
} }
} }
public String getDelegatingInstance( Class<?> proxycl, Method proxym ) { public String getDelegatingInstance( Method proxym ) {
return "service"; return "service";
} }
} }
...@@ -41,7 +41,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -41,7 +41,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
public InterceptorNoIntentClassGenerator() {} public InterceptorNoIntentClassGenerator() {}
@Override @Override
public void generateFieldImpl( ClassSourceCodeVisitor cv, Class<?> proxycl ) { public void generateFieldImpl( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the impl field is inherited from * The implementation of the impl field is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
...@@ -49,7 +49,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -49,7 +49,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
} }
@Override @Override
public void generateMethodGetFcItfDelegate(ClassSourceCodeVisitor cv, Class<?> proxycl) { public void generateMethodGetFcItfDelegate( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the getFcItfDelegate method is inherited from * The implementation of the getFcItfDelegate method is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
...@@ -57,7 +57,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -57,7 +57,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
} }
@Override @Override
public void generateMethodSetFcItfDelegate(ClassSourceCodeVisitor cv, Class<?> proxycl) { public void generateMethodSetFcItfDelegate( ClassSourceCodeVisitor cv ) {
/* /*
* The implementation of the setFcItfDelegate method is inherited from * The implementation of the setFcItfDelegate method is inherited from
* TinfiComponentInterceptor. * TinfiComponentInterceptor.
...@@ -65,7 +65,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator { ...@@ -65,7 +65,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
} }
@Override @Override
public String getDelegatingInstance( Class<?> proxycl, Method proxym ) { public String getDelegatingInstance( Method proxym ) {
return "impl"; return "impl";
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment