Home » Eclipse Projects » Equinox » Questions about OSGi
Questions about OSGi [message #22862] |
Mon, 14 April 2003 10:14  |
Eclipse User |
|
|
|
Hello,
I spent some time over the week end reading the OSGi specs and I have some
questions:
- When the framework is shutdown, bundle states are saved. Is there any
other information saved (the instances, the internal state of each bundle)?
Does a bundle as a chance to do something on saving?
- How is the platform state restored? For example when the platform has
been shatdown the bundle A was ACTIVE. Is the bundle A defacto ACTIVE when
the platform restart, or does it go through the regular lifecycle stage of
INSTALLED, RESOLVED, ACTIVE sent? Will the start() method on the
bundleActivator of A be called?
- Can a bundle contain jars whose code will be used?
- Can a bundle contain bundles?
- Why is there no RESOLVED event?
- Is it really possible to access resources from an INSTALLED bundle?
Thank you in advance,
PaScaL
|
|
|
Re: Questions about OSGi [message #22907 is a reply to message #22862] |
Tue, 15 April 2003 03:10   |
Eclipse User |
|
|
|
Originally posted by: Peter.Kriens.aQute.se
Pascal Rapicault wrote:
> - When the framework is shutdown, bundle states are saved. Is there any
> other information saved (the instances, the internal state of each bundle)?
Each bundle has its own private data area, it can save whatever it wants
in there.
> Does a bundle as a chance to do something on saving?
The stop() method is called on the BundleActivator, the bundle can do
whatever it likes in there.
> - How is the platform state restored? For example when the platform has
> been shatdown the bundle A was ACTIVE. Is the bundle A defacto ACTIVE when
> the platform restart, or does it go through the regular lifecycle stage of
> INSTALLED, RESOLVED, ACTIVE sent? Will the start() method on the
> bundleActivator of A be called?
It will go through the normal life cycle methods. I.e. there is no magic
data stored, only fact that a bundle should be started when the
framework is started. The bundle will come alive in the INSTALLED state,
and then has to move to RESOLVED before it is started and becomes ACTIVE.
> - Can a bundle contain jars whose code will be used?
Yes, this is supported with the Bundle-Classpath manifest header that
contains a list of JAR files in the Bundle's JAR file. This is a very
useful feature that I wish was supported by normal Java.
> - Can a bundle contain bundles?
Yes. Installing a bundle is from a URL or InputStream, so installing a
bundle in a bundle is like context.installBundle(
getClass().getResource("bundle.jar").toString() ); This is used
extensively in the OSGi test suites.
> - Why is there no RESOLVED event?
The need never arose. Do you have a use case for it?
> - Is it really possible to access resources from an INSTALLED bundle?
Yes, through the Bundle.getResource method.
Hope this helps, kind regards,
Peter Kriens
|
|
|
Re: Questions about OSGi [message #22951 is a reply to message #22862] |
Tue, 15 April 2003 03:10   |
Eclipse User |
|
|
|
Originally posted by: Peter.Kriens.aQute.se
Pascal Rapicault wrote:
> - When the framework is shutdown, bundle states are saved. Is there any
> other information saved (the instances, the internal state of each bundle)?
Each bundle has its own private data area, it can save whatever it wants
in there.
> Does a bundle as a chance to do something on saving?
The stop() method is called on the BundleActivator, the bundle can do
whatever it likes in there.
> - How is the platform state restored? For example when the platform has
> been shatdown the bundle A was ACTIVE. Is the bundle A defacto ACTIVE when
> the platform restart, or does it go through the regular lifecycle stage of
> INSTALLED, RESOLVED, ACTIVE sent? Will the start() method on the
> bundleActivator of A be called?
It will go through the normal life cycle methods. I.e. there is no magic
data stored, only fact that a bundle should be started when the
framework is started. The bundle will come alive in the INSTALLED state,
and then has to move to RESOLVED before it is started and becomes ACTIVE.
> - Can a bundle contain jars whose code will be used?
Yes, this is supported with the Bundle-Classpath manifest header that
contains a list of JAR files in the Bundle's JAR file. This is a very
useful feature that I wish was supported by normal Java.
> - Can a bundle contain bundles?
Yes. Installing a bundle is from a URL or InputStream, so installing a
bundle in a bundle is like context.installBundle(
getClass().getResource("bundle.jar").toString() ); This is used
extensively in the OSGi test suites.
> - Why is there no RESOLVED event?
The need never arose. Do you have a use case for it?
> - Is it really possible to access resources from an INSTALLED bundle?
Yes, through the Bundle.getResource method.
Hope this helps, kind regards,
Peter Kriens
|
|
|
Re: Questions about OSGi [message #23081 is a reply to message #22907] |
Tue, 15 April 2003 10:10  |
Eclipse User |
|
|
|
That's great,
Best regards,
PaScaL
"pkriens" <Peter.Kriens@aQute.se> wrote in message
news:3E9BB061.3050803@aQute.se...
> Pascal Rapicault wrote:
>
> > - When the framework is shutdown, bundle states are saved. Is there
any
> > other information saved (the instances, the internal state of each
bundle)?
>
> Each bundle has its own private data area, it can save whatever it wants
> in there.
>
>
> > Does a bundle as a chance to do something on saving?
>
> The stop() method is called on the BundleActivator, the bundle can do
> whatever it likes in there.
>
>
> > - How is the platform state restored? For example when the platform
has
> > been shatdown the bundle A was ACTIVE. Is the bundle A defacto ACTIVE
when
> > the platform restart, or does it go through the regular lifecycle stage
of
> > INSTALLED, RESOLVED, ACTIVE sent? Will the start() method on the
> > bundleActivator of A be called?
>
> It will go through the normal life cycle methods. I.e. there is no magic
> data stored, only fact that a bundle should be started when the
> framework is started. The bundle will come alive in the INSTALLED state,
> and then has to move to RESOLVED before it is started and becomes ACTIVE.
>
>
> > - Can a bundle contain jars whose code will be used?
>
> Yes, this is supported with the Bundle-Classpath manifest header that
> contains a list of JAR files in the Bundle's JAR file. This is a very
> useful feature that I wish was supported by normal Java.
>
>
> > - Can a bundle contain bundles?
>
> Yes. Installing a bundle is from a URL or InputStream, so installing a
> bundle in a bundle is like context.installBundle(
> getClass().getResource("bundle.jar").toString() ); This is used
> extensively in the OSGi test suites.
>
>
> > - Why is there no RESOLVED event?
>
> The need never arose. Do you have a use case for it?
>
>
> > - Is it really possible to access resources from an INSTALLED
bundle?
>
> Yes, through the Bundle.getResource method.
>
>
> Hope this helps, kind regards,
>
> Peter Kriens
>
|
|
|
Goto Forum:
Current Time: Sat May 03 03:45:08 EDT 2025
Powered by FUDForum. Page generated in 0.02497 seconds
|