You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Houtman, Roland" <Ro...@nl.yokogawa.com> on 2009/08/20 16:13:28 UTC

Startlevel doesn't seem to be recorded

I'm trying to use a StartLevel to differentiate 
Between a default installed framework and the 
Actual installed apps.

With the standard Felix-1.8.0 app,
I've tried the 'startlevel 2' shell command and then using 'install
<url>' & 'start' 
But the startlevel doesn't get recorded with the bundle

I've also tried
    public void setStartLevel(BundleContext ctx, int level){
      ServiceReference mRef =
ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class.get
Name());
      org.osgi.service.startlevel.StartLevel mStartLevel =
(org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
      if (mStartLevel != null){
        mStartLevel.setStartLevel(level);
      }
      int x = mStartLevel.getStartLevel();
      ctx.ungetService(mRef);
    }
Without any clue why tha value isn't recorded

Thanks,
Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Startlevel doesn't seem to be recorded

Posted by "Houtman, Roland" <Ro...@nl.yokogawa.com>.
Thanks very much!
I don't need the shell immediately, but I can surely learn from your
implementation !
I will ofcourse use the updated shell when it arrives

Kind regards,
Roland

-----Original Message-----
From: Richard S. Hall [mailto:heavy@ungoverned.org] 
Sent: donderdag 20 augustus 2009 18:42
To: users@felix.apache.org
Subject: Re: Startlevel doesn't seem to be recorded

FYI:

I just committed a patch to shell which will allow you to set the
initial bundle start level like this:

     bundlelevel -i <level>

So, the next release of the shell will have this feature...if you need
it now, I deployed a snapshot release in maven or you can build it from
scratch.

-> richard

On 8/20/09 12:20, Richard S. Hall wrote:
> On 8/20/09 10:50, Houtman, Roland wrote:
>> Hi Richard,
>>
>> I've read :
>>     from 'Interface StartLevel'
>>     for 'setInitialBundleStartLevel()'
>>     'When a Bundle is installed via BundleContext.installBundle, it 
>> is assigned the initial bundle start level value.'
>>
>> I was hoping this would do the same trick as 'bundlelevel<level> 
>> <bundleid>' , because I don't have control in what startlevel OBR 
>> assigns.
>
> Neither 'startlevel' or 'bundlelevel' controls the initial bundle 
> start level. We actually don't have a command for that, although it 
> makes sense. The only way to set the initial bundle start level is 
> setting a configuration property in config.properties:
>
>     felix.startlevel.bundle=<n>
>
>> About 'The<startlevel>  command sets the active start level for the 
>> framework.'
>> What is the difference between a framework startlevel and the bundle 
>> startlevel,
>>   What can a framework-startlevel be used for ?
>
> The framework start level is THE start level, just like changing the 
> run level in UNIX. So, when you do 'startlevel' you are changing the 
> current level of the framework, which could impact lots of bundles.
> Doing 'bundlelevel' only sets the specified bundle's start level, 
> which will only impact that bundle if the specified start level is 
> greater/less than the current framework start level.
>
> -> richard
>
>> Regards,
>> Roland
>>
>> -----Original Message-----
>> From: Richard S. Hall [mailto:heavy@ungoverned.org]
>> Sent: donderdag 20 augustus 2009 16:20
>> To: users@felix.apache.org
>> Subject: Re: Startlevel doesn't seem to be recorded
>>
>> If you want to set the start level associated with a bundle, you must
>> do:
>>
>>       bundlelevel<level> <bundle-id>  ...
>>
>> The 'startlevel' command sets the active start level for the
framework.
>>
>> ->  richard
>>
>> On 8/20/09 10:13, Houtman, Roland wrote:
>>> I'm trying to use a StartLevel to differentiate Between a default 
>>> installed framework and the Actual installed apps.
>>>
>>> With the standard Felix-1.8.0 app,
>>> I've tried the 'startlevel 2' shell command and then using 'install
>>> <url>'&   'start'
>>> But the startlevel doesn't get recorded with the bundle
>>>
>>> I've also tried
>>>       public void setStartLevel(BundleContext ctx, int level){
>>>         ServiceReference mRef =
>>> ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class
>>> .g
>>> et
>>> Name());
>>>         org.osgi.service.startlevel.StartLevel mStartLevel = 
>>> (org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
>>>         if (mStartLevel != null){
>>>           mStartLevel.setStartLevel(level);
>>>         }
>>>         int x = mStartLevel.getStartLevel();
>>>         ctx.ungetService(mRef);
>>>       }
>>> Without any clue why tha value isn't recorded
>>>
>>> Thanks,
>>> Roland
>>>
>>>
>>> --------------------------------------------------------------------
>>> - To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Startlevel doesn't seem to be recorded

