Commit 92461ffd authored by Lionel Seinturier's avatar Lionel Seinturier

Remove UCMethod.

parent eac3bb08
......@@ -23,6 +23,7 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.objectweb.fractal.api.Component;
......@@ -31,7 +32,6 @@ import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.proxy.AbstractProxyClassGenerator;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -119,7 +119,7 @@ extends AbstractProxyClassGenerator {
@Override
public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
/*
* Regiqter the request context and get the content instance which
......@@ -137,7 +137,7 @@ extends AbstractProxyClassGenerator {
@Override
public void generateProxyMethodBodyAfterCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
// End of the try block
mv.visitln(" }");
......@@ -145,7 +145,7 @@ extends AbstractProxyClassGenerator {
// Release the content instance
mv.visit(" releaseContent(impl,");
if( proxym.method.getAnnotation(EndsConversation.class) == null ) {
if( proxym.getAnnotation(EndsConversation.class) == null ) {
mv.visit("false");
}
else {
......@@ -157,7 +157,7 @@ extends AbstractProxyClassGenerator {
mv.visitln(" }");
}
public String getDelegatingInstance( UClass proxycl, UCMethod proxym ) {
public String getDelegatingInstance( UClass proxycl, Method proxym ) {
return "impl";
}
}
......@@ -24,6 +24,7 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.oasisopen.sca.ServiceReference;
......@@ -32,7 +33,6 @@ import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.TypeGeneratorItf;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.helper.ClassHelper;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -127,7 +127,7 @@ extends ServerInterfaceClassGenerator {
@Override
public void generateProxyMethod(
ClassSourceCodeVisitor cv, UClass proxycl, UCMethod proxym ) {
ClassSourceCodeVisitor cv, UClass proxycl, Method proxym ) {
/*
* Indeed nothing.
* Proxy methods are inherited from the component server interface
......
......@@ -23,8 +23,9 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.reflect.Method;
import org.objectweb.fractal.juliac.helper.ClassHelper;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -46,22 +47,22 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
}
@Override
public String getDelegatingInstance( UClass proxycl, UCMethod proxym ) {
public String getDelegatingInstance( UClass proxycl, Method proxym ) {
return "impl";
}
@Override
public void generateProxyMethodBodyDelegatingCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
String rtypename = proxym.getGenericReturnType();
String rtypename = UClass.getGenericReturnType(proxym);
if( rtypename.equals("void") ) {
mv.visitln(" ijp.proceed();");
mv.visitln(" Object ret = null;");
}
else {
Class<?> rtype = proxym.method.getReturnType();
Class<?> rtype = proxym.getReturnType();
if( rtype.isPrimitive() ) {
mv.visitln(" Object proceed = ijp.proceed();");
mv.visit (" ");
......
......@@ -24,12 +24,13 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.reflect.Method;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.helper.ClassHelper;
import org.objectweb.fractal.juliac.proxy.AbstractInterceptorSourceCodeGenerator;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.osoa.sca.annotations.EndsConversation;
......@@ -94,7 +95,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override
public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
/*
* Regiqter the request context and get the content instance which
......@@ -119,7 +120,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override
public void generateProxyMethodBodyFinallyCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
// End of the try block
mv.visitln(" }");
......@@ -127,7 +128,7 @@ extends AbstractInterceptorSourceCodeGenerator {
// Release the content instance
mv.visit(" releaseContent(impl,");
if( proxym.method.getAnnotation(EndsConversation.class) == null ) {
if( proxym.getAnnotation(EndsConversation.class) == null ) {
mv.visit("false");
}
else {
......
......@@ -24,6 +24,7 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.objectweb.fractal.api.Interface;
......@@ -31,8 +32,8 @@ import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.helper.ClassHelper;
import org.objectweb.fractal.juliac.helper.MethodHelper;
import org.objectweb.fractal.juliac.proxy.AbstractInterceptorSourceCodeGenerator;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -94,7 +95,7 @@ extends AbstractInterceptorSourceCodeGenerator {
* Initialize the METHODS field (declared below in method
* generateFields).
*/
UCMethod[] proxymethods = proxycl.getMethods();
Method[] proxymethods = proxycl.cl.getMethods();
BlockSourceCodeVisitor bv = cv.visitStaticPart();
if( proxymethods.length > 0 ) {
bv.visitln(" try {");
......@@ -105,9 +106,9 @@ extends AbstractInterceptorSourceCodeGenerator {
String proxyclname = proxycl.toString(proxycl.cl);
for (int i = 0; i < proxymethods.length; i++) {
UCMethod proxym = proxymethods[i];
Method proxym = proxymethods[i];
String proxymname = proxym.getName();
Class<?>[] paramtypes = proxym.method.getParameterTypes();
Class<?>[] paramtypes = proxym.getParameterTypes();
bv.visit(" ");
bv.visit(proxyclname);
......@@ -264,16 +265,16 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override
public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
/*
* Retrieve the index of proxym in the array of methods for proxycl.
*/
int idx = -1;
String proxymstring = proxym.toString();
UCMethod[] ums = proxycl.getMethods();
Method[] ums = proxycl.cl.getMethods();
for (int i = 0; i < ums.length; i++) {
UCMethod um = ums[i];
Method um = ums[i];
String umstring = um.toString();
if( umstring.equals(proxymstring) ) {
idx = i;
......@@ -302,9 +303,9 @@ extends AbstractInterceptorSourceCodeGenerator {
* instance and directly call the delegate.
*/
String proxymname = proxym.getName();
Class<?>[] ptypes = proxym.method.getParameterTypes();
String rtypename = proxym.getGenericReturnType();
String[] tpnames = proxym.getTypeParameterNames();
Class<?>[] ptypes = proxym.getParameterTypes();
String rtypename = UClass.getGenericReturnType(proxym);
String[] tpnames = MethodHelper.getTypeParameterNames(proxym);
mv.visitln(" if( handlers.size() == 0 ) {");
......@@ -381,7 +382,7 @@ extends AbstractInterceptorSourceCodeGenerator {
@Override
public void generateProxyMethodBodyFinallyCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
// End of else block
mv.visitln(" }");
......@@ -391,7 +392,7 @@ extends AbstractInterceptorSourceCodeGenerator {
mv.visitln(" catch( Throwable t ) {");
// Handle exceptions thrown by the method
Class<?>[] excepts = proxym.method.getExceptionTypes();
Class<?>[] excepts = proxym.getExceptionTypes();
for (Class<?> except : excepts) {
mv.visit (" if( t instanceof ");
mv.visit (except.getName());
......
......@@ -24,6 +24,7 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import org.oasisopen.sca.annotation.Callback;
......@@ -40,7 +41,6 @@ import org.objectweb.fractal.juliac.helper.InterfaceTypeHelper;
import org.objectweb.fractal.juliac.helper.MethodHelper;
import org.objectweb.fractal.juliac.ipf.AnnotationHelper;
import org.objectweb.fractal.juliac.proxy.AbstractProxyClassGenerator;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.ucf.UnifiedClassHelper;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
......@@ -185,14 +185,14 @@ extends AbstractProxyClassGenerator {
@Override
public void generateProxyMethodBodyBeforeCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
super.generateProxyMethodBodyBeforeCode(mv,proxycl,proxym);
conversationalItf = proxycl.cl.getAnnotation(Conversational.class);
oneWayMeth =
MethodHelper.getAnnotation(
proxym.method,
proxym,
OneWay.class.getName(),
"org.osoa.sca.annotations.OneWay");
......@@ -208,7 +208,7 @@ extends AbstractProxyClassGenerator {
// OneWay method
if( oneWayMeth != null ) {
Class<?> rtype = proxym.method.getReturnType();
Class<?> rtype = proxym.getReturnType();
if( ! rtype.getName().equals("void") ) {
final String msg =
"@OneWay annotated method "+proxym.toString()+" in "+
......@@ -259,11 +259,11 @@ extends AbstractProxyClassGenerator {
@Override
public void generateProxyMethodBodyAfterCode(
BlockSourceCodeVisitor mv, UClass proxycl, UCMethod proxym ) {
BlockSourceCodeVisitor mv, UClass proxycl, Method proxym ) {
super.generateProxyMethodBodyAfterCode(mv,proxycl,proxym);
EndsConversation end = proxym.method.getAnnotation(EndsConversation.class);
EndsConversation end = proxym.getAnnotation(EndsConversation.class);
if( end != null ) {
if( conversationalItf == null ) {
/*
......@@ -289,7 +289,7 @@ extends AbstractProxyClassGenerator {
}
}
public String getDelegatingInstance( UClass proxycl, UCMethod proxym ) {
public String getDelegatingInstance( UClass proxycl, Method proxym ) {
return "service";
}
}
......@@ -23,7 +23,8 @@
package org.ow2.frascati.tinfi.opt.oo.light;
import org.objectweb.fractal.juliac.ucf.UCMethod;
import java.lang.reflect.Method;
import org.objectweb.fractal.juliac.ucf.UClass;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -65,7 +66,7 @@ extends org.objectweb.fractal.juliac.proxy.InterceptorClassGenerator {
}
@Override
public String getDelegatingInstance( UClass proxycl, UCMethod proxym ) {
public String getDelegatingInstance( UClass proxycl, Method proxym ) {
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