Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Service Component Architecture (SCA) Tools » Extending the SCA Meta Model
Extending the SCA Meta Model [message #8826] Thu, 04 June 2009 15:25 Go to next message
Damien Fournier is currently offline Damien FournierFriend
Messages: 12
Registered: July 2009
Location: Lille, France
Junior Member
Hi All,

I'm trying to extend the SCA meta model by adding a new implementation
type (currently an implementation.osgi element specific for the OW2
FraSCAti platform).

My extension integrates with the core sca metal model, but I still have
an issue with meta object id, when generating java code for this model.

The meta object id value for my OsgiPackage.OSGI_IMPLEMENTATION is set
to "1" which is in conflict with existing
FrascatiPackage.FRACTAL_IMPLEMENTATION

Following FraSCAti and Tuscany model extension, meta objects ids seem
to be unique

Thus, does anyone knows how to generate java code from a model extension
without having conflict with meta object ids

Thanks

Damien
Re: Extending the SCA Meta Model [message #8831 is a reply to message #8826] Fri, 05 June 2009 09:42 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
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?

If your OSGi type is defined in a new meta model (plugin), this meta
model can't reuse the FraSCAti namespace.
If you want to use the FraSCAti namespace, you must add the OSGi
implementation type directly in the FraSCAti meta model and then
regenerate the code.

Regards,

Stéphane

Damien Fournier a écrit :
> Hi All,
>
> I'm trying to extend the SCA meta model by adding a new implementation
> type (currently an implementation.osgi element specific for the OW2
> FraSCAti platform).
>
> My extension integrates with the core sca metal model, but I still have
> an issue with meta object id, when generating java code for this model.
>
> The meta object id value for my OsgiPackage.OSGI_IMPLEMENTATION is set
> to "1" which is in conflict with existing
> FrascatiPackage.FRACTAL_IMPLEMENTATION
>
> Following FraSCAti and Tuscany model extension, meta objects ids seem
> to be unique
>
> Thus, does anyone knows how to generate java code from a model extension
> without having conflict with meta object ids
>
> Thanks
>
> Damien
Re: Extending the SCA Meta Model [message #8976 is a reply to message #8831] Tue, 09 June 2009 08:57 Go to previous messageGo to next message
Damien Fournier is currently offline Damien FournierFriend
Messages: 12
Registered: July 2009
Location: Lille, France
Junior Member
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/mod el/

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 ?

Thanks

Damien

>
> If your OSGi type is defined in a new meta model (plugin), this meta
> model can't reuse the FraSCAti namespace.
> If you want to use the FraSCAti namespace, you must add the OSGi
> implementation type directly in the FraSCAti meta model and then
> regenerate the code.
>
> Regards,
>
> Stéphane
>
> Damien Fournier a écrit :
>> Hi All,
>>
>> I'm trying to extend the SCA meta model by adding a new
>> implementation type (currently an implementation.osgi element
>> specific for the OW2 FraSCAti platform).
>>
>> My extension integrates with the core sca metal model, but I still have
>> an issue with meta object id, when generating java code for this model.
>>
>> The meta object id value for my OsgiPackage.OSGI_IMPLEMENTATION is
>> set to "1" which is in conflict with existing
>> FrascatiPackage.FRACTAL_IMPLEMENTATION
>>
>> Following FraSCAti and Tuscany model extension, meta objects ids seem
>> to be unique
>>
>> Thus, does anyone knows how to generate java code from a model
>> extension without having conflict with meta object ids
>>
>> Thanks
>>
>> Damien
Re: Extending the SCA Meta Model [message #8995 is a reply to message #8976] Tue, 09 June 2009 09:07 Go to previous messageGo to next message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
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/mod el/
>
>
> 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 ?

You can use instanceof

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

cheers!

Stephane Drapeau
Obeo
Re: Extending the SCA Meta Model [message #9015 is a reply to message #8995] Tue, 09 June 2009 14:54 Go to previous messageGo to next message
Damien Fournier is currently offline Damien FournierFriend
Messages: 12
Registered: July 2009
Location: Lille, France
Junior Member
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/mod el/
>>
>>
>> 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
Re: Extending the SCA Meta Model [message #9034 is a reply to message #9015] Tue, 09 June 2009 17:56 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Damien Fournier a écrit :
>
> 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.

If you have a look to the public and the first protected doSwitch()
methods, you can see that
the EContainer of
the EClass of
the theEObject parameter
(of the doSwitch() method that contains the switch statement)
is the model package of the Switch class.

> Does this means that the doSwitch() cannot be used when having ecore
> model extensions ?

No. For example, the public doSwitch method is used in the
FrascatiItemProvider.

>
> Whatever, I can use class name instead of meta object ids
>
> Thanks for help
>
> Damien
>

Stephane Drapeau
Obeo
Re: Extending the SCA Meta Model [message #575203 is a reply to message #8826] Fri, 05 June 2009 09:42 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
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?

If your OSGi type is defined in a new meta model (plugin), this meta
model can't reuse the FraSCAti namespace.
If you want to use the FraSCAti namespace, you must add the OSGi
implementation type directly in the FraSCAti meta model and then
regenerate the code.

Regards,

Stéphane

Damien Fournier a écrit :
> Hi All,
>
> I'm trying to extend the SCA meta model by adding a new implementation
> type (currently an implementation.osgi element specific for the OW2
> FraSCAti platform).
>
> My extension integrates with the core sca metal model, but I still have
> an issue with meta object id, when generating java code for this model.
>
> The meta object id value for my OsgiPackage.OSGI_IMPLEMENTATION is set
> to "1" which is in conflict with existing
> FrascatiPackage.FRACTAL_IMPLEMENTATION
>
> Following FraSCAti and Tuscany model extension, meta objects ids seem
> to be unique
>
> Thus, does anyone knows how to generate java code from a model extension
> without having conflict with meta object ids
>
> Thanks
>
> Damien
Re: Extending the SCA Meta Model [message #575307 is a reply to message #8831] Tue, 09 June 2009 08:57 Go to previous message
Damien Fournier is currently offline Damien FournierFriend
Messages: 12
Registered: July 2009
Location: Lille, France
Junior Member
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/mod el/

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 ?

Thanks

Damien

>
> If your OSGi type is defined in a new meta model (plugin), this meta
> model can't reuse the FraSCAti namespace.
> If you want to use the FraSCAti namespace, you must add the OSGi
> implementation type directly in the FraSCAti meta model and then
> regenerate the code.
>
> Regards,
>
> Stéphane
>
> Damien Fournier a écrit :
>> Hi All,
>>
>> I'm trying to extend the SCA meta model by adding a new
>> implementation type (currently an implementation.osgi element
>> specific for the OW2 FraSCAti platform).
>>
>> My extension integrates with the core sca metal model, but I still have
>> an issue with meta object id, when generating java code for this model.
>>
>> The meta object id value for my OsgiPackage.OSGI_IMPLEMENTATION is
>> set to "1" which is in conflict with existing
>> FrascatiPackage.FRACTAL_IMPLEMENTATION
>>
>> Following FraSCAti and Tuscany model extension, meta objects ids seem
>> to be unique
>>
>> Thus, does anyone knows how to generate java code from a model
>> extension without having conflict with meta object ids
>>
>> Thanks
>>
>> Damien
Re: Extending the SCA Meta Model [message #575326 is a reply to message #8976] Tue, 09 June 2009 09:07 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
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/mod el/
>
>
> 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 ?

You can use instanceof

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

cheers!

Stephane Drapeau
Obeo
Re: Extending the SCA Meta Model [message #575341 is a reply to message #8995] Tue, 09 June 2009 14:54 Go to previous message
Damien Fournier is currently offline Damien FournierFriend
Messages: 12
Registered: July 2009
Location: Lille, France
Junior Member
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/mod el/
>>
>>
>> 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
Re: Extending the SCA Meta Model [message #575354 is a reply to message #9015] Tue, 09 June 2009 17:56 Go to previous message
Stephane Drapeau is currently offline Stephane DrapeauFriend
Messages: 199
Registered: July 2009
Senior Member
Damien Fournier a écrit :
>
> 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.

If you have a look to the public and the first protected doSwitch()
methods, you can see that
the EContainer of
the EClass of
the theEObject parameter
(of the doSwitch() method that contains the switch statement)
is the model package of the Switch class.

> Does this means that the doSwitch() cannot be used when having ecore
> model extensions ?

No. For example, the public doSwitch method is used in the
FrascatiItemProvider.

>
> Whatever, I can use class name instead of meta object ids
>
> Thanks for help
>
> Damien
>

Stephane Drapeau
Obeo
Previous Topic:How to instal SOA Tool
Next Topic:[Announce] SCA Tools 2.0.0 releases with Galileo!
Goto Forum:
  


Current Time: Thu Apr 25 12:21:47 GMT 2024

Powered by FUDForum. Page generated in 0.04121 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top