Posted by "Richard S. Hall" <he...@ungoverned.org>.
FYI:

I just committed a patch to shell which will allow you to set the 
initial bundle start level like this:

     bundlelevel -i <level>

So, the next release of the shell will have this feature...if you need 
it now, I deployed a snapshot release in maven or you can build it from 
scratch.

-> richard

On 8/20/09 12:20, Richard S. Hall wrote:
> On 8/20/09 10:50, Houtman, Roland wrote:
>> Hi Richard,
>>
>> I've read :
>>     from 'Interface StartLevel'
>>     for 'setInitialBundleStartLevel()'
>>     'When a Bundle is installed via BundleContext.installBundle, it
>> is assigned the initial bundle start level value.'
>>
>> I was hoping this would do the same trick as 'bundlelevel<level>
>> <bundleid>' ,
>> because I don't have control in what startlevel OBR assigns.
>
> Neither 'startlevel' or 'bundlelevel' controls the initial bundle 
> start level. We actually don't have a command for that, although it 
> makes sense. The only way to set the initial bundle start level is 
> setting a configuration property in config.properties:
>
>     felix.startlevel.bundle=<n>
>
>> About 'The<startlevel>  command sets the active start level for the
>> framework.'
>> What is the difference between a framework startlevel and the bundle
>> startlevel,
>>   What can a framework-startlevel be used for ?
>
> The framework start level is THE start level, just like changing the 
> run level in UNIX. So, when you do 'startlevel' you are changing the 
> current level of the framework, which could impact lots of bundles. 
> Doing 'bundlelevel' only sets the specified bundle's start level, 
> which will only impact that bundle if the specified start level is 
> greater/less than the current framework start level.
>
> -> richard
>
>> Regards,
>> Roland
>>
>> -----Original Message-----
>> From: Richard S. Hall [mailto:heavy@ungoverned.org]
>> Sent: donderdag 20 augustus 2009 16:20
>> To: users@felix.apache.org
>> Subject: Re: Startlevel doesn't seem to be recorded
>>
>> If you want to set the start level associated with a bundle, you must
>> do:
>>
>>       bundlelevel<level> <bundle-id>  ...
>>
>> The 'startlevel' command sets the active start level for the framework.
>>
>> ->  richard
>>
>> On 8/20/09 10:13, Houtman, Roland wrote:
>>> I'm trying to use a StartLevel to differentiate Between a default
>>> installed framework and the Actual installed apps.
>>>
>>> With the standard Felix-1.8.0 app,
>>> I've tried the 'startlevel 2' shell command and then using 'install
>>> <url>'&   'start'
>>> But the startlevel doesn't get recorded with the bundle
>>>
>>> I've also tried
>>>       public void setStartLevel(BundleContext ctx, int level){
>>>         ServiceReference mRef =
>>> ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class.g
>>> et
>>> Name());
>>>         org.osgi.service.startlevel.StartLevel mStartLevel =
>>> (org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
>>>         if (mStartLevel != null){
>>>           mStartLevel.setStartLevel(level);
>>>         }
>>>         int x = mStartLevel.getStartLevel();
>>>         ctx.ungetService(mRef);
>>>       }
>>> Without any clue why tha value isn't recorded
>>>
>>> Thanks,
>>> Roland
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Startlevel doesn't seem to be recorded

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 8/20/09 10:50, Houtman, Roland wrote:
> Hi Richard,
>
> I've read :	
> 	from 'Interface StartLevel'
> 	for 'setInitialBundleStartLevel()'
> 	'When a Bundle is installed via BundleContext.installBundle, it
> is assigned the initial bundle start level value.'
>
> I was hoping this would do the same trick as 'bundlelevel<level>
> <bundleid>' ,
> because I don't have control in what startlevel OBR assigns.
>    

Neither 'startlevel' or 'bundlelevel' controls the initial bundle start 
level. We actually don't have a command for that, although it makes 
sense. The only way to set the initial bundle start level is setting a 
configuration property in config.properties:

     felix.startlevel.bundle=<n>

> About 'The<startlevel>  command sets the active start level for the
> framework.'
> What is the difference between a framework startlevel and the bundle
> startlevel,
>   What can a framework-startlevel be used for ?
>    

The framework start level is THE start level, just like changing the run 
level in UNIX. So, when you do 'startlevel' you are changing the current 
level of the framework, which could impact lots of bundles. Doing 
'bundlelevel' only sets the specified bundle's start level, which will 
only impact that bundle if the specified start level is greater/less 
than the current framework start level.

-> richard

