Issue 53 in peaberry: PeaberryActivationModule should provide a reference to OSGi BundleContext

9 views
Skip to first unread message

peab...@googlecode.com

unread,
Oct 13, 2010, 7:24:12 AM10/13/10
to guice...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium

New issue 53 by yungkce: PeaberryActivationModule should provide a
reference to OSGi BundleContext
http://code.google.com/p/peaberry/issues/detail?id=53

If the user uses the automatic bootstrapping of Peaberry bundles, there is
NO way to get the BundleContext object.

Todor Boev

unread,
Oct 13, 2010, 1:45:57 PM10/13/10
to guice...@googlegroups.com
The BundleContext intance of your bundle is bound into Guice. You
should be able to simply inject it where needed.

> --
> You received this message because you are subscribed to the Google Groups
> "Guice and OSGi" group.
> To post to this group, send email to guice...@googlegroups.com.
> To unsubscribe from this group, send email to
> guice-osgi+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/guice-osgi?hl=en.
>
>

peab...@googlecode.com

unread,
Oct 13, 2010, 2:00:46 PM10/13/10
to guice...@googlegroups.com

Comment #1 on issue 53 by mcculls: PeaberryActivationModule should provide

As Todor mentioned on the mailing list, just @Inject BundleContext wherever
you need it.

peab...@googlecode.com

unread,
Oct 14, 2010, 3:43:17 AM10/14/10
to guice...@googlegroups.com

Comment #2 on issue 53 by yungkce: PeaberryActivationModule should provide

But what if I would like to refer to the BundleContext in the
PeaberryActivationModule's configure() method? It is before Guice @Inject
the BundleContext object.

peab...@googlecode.com

unread,
Oct 14, 2010, 6:49:14 AM10/14/10
to guice...@googlegroups.com

Comment #3 on issue 53 by mcculls: PeaberryActivationModule should provide

Can you elaborate on what you need to use the BundleContext for in the
module itself? Binding modules are usually small and side-effect free, so
I'm just wondering why you need the context when setting up bindings.

peab...@googlecode.com

unread,
Nov 12, 2010, 5:53:46 AM11/12/10
to guice...@googlegroups.com

Comment #4 on issue 53 by yungkce: PeaberryActivationModule should provide

Since I would like to use the Manifest header of the bundle for setting the
attributes of the exported services inside the configure() method, the only
way to get those header is from the BundleContext.getBundle().getHeaders()
method unless I can export the services outside the configure() method.

peab...@googlecode.com

unread,
Nov 12, 2010, 8:49:19 AM11/12/10
to guice...@googlegroups.com

Comment #5 on issue 53 by Rinsvind: PeaberryActivationModule should provide

It seems best to pass the BundleContext to the module constructor.
Currently we expect the module to have a default constructor. We could
support a constructor with a BundleContext as well. I am not sure how nice
this will be since now there are two ways to obtain the BundleContext and
the users cat try to bind it a second time.

Stuart what do you think?

peab...@googlecode.com

unread,
Aug 4, 2012, 5:42:31 PM8/4/12
to guice...@googlegroups.com
Updates:
Labels: Peaberry-Extension

Comment #6 on issue 53 by mccu...@gmail.com: PeaberryActivationModule
should provide a reference to OSGi BundleContext
http://code.google.com/p/peaberry/issues/detail?id=53

(No comment was entered for this change.)

peab...@googlecode.com

unread,
Jun 21, 2015, 9:43:43 PM6/21/15
to guice...@googlegroups.com
Updates:
Status: Duplicate

Comment #7 on issue 53 by mccu...@gmail.com: PeaberryActivationModule
should provide a reference to OSGi BundleContext
https://code.google.com/p/peaberry/issues/detail?id=53

Moved to https://github.com/ops4j/peaberry/issues/56

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Reply all
Reply to author
Forward
0 new messages