Commit 22edb585 authored by Lionel Seinturier's avatar Lionel Seinturier

Move all service methods to Juliac.

parent cc22ab1d
...@@ -51,7 +51,7 @@ public class EMFParserSupportImplTestCase { ...@@ -51,7 +51,7 @@ public class EMFParserSupportImplTestCase {
@Before @Before
public void setUp() throws IOException { public void setUp() throws IOException {
jc = new Juliac(); jc = new Juliac();
jc.setJuliacConfig(new JuliacConfig(jc)); jc.setJuliacConfig(new JuliacConfig());
emfps = new EMFParserSupportImpl(); emfps = new EMFParserSupportImpl();
emfps.init(jc); emfps.init(jc);
} }
......
...@@ -38,7 +38,6 @@ import org.objectweb.fractal.juliac.api.MembraneLoaderItf; ...@@ -38,7 +38,6 @@ import org.objectweb.fractal.juliac.api.MembraneLoaderItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf; import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper; import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.annotation.AnnotationHelper; 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.conf.JulietLoader;
import org.objectweb.fractal.juliac.desc.NoSuchControllerDescriptorException; import org.objectweb.fractal.juliac.desc.NoSuchControllerDescriptorException;
import org.objectweb.fractal.juliac.opt.InitializerClassGenerator; import org.objectweb.fractal.juliac.opt.InitializerClassGenerator;
...@@ -74,9 +73,8 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator { ...@@ -74,9 +73,8 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
* based configuration mechanism for defining membranes. * based configuration mechanism for defining membranes.
*/ */
JuliacConfig jconf = jc.getJuliacConfig();
mloader = mloader =
jconf.loadModuleIfNew( jc.loadModuleIfNew(
JulietLoader.class.getName(), MembraneLoaderItf.class ); JulietLoader.class.getName(), MembraneLoaderItf.class );
mloader.put(KOCK_PREFIX+SCAPrimitive.NAME,SCAPrimitive.class); mloader.put(KOCK_PREFIX+SCAPrimitive.NAME,SCAPrimitive.class);
......
...@@ -35,7 +35,6 @@ import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf; ...@@ -35,7 +35,6 @@ import org.objectweb.fractal.juliac.api.FCSourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf; import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper; import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.annotation.AnnotationHelper; 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.conf.JulietLoader;
import org.objectweb.fractal.juliac.desc.SimpleMembraneDesc; import org.objectweb.fractal.juliac.desc.SimpleMembraneDesc;
import org.objectweb.fractal.juliac.proxy.InterfaceImplementationClassGenerator; import org.objectweb.fractal.juliac.proxy.InterfaceImplementationClassGenerator;
...@@ -72,9 +71,8 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator { ...@@ -72,9 +71,8 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
* registered before the current one (see the associated JUnit test). * registered before the current one (see the associated JUnit test).
*/ */
JuliacConfig jconf = jc.getJuliacConfig();
mloader = mloader =
jconf.loadModuleIfNew( jc.loadModuleIfNew(
JulietLoader.class.getName(), JulietLoader.class ); JulietLoader.class.getName(), JulietLoader.class );
mloader.put(SCAPrimitive.NAME,SCAPrimitive.class); mloader.put(SCAPrimitive.NAME,SCAPrimitive.class);
......
...@@ -47,7 +47,6 @@ import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf; ...@@ -47,7 +47,6 @@ import org.objectweb.fractal.juliac.api.SourceCodeGeneratorItf;
import org.objectweb.fractal.juliac.commons.lang.ClassHelper; import org.objectweb.fractal.juliac.commons.lang.ClassHelper;
import org.objectweb.fractal.juliac.commons.lang.GenericClassHelper; import org.objectweb.fractal.juliac.commons.lang.GenericClassHelper;
import org.objectweb.fractal.juliac.commons.lang.reflect.FieldHelper; import org.objectweb.fractal.juliac.commons.lang.reflect.FieldHelper;
import org.objectweb.fractal.juliac.conf.JuliacConfig;
import org.objectweb.fractal.juliac.conf.JulietLoader; import org.objectweb.fractal.juliac.conf.JulietLoader;
import org.objectweb.fractal.juliac.conf.MembraneHelper; import org.objectweb.fractal.juliac.conf.MembraneHelper;
import org.objectweb.fractal.juliac.desc.ComponentDesc; import org.objectweb.fractal.juliac.desc.ComponentDesc;
...@@ -94,13 +93,11 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf { ...@@ -94,13 +93,11 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
public void init( Juliac jc ) { public void init( Juliac jc ) {
this.jc = jc; this.jc = jc;
JuliacConfig jconf = jc.getJuliacConfig(); jc.register(SERVICE_TYPE,this);
jconf.register(SERVICE_TYPE,this);
} }
public void close( Juliac jc ) { public void close( Juliac jc ) {
JuliacConfig jconf = jc.getJuliacConfig(); jc.unregister(SERVICE_TYPE,this);
jconf.unregister(SERVICE_TYPE,this);
} }
...@@ -319,8 +316,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf { ...@@ -319,8 +316,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
MembraneHelper.getMembraneDef(mAnnot,uc.toString(cl)); MembraneHelper.getMembraneDef(mAnnot,uc.toString(cl));
Membrane mdef = mdefcl.getAnnotation(Membrane.class); Membrane mdef = mdefcl.getAnnotation(Membrane.class);
controller = mdef.desc(); controller = mdef.desc();
JuliacConfig jconf = jc.getJuliacConfig(); List<JulietLoader> mloaders = jc.lookup(JulietLoader.class);
List<JulietLoader> mloaders = jconf.lookup(JulietLoader.class);
for( MembraneLoaderItf mloader : mloaders ) { for( MembraneLoaderItf mloader : mloaders ) {
mloader.put(controller,mdefcl); mloader.put(controller,mdefcl);
} }
......
...@@ -48,7 +48,7 @@ public class FCOOCtrlSourceCodeGeneratorTestCase { ...@@ -48,7 +48,7 @@ public class FCOOCtrlSourceCodeGeneratorTestCase {
public void testTwoGenerators() throws IOException { public void testTwoGenerators() throws IOException {
Juliac jc = new Juliac(); Juliac jc = new Juliac();
JuliacConfig jconf = new JuliacConfig(jc); JuliacConfig jconf = new JuliacConfig();
jc.setJuliacConfig(jconf); jc.setJuliacConfig(jconf);
JuliacModuleItf oo = JuliacModuleItf oo =
......
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