> Regards,
> Roland
>
> -----Original Message-----
> From: Richard S. Hall [mailto:heavy@ungoverned.org]
> Sent: donderdag 20 augustus 2009 16:20
> To: users@felix.apache.org
> Subject: Re: Startlevel doesn't seem to be recorded
>
> If you want to set the start level associated with a bundle, you must
> do:
>
>       bundlelevel<level>  <bundle-id>  ...
>
> The 'startlevel' command sets the active start level for the framework.
>
> ->  richard
>
> On 8/20/09 10:13, Houtman, Roland wrote:
>    
>> I'm trying to use a StartLevel to differentiate Between a default
>> installed framework and the Actual installed apps.
>>
>> With the standard Felix-1.8.0 app,
>> I've tried the 'startlevel 2' shell command and then using 'install
>> <url>'&   'start'
>> But the startlevel doesn't get recorded with the bundle
>>
>> I've also tried
>>       public void setStartLevel(BundleContext ctx, int level){
>>         ServiceReference mRef =
>> ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class.g
>> et
>> Name());
>>         org.osgi.service.startlevel.StartLevel mStartLevel =
>> (org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
>>         if (mStartLevel != null){
>>           mStartLevel.setStartLevel(level);
>>         }
>>         int x = mStartLevel.getStartLevel();
>>         ctx.ungetService(mRef);
>>       }
>> Without any clue why tha value isn't recorded
>>
>> Thanks,
>> Roland
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


RE: Startlevel doesn't seem to be recorded

Posted by "Houtman, Roland" <Ro...@nl.yokogawa.com>.
Hi Richard,

I've read :	
	from 'Interface StartLevel'
	for 'setInitialBundleStartLevel()'
	'When a Bundle is installed via BundleContext.installBundle, it
is assigned the initial bundle start level value.'

I was hoping this would do the same trick as 'bundlelevel <level>
<bundleid>' , 
because I don't have control in what startlevel OBR assigns.

About 'The <startlevel> command sets the active start level for the
framework.'
What is the difference between a framework startlevel and the bundle
startlevel,
 What can a framework-startlevel be used for ?

Regards,
Roland

-----Original Message-----
From: Richard S. Hall [mailto:heavy@ungoverned.org] 
Sent: donderdag 20 augustus 2009 16:20
To: users@felix.apache.org
Subject: Re: Startlevel doesn't seem to be recorded

If you want to set the start level associated with a bundle, you must
do:

     bundlelevel <level> <bundle-id> ...

The 'startlevel' command sets the active start level for the framework.

-> richard

On 8/20/09 10:13, Houtman, Roland wrote:
> I'm trying to use a StartLevel to differentiate Between a default 
> installed framework and the Actual installed apps.
>
> With the standard Felix-1.8.0 app,
> I've tried the 'startlevel 2' shell command and then using 'install 
> <url>'&  'start'
> But the startlevel doesn't get recorded with the bundle
>
> I've also tried
>      public void setStartLevel(BundleContext ctx, int level){
>        ServiceReference mRef =
> ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class.g
> et
> Name());
>        org.osgi.service.startlevel.StartLevel mStartLevel = 
> (org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
>        if (mStartLevel != null){
>          mStartLevel.setStartLevel(level);
>        }
>        int x = mStartLevel.getStartLevel();
>        ctx.ungetService(mRef);
>      }
> Without any clue why tha value isn't recorded
>
> Thanks,
> Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Startlevel doesn't seem to be recorded

Posted by "Richard S. Hall" <he...@ungoverned.org>.
If you want to set the start level associated with a bundle, you must do:

     bundlelevel <level> <bundle-id> ...

The 'startlevel' command sets the active start level for the framework.

-> richard

On 8/20/09 10:13, Houtman, Roland wrote:
> I'm trying to use a StartLevel to differentiate
> Between a default installed framework and the
> Actual installed apps.
>
> With the standard Felix-1.8.0 app,
> I've tried the 'startlevel 2' shell command and then using 'install
> <url>'&  'start'
> But the startlevel doesn't get recorded with the bundle
>
> I've also tried
>      public void setStartLevel(BundleContext ctx, int level){
>        ServiceReference mRef =
> ctx.getServiceReference(org.osgi.service.startlevel.StartLevel.class.get
> Name());
>        org.osgi.service.startlevel.StartLevel mStartLevel =
> (org.osgi.service.startlevel.StartLevel)ctx.getService(mRef);
>        if (mStartLevel != null){
>          mStartLevel.setStartLevel(level);
>        }
>        int x = mStartLevel.getStartLevel();
>        ctx.ungetService(mRef);
>      }
> Without any clue why tha value isn't recorded
>
> Thanks,
> Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org