Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] Some questions

Hi Thomas,

On Sun, Feb 20, 2011 at 3:04 AM, Thomas Kratz <eiswind@xxxxxxxxxxxxxx> wrote:
Can I get any OSGi Service injected ? I have some Spring httpinvokers, that I could publish through spring dm as osgi services. It could get rid of some static singletons if I could get those beans injected anyhow.

As Tom mentioned, you can request an OSGi service through the eclipseContext or @Inject ... we don't support property filters yet.
 

How would I publish something to the eclipseContext? At login time I create an XmppConnection thats used throughout the application (another static singleton). If above answer is yes I guess I should publish as an OSGi Service.

we support a couple of flavours of adding things to the context.

1) at the appropriate level, simply get the context and call set(*).  you can get the MApplication and then get its context for something that's truly global.

2) if it is published as an OSGi service, it will also be available from the context.

3a) you can set a org.eclipse.e4.core.contexts.ContextFunction or provide more dynamic information in a context, or information that has other dependencies.  See org.eclipse.e4.core.contexts.IContextFunction for the requirements.

3b) We use DS and a property to make org.eclipse.e4.core.contexts.IContextFunction available to the contexts.

Later,
PW


--
Paul Webster
Hi floor.  Make me a sammich! - GIR

Back to the top