[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.stp.sca-tools] Re: Extending the SCA Meta Model

Stephane Drapeau a écrit :
Damien Fournier a écrit :

Hi Stéphane,

Stephane Drapeau a écrit :
Hi Damien,

Meta object Id values can be the same for different meta models.
Could you clarify how are you doing to add the OSGi type?
Following the sca model extension guide, I've extended the SCA model with an osgi implementation in a new Ecore model.
This implementation has an EAttribute named "bundle". I've also added a DocumentRoot (EObject) which
has an EReference on the "OsgiImplmentation" (as explained in the extension guide)


Ecore and genmodel  files are accessible at

http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/frascati/trunk/assembly-factory/model/org.ow2.frascati.model.osgi/model/


This metal model has a different namespace of existing FraSCAti meta model (http://frascati.ow2.org/osgi).


If Meta object Id values can be the same for different SCA model extensions, then how to make distinction between
two different implementations or bindings ? For instance when calling getImplementation() on a SCA Component, how
to know if this component is implemented with java, spring, bpel, etc ?

Hi Stephane,

You can use instanceof

if(component.getImplementation() instanceof JavaImplementation) {
  ....
} else if (component.getImplementation() instanceof OSGiImplementation) {
  ...
}

Right
cheers!

Stephane Drapeau
Obeo

But

What about the doSwitch() method provided by FrascatiSwitch or TuscanySwitch class (Obtained when generating model code)?
Since the generated doSwitch() call the caseXXX method according to meta object id.
Does this means that the doSwitch() cannot be used when having ecore model extensions ?


Whatever, I can use class name instead of meta object ids

Thanks for help

Damien