Skip to main content



      Home
Home » Modeling » EMF » OSGI Configuration (Newbie)
OSGI Configuration (Newbie) [message #1220671] Thu, 12 December 2013 20:37 Go to next message
Eclipse UserFriend
I am generating a set of objects from a schema using XCore, and have an
interface package that now contains about a dozen interfaces; the
implementation is in the implementation package. I would like to serve
up the interfaces with OSGI in order to allow dependency injection in an
e4 RCP application.

Is it the right approach to simply provide a dozen component
configuration files, or is there a better approach that enables me to
put the entire package into a component.xml file? It appears that I
have to do this on a class by class basis with separate component files
but want to make sure this is the right approach.

Thanks.

- Mike
Re: OSGI Configuration (Newbie) [message #1220688 is a reply to message #1220671] Fri, 13 December 2013 00:15 Go to previous messageGo to next message
Eclipse UserFriend
Mike,

Comments below.

On 13/12/2013 2:37 AM, J. Michael Dean wrote:
> I am generating a set of objects from a schema using XCore, and have
> an interface package that now contains about a dozen interfaces; the
> implementation is in the implementation package. I would like to
> serve up the interfaces with OSGI in order to allow dependency
> injection in an e4 RCP application.
Serve up?
>
> Is it the right approach to simply provide a dozen component
> configuration files,
I'm not sure what you mean by that?
> or is there a better approach that enables me to put the entire
> package into a component.xml file? It appears that I have to do this
> on a class by class basis with separate component files but want to
> make sure this is the right approach.
Sorry, but I don't know what these component.xml files are. Maybe Tom
who knows more about how e4 uses dependency injection will answer this...
>
> Thanks.
>
> - Mike
Re: OSGI Configuration (Newbie) [message #1220837 is a reply to message #1220688] Fri, 13 December 2013 19:49 Go to previous messageGo to next message
Eclipse UserFriend
On 12/12/13, 10:15 PM, Ed Merks wrote:
> Mike,
>
> Comments below.
>
> On 13/12/2013 2:37 AM, J. Michael Dean wrote:
>> I am generating a set of objects from a schema using XCore, and have
>> an interface package that now contains about a dozen interfaces; the
>> implementation is in the implementation package. I would like to
>> serve up the interfaces with OSGI in order to allow dependency
>> injection in an e4 RCP application.
> Serve up?
>>
>> Is it the right approach to simply provide a dozen component
>> configuration files,
> I'm not sure what you mean by that?
>> or is there a better approach that enables me to put the entire
>> package into a component.xml file? It appears that I have to do this
>> on a class by class basis with separate component files but want to
>> make sure this is the right approach.
> Sorry, but I don't know what these component.xml files are. Maybe Tom
> who knows more about how e4 uses dependency injection will answer this...
>>
>> Thanks.
>>
>> - Mike
>
I wasn't very clear!

I want to make my model available as an OSGI service; the model has an
intensive care unit that contains patients that contain laboratory tests
results and clinical decisions. EMF creates the interface and
implementation for these various objects (ICU, Patient, Decision,
Laboratory) and I would like to put these in an OSGI service so they can
be injected in an e4 application.

This is accomplished within the service plugin with a declarative
service using a relatively simple xml file for a component, such as
Patient, and the file indicates the service (interface) and the
implementation class.

All examples I have seen have a single component in a service plugin,
but I see no way to make a single component with these multiple objects.

Thanks.

- Mike
Re: OSGI Configuration (Newbie) [message #1220851 is a reply to message #1220837] Sat, 14 December 2013 04:42 Go to previous message
Eclipse UserFriend
Comments below.

On 14/12/2013 1:49 AM, J Michael Dean wrote:
> On 12/12/13, 10:15 PM, Ed Merks wrote:
>> Mike,
>>
>> Comments below.
>>
>> On 13/12/2013 2:37 AM, J. Michael Dean wrote:
>>> I am generating a set of objects from a schema using XCore, and have
>>> an interface package that now contains about a dozen interfaces; the
>>> implementation is in the implementation package. I would like to
>>> serve up the interfaces with OSGI in order to allow dependency
>>> injection in an e4 RCP application.
>> Serve up?
>>>
>>> Is it the right approach to simply provide a dozen component
>>> configuration files,
>> I'm not sure what you mean by that?
>>> or is there a better approach that enables me to put the entire
>>> package into a component.xml file? It appears that I have to do this
>>> on a class by class basis with separate component files but want to
>>> make sure this is the right approach.
>> Sorry, but I don't know what these component.xml files are. Maybe Tom
>> who knows more about how e4 uses dependency injection will answer
>> this...
>>>
>>> Thanks.
>>>
>>> - Mike
>>
> I wasn't very clear!
>
> I want to make my model available as an OSGI service; the model has
> an intensive care unit that contains patients that contain laboratory
> tests results and clinical decisions. EMF creates the interface and
> implementation for these various objects (ICU, Patient, Decision,
> Laboratory) and I would like to put these in an OSGI service so they
> can be injected in an e4 application.
>
> This is accomplished within the service plugin with a declarative
> service using a relatively simple xml file for a component, such as
> Patient, and the file indicates the service (interface) and the
> implementation class.
I'm not sure it makes so much sense to use the generated model classes
in this way. It's generally expected that the factory is used to create
instances but direct constructor calls won't actually hurt...
>
> All examples I have seen have a single component in a service plugin,
> but I see no way to make a single component with these multiple objects.
So this is a question about OSGi service components and service design
not an EMF question.
>
> Thanks.
>
> - Mike
>
Previous Topic:XCore: refering from xmi/instance file to xcore file
Next Topic:[Xcore] Data type create and convert access in code?
Goto Forum:
  


Current Time: Thu May 22 16:44:02 EDT 2025

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

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

Back to the top