Commit bf10bec9 authored by Lionel Seinturier's avatar Lionel Seinturier

Use a typed constructor instead of the init method.

parent 156c2933
......@@ -28,8 +28,11 @@ import java.lang.annotation.Annotation;
import java.util.HashMap;
import java.util.Map;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.julia.type.BasicInterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.api.JuliacModuleItf;
import org.objectweb.fractal.juliac.api.MembraneLoaderItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
......@@ -37,7 +40,10 @@ import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.annotation.AnnotationHelper;
import org.objectweb.fractal.juliac.conf.JuliacConfig;
import org.objectweb.fractal.juliac.conf.JulietLoader;
import org.objectweb.fractal.juliac.desc.ComponentDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.desc.NoSuchControllerDescriptorException;
import org.objectweb.fractal.juliac.opt.InitializerClassGenerator;
import org.objectweb.fractal.juliac.proxy.InterfaceImplementationClassGenerator;
import org.objectweb.fractal.juliac.proxy.ProxyClassGeneratorItf;
import org.ow2.frascati.tinfi.opt.oo.CallBackInterfaceClassGenerator;
......@@ -104,8 +110,14 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* with this component source code generator.
*/
@Override
public InitializerCompCtrlClassGenerator getInitializerClassGenerator() {
return new InitializerCompCtrlClassGenerator();
protected InitializerClassGenerator<ComponentDesc>
getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<ComponentDesc> fcscg,
MembraneDesc<ComponentDesc> membraneDesc, ComponentType ct,
Object contentDesc ) {
return new InitializerCompCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
}
/**
......
......@@ -24,7 +24,12 @@
package org.ow2.frascati.tinfi.opt.comp;
import org.objectweb.fractal.api.Interface;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.desc.ComponentDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.ow2.frascati.tinfi.TinfiComponentInterceptor;
......@@ -40,6 +45,14 @@ import org.ow2.frascati.tinfi.TinfiComponentInterceptor;
public class InitializerCompCtrlClassGenerator
extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator {
public InitializerCompCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<ComponentDesc> fcscg,
MembraneDesc<ComponentDesc> membraneDesc, ComponentType ct,
Object contentDesc ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
}
@Override
protected void generateNewFcContentMethod( BlockSourceCodeVisitor mv ) {
mv.visitln(" return null;");
......
......@@ -25,15 +25,22 @@ package org.ow2.frascati.tinfi.opt.oo;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.List;
import org.oasisopen.sca.annotation.Callback;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.julia.type.BasicInterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.annotation.AnnotationHelper;
import org.objectweb.fractal.juliac.conf.JuliacConfig;
import org.objectweb.fractal.juliac.conf.JulietLoader;
import org.objectweb.fractal.juliac.desc.ControllerDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator;
import org.objectweb.fractal.juliac.proxy.InterfaceImplementationClassGenerator;
import org.objectweb.fractal.juliac.proxy.ProxyClassGeneratorItf;
......@@ -89,8 +96,13 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
* with this component source code generator.
*/
@Override
public InitializerOOCtrlClassGenerator getInitializerClassGenerator() {
return new InitializerOOCtrlClassGenerator();
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<List<ControllerDesc>> fcscg,
MembraneDesc<List<ControllerDesc>> membraneDesc, ComponentType ct,
Object contentDesc ) {
return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
}
/**
......
......@@ -23,8 +23,15 @@
package org.ow2.frascati.tinfi.opt.oo;
import java.util.List;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.api.type.InterfaceType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.desc.ControllerDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.helper.JuliacHelper;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.ow2.frascati.tinfi.TinfiComponentInterceptor;
......@@ -41,6 +48,14 @@ import org.ow2.frascati.tinfi.TinfiComponentInterceptor;
public class InitializerOOCtrlClassGenerator
extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<List<ControllerDesc>> fcscg,
MembraneDesc<List<ControllerDesc>> membraneDesc, ComponentType ct,
Object contentDesc ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
}
@Override
protected void generateNewFcContentMethod( BlockSourceCodeVisitor mv ) {
mv.visitIns("return null");
......
......@@ -27,9 +27,12 @@ import java.io.IOException;
import java.util.List;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.desc.ControllerDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator;
import org.ow2.frascati.tinfi.control.content.IllegalContentClassMetaData;
/**
......@@ -79,8 +82,13 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
}
@Override
public InitializerOOCtrlClassGenerator getInitializerClassGenerator() {
return new InitializerOOCtrlClassGenerator();
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<List<ControllerDesc>> fcscg,
MembraneDesc<List<ControllerDesc>> membraneDesc, ComponentType ct,
Object contentDesc ) {
return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
}
......
......@@ -28,12 +28,16 @@ import java.util.List;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.api.factory.InstantiationException;
import org.objectweb.fractal.api.type.ComponentType;
import org.objectweb.fractal.julia.InitializationContext;
import org.objectweb.fractal.julia.factory.ChainedInstantiationException;
import org.objectweb.fractal.julia.loader.Initializable;
import org.objectweb.fractal.julia.loader.Tree;
import org.objectweb.fractal.juliac.Juliac;
import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.desc.ControllerDesc;
import org.objectweb.fractal.juliac.desc.MembraneDesc;
import org.objectweb.fractal.juliac.helper.TreeHelper;
import org.objectweb.fractal.juliac.visit.BlockSourceCodeVisitor;
import org.objectweb.fractal.juliac.visit.ClassSourceCodeVisitor;
......@@ -54,6 +58,14 @@ import org.ow2.frascati.tinfi.control.content.SCAExtendedContentController;
public class InitializerOOCtrlClassGenerator
extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<List<ControllerDesc>> fcscg,
MembraneDesc<List<ControllerDesc>> membraneDesc, ComponentType ct,
Object contentDesc ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
}
@Override
protected void generateExtraCode( ClassSourceCodeVisitor cv ) {
BlockSourceCodeVisitor mv =
......
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