Home » Eclipse Projects » Equinox » OSGI Services... LogReaderService ...
OSGI Services... LogReaderService ... [message #67551] |
Wed, 17 May 2006 22:30 |
Eclipse User |
|
|
|
Originally posted by: mgervais.signaturegenetics.com
Hi,
I'm developping an rcp application. I've several questions:
-When I run my product, the org.eclipse.osgi framework is launch, if I
understand correctly it's the implementation of the OSGI specifications?
-How can I access to services of the framework? For example I want to get
the LogReaderService, which should be started with the framework? But I
don't konw if this interface is implemented in equinox... If not how can I
do it and register this service?
Thanks for you help, if you have some samples it would be apreciated...
Mickael
|
|
|
Re: OSGI Services... LogReaderService ... [message #67574 is a reply to message #67551] |
Thu, 18 May 2006 08:05 |
Eclipse User |
|
|
|
Originally posted by: neil.integility.com
Gervais,
- Yes, "org.eclipse.osgi" is the system bundle that implements the
framework.
- Services of the framework are accessed the same as any other services
(because they ARE the same). The nicest way to do this is with Declarative
Services. The lower-level way is to use a ServiceTracker, eg:
ServiceTracker logReaderTracker = new ServiceTracker(context,
LogReaderService.class.getName(), null);
logReaderTracker.open();
// Later...
LogReaderService logReader = (LogReaderService)
logReaderTracker.getService();
if(logReader != null) {
// Do something with logReader
}
// Later still...
logReaderTracker.close();
- LogService and LogReaderService are implemented in Equinox by the
"org.eclipse.equinox.log" bundle. If you start that bundle, then you will
get a LogService and a LogReaderService that you can use. If you don't,
then you won't.
Kind regards
Neil Bartlett
Gervais Mickael wrote:
> Hi,
> I'm developping an rcp application. I've several questions:
> -When I run my product, the org.eclipse.osgi framework is launch, if I
> understand correctly it's the implementation of the OSGI specifications?
> -How can I access to services of the framework? For example I want to get
> the LogReaderService, which should be started with the framework? But I
> don't konw if this interface is implemented in equinox... If not how can I
> do it and register this service?
> Thanks for you help, if you have some samples it would be apreciated...
> Mickael
|
|
| |
Re: OSGI Services... LogReaderService ... [message #67616 is a reply to message #67574] |
Thu, 18 May 2006 14:17 |
Eclipse User |
|
|
|
Originally posted by: mgervais.signaturegenetics.com
Thanks for your help,
it has been very helpfull for me. I'm trying to add the bundle
org.eclipse.equinox.log to my product by it's not in the list, maybe it's
due to I'm using Eclipse 3.2...
Thanks
Miclael
"Neil Bartlett" <neil@integility.com> wrote in message
news:fe14d0978e0748c8b84412e4e76a0b95$1@www.eclipse.org...
> Gervais,
>
> - Yes, "org.eclipse.osgi" is the system bundle that implements the
> framework.
>
> - Services of the framework are accessed the same as any other services
> (because they ARE the same). The nicest way to do this is with Declarative
> Services. The lower-level way is to use a ServiceTracker, eg:
>
> ServiceTracker logReaderTracker = new ServiceTracker(context,
> LogReaderService.class.getName(), null);
> logReaderTracker.open();
>
> // Later...
> LogReaderService logReader = (LogReaderService)
> logReaderTracker.getService();
> if(logReader != null) {
> // Do something with logReader
> }
>
> // Later still...
> logReaderTracker.close();
>
>
> - LogService and LogReaderService are implemented in Equinox by the
> "org.eclipse.equinox.log" bundle. If you start that bundle, then you will
> get a LogService and a LogReaderService that you can use. If you don't,
> then you won't.
>
>
> Kind regards
> Neil Bartlett
>
>
>
> Gervais Mickael wrote:
>
>> Hi,
>> I'm developping an rcp application. I've several questions:
>> -When I run my product, the org.eclipse.osgi framework is launch, if I
>> understand correctly it's the implementation of the OSGI specifications?
>> -How can I access to services of the framework? For example I want to get
>> the LogReaderService, which should be started with the framework? But I
>> don't konw if this interface is implemented in equinox... If not how can
>> I do it and register this service?
>> Thanks for you help, if you have some samples it would be apreciated...
>> Mickael
>
|
|
| | |
Re: OSGI Services... LogReaderService ... [message #67676 is a reply to message #67657] |
Thu, 18 May 2006 16:40 |
Eclipse User |
|
|
|
Originally posted by: mgervais.signaturegenetics.com
Hi Alex,
Thanks again for your answer...
I've downloaded the bundle and what I don't understand is my plugin A is
dependents of org.eclipse.equinox.log, and when plug A is started,
apparently the log bundle is not... When I launch my application with
eclipse and an Equinox OSGI configuration this
bundle(org.eclipse.equinox.log) is started, why it's not started with a
simple Eclipse configuraton. I've noted that the org.eclipse.equinox.log
doesn't have Eclipse-LazyStart: true... Is there an impact? It means that
the bundle should start at the begining?
Thanks again and sorry for this stupid quesiton.
Mickael
"Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
news:17714969.1147966549115.JavaMail.root@cp1.javalobby.org...
> It's not distributed in the SDK packaging, but you can download them from
> the Eclipse/Equinox download page.
>
> Alex.
|
|
|
Re: OSGI Services... LogReaderService ... [message #67697 is a reply to message #67676] |
Thu, 18 May 2006 23:01 |
Eclipse User |
|
|
|
Originally posted by: mgervais.signaturegenetics.com
I've added this bundle to the config.ini: org.eclipse.equinox.log@2:start,
but in my log file I get this error:
org.osgi.framework.BundleException: The bundle could not be resolved.
Reason: Missing Constraint: Import-Package: org.osgi.service.cm;
version="1.2.0", and I don't know how to fix it, moreover, this service logs
only bundle event, but I don't see log posted from the Ilog interface, so my
question is what's the link between LogService, and the Interface Ilog
implemented by Plugin, if there is one.
Thanks.
Mickael
"Gervais Mickael" <mgervais@signaturegenetics.com> wrote in message
news:e4i7j7$66h$1@utils.eclipse.org...
> Hi Alex,
> Thanks again for your answer...
> I've downloaded the bundle and what I don't understand is my plugin A is
> dependents of org.eclipse.equinox.log, and when plug A is started,
> apparently the log bundle is not... When I launch my application with
> eclipse and an Equinox OSGI configuration this
> bundle(org.eclipse.equinox.log) is started, why it's not started with a
> simple Eclipse configuraton. I've noted that the org.eclipse.equinox.log
> doesn't have Eclipse-LazyStart: true... Is there an impact? It means that
> the bundle should start at the begining?
> Thanks again and sorry for this stupid quesiton.
> Mickael
>
> "Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
> news:17714969.1147966549115.JavaMail.root@cp1.javalobby.org...
>> It's not distributed in the SDK packaging, but you can download them from
>> the Eclipse/Equinox download page.
>>
>> Alex.
>
>
|
|
|
Re: OSGI Services... LogReaderService ... [message #67717 is a reply to message #67697] |
Fri, 19 May 2006 10:39 |
Eclipse User |
|
|
|
Originally posted by: neil.integility.com
Mickael,
It sounds like the "org.eclipse.osgi.services" bundle is not installed.
That bundle contains the interfaces (but NOT the implementations) of each
of the services in the OSGi compendium, including the LogService and
LogReaderService.
Regarding your earlier question, your plugin "A" does not need a
dependency on org.eclipse.equinox.log, in fact it shouldn't have such a
dependency. It should only have an Import-Package on the
"org.osgi.service.log" package.
The way to get a bundle to start is not to create a dependency on it, and
Eclipse-LazyStart is also irrelevant here. To ensure that the log bundle
is started each time by the platform, you need to add it to the
osgi.bundles property in config.ini - as you later discovered.
Regards
Neil
Gervais Mickael wrote:
> I've added this bundle to the config.ini: org.eclipse.equinox.log@2:start,
> but in my log file I get this error:
> org.osgi.framework.BundleException: The bundle could not be resolved.
> Reason: Missing Constraint: Import-Package: org.osgi.service.cm;
> version="1.2.0", and I don't know how to fix it, moreover, this service logs
> only bundle event, but I don't see log posted from the Ilog interface, so my
> question is what's the link between LogService, and the Interface Ilog
> implemented by Plugin, if there is one.
> Thanks.
> Mickael
> "Gervais Mickael" <mgervais@signaturegenetics.com> wrote in message
> news:e4i7j7$66h$1@utils.eclipse.org...
>> Hi Alex,
>> Thanks again for your answer...
>> I've downloaded the bundle and what I don't understand is my plugin A is
>> dependents of org.eclipse.equinox.log, and when plug A is started,
>> apparently the log bundle is not... When I launch my application with
>> eclipse and an Equinox OSGI configuration this
>> bundle(org.eclipse.equinox.log) is started, why it's not started with a
>> simple Eclipse configuraton. I've noted that the org.eclipse.equinox.log
>> doesn't have Eclipse-LazyStart: true... Is there an impact? It means that
>> the bundle should start at the begining?
>> Thanks again and sorry for this stupid quesiton.
>> Mickael
>>
>> "Alex Blewitt" <alex_blewitt@yahoo.com> wrote in message
>> news:17714969.1147966549115.JavaMail.root@cp1.javalobby.org...
>>> It's not distributed in the SDK packaging, but you can download them from
>>> the Eclipse/Equinox download page.
>>>
>>> Alex.
>>
>>
|
|
|
Goto Forum:
Current Time: Mon Dec 30 17:58:56 GMT 2024
Powered by FUDForum. Page generated in 0.04163 seconds
|