0

I have a bundle test.Bundle1 that have some properties fulfilled by Blueprint injections.

I've created one test fragment whose Host is test.Bundle1 and I would like to obtain myClassA instantiated singleton to access those properties.

I know that I could acess the bundle from a class name using FrameworkUtil.getBundle(), but I don't know how to get the instance of this class.

How could I do that?

thanks

Cristiano

Cristiano
  • 1,414
  • 15
  • 22
  • To answer this question ask yourself, how would access this singleton in test.Bundle1. Fragments share the classpath of their host, so all classes available in the host are visible in fragments as well. The reverse is also true, your host will see fragments' classes, however, you are creating cyclic dependency which is not recommended, although it will work. – Danail Nachev Jun 07 '11 at 10:44

1 Answers1

1

One way to go about this is to simply publish that instance as a service, so you can look it up in code that needs it.

Marcel Offermans
  • 3,313
  • 1
  • 15
  • 23