Commit bf0958fc authored by seinturi's avatar seinturi

Add information to link the generate code to its source code element.

parent 64881335
......@@ -66,33 +66,15 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
// Implementation of the FCSourceCodeGeneratorItf interface
// -----------------------------------------------------------------------
/**
* Return <code>true</code> if the current source code generator handles the
* specified controller descriptor.
*
* @param controllerDesc the controller descriptor to be checked
* @return
* <code>true</code> if <code>controllerDesc</code> should be accepted
*/
@Override
public boolean acceptCtrlDesc( Object controllerDesc ) {
boolean accept = controllerDesc.equals(SCA_OSGI_PRIMITIVE);
return accept;
}
/**
* Generate the source code associated to a Fractal component.
* The membrane implementation and the initializer implementation are
* generated.
*
* @param type the component type
* @param controllerDesc the component controller descriptor
* @param contentDesc the component content descriptor
* @return the initializer class generator for this component
*/
@Override
public SourceCodeGeneratorItf generate(
Type type, Object controllerDesc, Object contentDesc )
Type type, Object controllerDesc, Object contentDesc, Object source )
throws IOException {
/*
......@@ -101,14 +83,11 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
osgig.check(type,controllerDesc,contentDesc);
SourceCodeGeneratorItf scg =
super.generate(type,controllerDesc,contentDesc);
super.generate(type,controllerDesc,contentDesc,source);
return scg;
}
/**
* Return the source code generator for component interfaces.
*/
@Override
public ProxyClassGeneratorItf getInterfaceClassGenerator(InterfaceType it) {
......
......@@ -113,10 +113,10 @@ extends org.objectweb.fractal.juliac.opt.comp.FCCompCtrlSourceCodeGenerator {
getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg,
CompBasedMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
return new InitializerCompCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
jc,fcscg,membraneDesc,ct,contentDesc,source);
}
/**
......
......@@ -47,9 +47,9 @@ extends org.objectweb.fractal.juliac.opt.comp.InitializerCompCtrlClassGenerator
public InitializerCompCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<CompBasedMembraneDesc> fcscg,
CompBasedMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
super(jc,fcscg,membraneDesc,ct,contentDesc,source);
}
@Override
......
......@@ -96,10 +96,10 @@ extends org.objectweb.fractal.juliac.opt.oo.FCOOCtrlSourceCodeGenerator {
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
jc,fcscg,membraneDesc,ct,contentDesc,source);
}
/**
......
......@@ -48,9 +48,9 @@ extends org.objectweb.fractal.juliac.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
super(jc,fcscg,membraneDesc,ct,contentDesc,source);
}
@Override
......
......@@ -55,18 +55,10 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
mloader.put(SCALightComposite.NAME,SCALightComposite.class);
}
/**
* Generate the implementation of the membrane associated to a Fractal
* component.
*
* @param ct the component type
* @param ctrldesc the component controller descriptor
* @param contentClassName the name of the component content class
* @return data about the membrane implementation
*/
@Override
public SimpleMembraneDesc generateMembraneImpl(
ComponentType ct, String ctrldesc, String contentClassName )
ComponentType ct, String ctrldesc, String contentClassName,
Object source )
throws IOException {
/*
......@@ -75,17 +67,17 @@ extends org.ow2.frascati.tinfi.opt.oo.FCOOCtrlSourceCodeGenerator {
*/
generateSCAContentControllerImpl(contentClassName);
return super.generateMembraneImpl(ct,ctrldesc,contentClassName);
return super.generateMembraneImpl(ct,ctrldesc,contentClassName,source);
}
@Override
protected InitializerOOCtrlClassGenerator getInitializerClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
return new InitializerOOCtrlClassGenerator(
jc,fcscg,membraneDesc,ct,contentDesc);
jc,fcscg,membraneDesc,ct,contentDesc,source);
}
......
......@@ -61,9 +61,9 @@ extends org.ow2.frascati.tinfi.opt.oo.InitializerOOCtrlClassGenerator {
public InitializerOOCtrlClassGenerator(
Juliac jc, FCSourceCodeGeneratorItf<SimpleMembraneDesc> fcscg,
SimpleMembraneDesc membraneDesc, ComponentType ct,
Object contentDesc ) {
Object contentDesc, Object source ) {
super(jc,fcscg,membraneDesc,ct,contentDesc);
super(jc,fcscg,membraneDesc,ct,contentDesc,source);
}
@Override
......
......@@ -349,7 +349,7 @@ public class TinfiParserSupportImpl implements ADLParserSupportItf {
/*
* Generate the Juliac factory class for the component.
*/
SourceCodeGeneratorItf icg = jc.generate(ct,controller,adl);
SourceCodeGeneratorItf icg = jc.generate(ct,controller,adl,cl);
/*
* Generate a second factory that extends the previous one and that
......
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