Thanks Valentin Mahrwald.
Thank you very much;
I got it;
> ----original -----
> Sender: Valentin Mahrwald [mailto:[email protected]]
> Date: 2011/6/14 21:12
> Receiver: [email protected]
> Subject: Re: How to let a Blue Print Component know the Java Object
created Outside
> the Blue Print container but in same Bundle?
>
> Hi,
>
> one approach that seems to cover some of the bases would be to consume the
> BlueprintContainer object for your bundle from the service registry. After
the
> Blueprint xml is parsed and components are instantiated, a
BlueprintContainer
> service is published for the bundle (see
> http://www.osgi.org/javadoc/r4v42/org/osgi/service/blueprint/container/Blu
> eprintContainer.html) and could be consumed from the Activator from there
> (ideally through a service listener rather than via waiting).
>
> Hope this helps,
>
> Valentin
>
> On 14 Jun 2011, at 06:48, ext2 wrote:
>
> > Hi:
> > I am writing a bundle which want to use Blue Print to publish and
> > refrence osgi service.
> > Also I need initialize some other java object outside the blue print
> > container(etc in Bundle Activator).
> > Does anyone know how to set the reference of these java objects to
> > Blue Print Container?
> > BlueprintContainer maybe a good choice, but I don't know how could I
> > get the instance of BlueprintContainer out side BluePrint Container(etc
:
> in
> > the bundle activator).
> >
> > Ps. The reason why I initialize java object out side blue print is:
> >
> > I am a using another sophisticate framework to initialize a group of
> > components.
> >
> > Although I could write a component of Blue Print to initialize the
> > framework, but this will force my application to be under control of
Blue
> > Print;
> > But my application based on the framework only sometimes need osgi
features
> > supported by Blue Print, not always;
> >
> > So I do not want my self's framework to be coupled tightly with blue
print
> > container. If I can access blue print container from outside, I could
make
> > it to be loose coupled to blue-print.
> >
> > Thanks any suggestion;
> >
> >
> >