Commit e8277db3 authored by Lionel Seinturier's avatar Lionel Seinturier

Refactor to decrease the dependency to Juliac.

parent 5866647f
......@@ -131,7 +131,7 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
if( itname.endsWith("-controller") || itname.equals("component") ) {
pcg =
new InterfaceImplementationClassGenerator(
jc,it, cl, pkgRoot, membraneDesc, false );
it, cl, pkgRoot, membraneDesc, false );
}
else {
if( it.isFcClientItf() ) {
......@@ -146,12 +146,12 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
*/
pcg =
new ClientInterfaceClassGenerator(
jc,it,cl,pkgRoot,membraneDesc,false);
it,cl,pkgRoot,membraneDesc,false);
}
else {
pcg =
new ServerInterfaceClassGenerator(
jc,it,cl,pkgRoot,membraneDesc,false);
it,cl,pkgRoot,membraneDesc,false);
}
}
......@@ -184,7 +184,7 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
*/
SourceCodeGeneratorItf cg =
new InterfaceImplementationClassGenerator(
jc,it,cl,pkgRoot,null,false);
it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
else {
......@@ -195,7 +195,7 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
// Server (input) interface implementation
SourceCodeGeneratorItf cg =
new ServerInterfaceClassGenerator(jc,it,cl,pkgRoot,null,false);
new ServerInterfaceClassGenerator(it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
if( it.isFcClientItf() ) {
......@@ -206,12 +206,12 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* interface implementation corresponding to the same type.
*/
cg = new ClientInterfaceClassGenerator(
jc,it,cl,pkgRoot,null,false);
it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
// ServiceReference implementation
cg = new ServiceReferenceClassGenerator(jc,it,cl,pkgRoot,null,false);
cg = new ServiceReferenceClassGenerator(it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
// ServiceReference and input interface implementations for callbacks
......@@ -227,11 +227,11 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
new BasicInterfaceType(
"callback", cbcl.getName(), false, false, false );
cg = new ServiceReferenceClassGenerator(
jc,cbit,cbcl,pkgRoot,null,false);
cbit,cbcl,pkgRoot,null,false);
jc.generateSourceCode(cg);
cg = new CallBackInterfaceClassGenerator(
jc,cbit,cbcl,pkgRoot,null,false);
cbit,cbcl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
}
......
......@@ -29,7 +29,6 @@ import java.lang.reflect.Modifier;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.Type;
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.visit.BlockSourceCodeVisitor;
......@@ -49,10 +48,10 @@ extends AbstractProxyClassGenerator {
public CallBackInterfaceClassGenerator() {}
public CallBackInterfaceClassGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......
......@@ -29,7 +29,6 @@ import java.lang.reflect.Modifier;
import org.oasisopen.sca.ServiceReference;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
......@@ -48,10 +47,10 @@ public class ClientInterfaceClassGenerator
extends ServerInterfaceClassGenerator {
public ClientInterfaceClassGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......@@ -71,13 +70,12 @@ extends ServerInterfaceClassGenerator {
*/
SourceCodeGeneratorItf cg =
new ServerInterfaceClassGenerator(
jc,it,proxycl,pkgRoot,membraneDesc,mergeable);
it,proxycl,pkgRoot,membraneDesc,mergeable);
String name = cg.getTargetTypeName();
/*
* Add type parameters if any.
*/
Class<?> proxycl = jc.loadClass(it.getFcItfSignature());
String[] tpnames = ClassHelper.getTypeParameterNames(proxycl);
if( tpnames.length != 0 ) {
String s = ClassHelper.getTypeParameterNamesSignature(tpnames);
......@@ -116,7 +114,7 @@ extends ServerInterfaceClassGenerator {
"getServiceReference", null, null );
SourceCodeGeneratorItf cg =
new ServiceReferenceClassGenerator(
jc,it,this.proxycl,pkgRoot,membraneDesc,mergeable);
it,this.proxycl,pkgRoot,membraneDesc,mergeable);
String srclname = cg.getTargetTypeName();
mv.visit (" return new ");
mv.visit (srclname);
......
......@@ -116,7 +116,7 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
if( itname.endsWith("-controller") || itname.equals("component") ) {
pcg =
new InterfaceImplementationClassGenerator(
jc,it,cl,pkgRoot,membraneDesc,false);
it,cl,pkgRoot,membraneDesc,false);
}
else {
if( it.isFcClientItf() ) {
......@@ -131,12 +131,12 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
*/
pcg =
new ClientInterfaceClassGenerator(
jc,it,cl,pkgRoot,membraneDesc,false);
it,cl,pkgRoot,membraneDesc,false);
}
else {
pcg =
new ServerInterfaceClassGenerator(
jc,it,cl,pkgRoot,membraneDesc,false);
it,cl,pkgRoot,membraneDesc,false);
}
}
......@@ -169,7 +169,7 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
*/
SourceCodeGeneratorItf cg =
new InterfaceImplementationClassGenerator(
jc,it,cl,pkgRoot,null,false);
it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
else {
......@@ -180,7 +180,7 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
// Server (input) interface implementation
SourceCodeGeneratorItf cg =
new ServerInterfaceClassGenerator(jc,it,cl,pkgRoot,null,false);
new ServerInterfaceClassGenerator(it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
if( it.isFcClientItf() ) {
......@@ -191,13 +191,13 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
* interface implementation corresponding to the same type.
*/
cg = new ClientInterfaceClassGenerator(
jc,it,cl,pkgRoot,null,false);
it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
// ServiceReference implementation
cg = new ServiceReferenceClassGenerator(
jc,it,cl,pkgRoot,null,false);
it,cl,pkgRoot,null,false);
jc.generateSourceCode(cg);
// ServiceReference and input interface implementations for callbacks
......@@ -213,11 +213,11 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
new BasicInterfaceType(
"callback", cbcl.getName(), false, false, false );
cg = new ServiceReferenceClassGenerator(
jc,cbit,cbcl,pkgRoot,null,false);
cbit,cbcl,pkgRoot,null,false);
jc.generateSourceCode(cg);
cg = new CallBackInterfaceClassGenerator(
jc,cbit,cbcl,pkgRoot,null,false);
cbit,cbcl,pkgRoot,null,false);
jc.generateSourceCode(cg);
}
}
......
......@@ -27,7 +27,6 @@ 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.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.proxy.AbstractInterceptorSourceCodeGenerator;
......@@ -50,10 +49,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public SCAContentInterceptorSourceCodeGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......
......@@ -29,7 +29,6 @@ import java.lang.reflect.Modifier;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.UClass;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.reflect.MethodHelper;
......@@ -58,10 +57,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public SCAIntentInterceptorSourceCodeGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......
......@@ -24,7 +24,6 @@
package org.ow2.frascati.tinfi.opt.oo;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.proxy.AbstractInterceptorSourceCodeGenerator;
......@@ -46,10 +45,10 @@ extends AbstractInterceptorSourceCodeGenerator {
}
public SCATinfiInterceptorSourceCodeGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......
......@@ -25,7 +25,6 @@
package org.ow2.frascati.tinfi.opt.oo;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.proxy.InterfaceImplementationClassGenerator;
......@@ -44,10 +43,10 @@ public class ServerInterfaceClassGenerator
extends InterfaceImplementationClassGenerator {
public ServerInterfaceClassGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......
......@@ -33,7 +33,6 @@ import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.julia.ComponentInterface;
import org.objectweb.fractal.julia.type.BasicInterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.UClass;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
......@@ -62,10 +61,10 @@ extends AbstractProxyClassGenerator {
public ServiceReferenceClassGenerator() {}
public ServiceReferenceClassGenerator(
Juliac jc, InterfaceType it, Class<?> cl, String pkgRoot,
InterfaceType it, Class<?> cl, String pkgRoot,
MembraneDesc<?> membraneDesc, boolean mergeable ) {
super(jc,it,cl,pkgRoot,membraneDesc,mergeable);
super(it,cl,pkgRoot,membraneDesc,mergeable);
}
/**
......@@ -231,12 +230,12 @@ extends AbstractProxyClassGenerator {
"callback",callbackClass.getName(),false,false,false);
SourceCodeGeneratorItf cg =
new CallBackInterfaceClassGenerator(
jc,cbit,callbackClass,pkgRoot,null,mergeable);
cbit,callbackClass,pkgRoot,null,mergeable);
String cbitfclname = cg.getTargetTypeName();
cg =
new ServiceReferenceClassGenerator(
jc,cbit,callbackClass,pkgRoot,null,mergeable);
cbit,callbackClass,pkgRoot,null,mergeable);
String cbcrclname = cg.getTargetTypeName();
mv.visit (" "+ComponentInterface.class.getName()+" ci = (");
......
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