You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Richard S. Hall" <he...@ungoverned.org> on 2008/10/07 22:25:12 UTC

Felix profile directories

I am going to be making some changes to how Felix creates bundle caches.

Currently, when you create an instance of Felix it needs one of the 
following pieces of information to create a bundle cache:

    * Profile name - in which case it creates a directory named after
      the profile name inside the default "~/.felix" profile directory
      for caching bundles (you can also specify a cache directory and a
      profile name) or
    * Profile directory - in which case it caches the bundles in the
      specified directory directly.

The change that I want to make is so that it is possible to start Felix 
without specifying any information, in which case it would default to 
creating a bundle cache directory (e.g., "felix-cache") in the current 
working directory.

This change seems simple enough, but then I started to wonder about the 
profile notion altogether. I wonder if people feel we should keep the 
profile notion or get rid of it. If we got rid of it, we could still 
have something similar.

For example, we could modify the launcher to ask for a cache directory, 
instead of a profile name. The resulting behavior would be something like:

   1. If the user just hits return (i.e., doesn't specify anything) then
      the default "felix-cache" directory is created/used in the current
      working directory.
   2. If the user types a simple name (e.g., "mycache") then a
      corresponding directory is created/used in the current working
      directory.
   3. If the user types an absolute directory name, then that directory
      is used/created for the bundle cache.

If the user wanted a similar "profile" experience just use simple names, 
where the main difference is that the profiles are kept locally. If you 
want profiles kept globally, then just specify the full path.

The profile notion is merely a convenience and we could still mimic it 
completely in the launcher if people still like it as a convenience, so 
it is not necessarily an either-or situation. But if most people do not 
find the profile concept useful, then there is no reason to keep 
dragging it along since I will be making changes in this area now.

It would also be possible to go further an not have the launcher be 
interactive at all and only accept this information through properties.

I know that Oscar had "profiles" since the beginning, but that doesn't 
mean that we cannot question them. :-)

Thoughts?

-> richard

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


Re: Felix profile directories

Posted by Marcel Offermans <ma...@luminis.nl>.
On Oct 7, 2008, at 22:25 , Richard S. Hall wrote:

> The change that I want to make is so that it is possible to start  
> Felix without specifying any information, in which case it would  
> default to creating a bundle cache directory (e.g., "felix-cache")  
> in the current working directory.

I think this is a good change. Not having to enter any information  
when starting Felix is a big plus to me. In fact, during development,  
this is what we do most of the time (we use a script that supplies  
that information and creates a "cache" directory in the current  
directory).

For deployment, what we do is mostly dependent on the target platform  
(is it embedded, is it a desktop, is there a user present, etc..).  
That means most of the time we write a custom launcher.

> This change seems simple enough, but then I started to wonder about  
> the profile notion altogether. I wonder if people feel we should  
> keep the profile notion or get rid of it. If we got rid of it, we  
> could still have something similar.

I'd say, get rid of it, just allow the user to specify the cache  
directory, like you propose. That would be more than enough for me.

On the other hand, I don't think all of this is a big deal. If I had  
to choose, I'd say not having to enter anything when starting Felix is  
a bigger deal to me because that's a step that people who are "new" to  
Felix have to do (and they might not understand or care too much in a  
lot of scenarios).

Greetings, Marcel


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


Re: Felix profile directories

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Sahoo wrote:
> I definitely like the idea of starting Felix without specifying any 
> profile information, but I don't like programs writing to CWD. It's 
> very easy to forget to delete such directories and several such 
> directories are scattered through out the file system. A better 
> alternative is to write to either a default directory inside felix 
> installation directory or in /tmp. More over, when Felix is started 
> without any profile or cache dir information, the default behavior 
> should be to flush the cache upon restart. So, may be Felix can create 
> a temporary cache dir at startup and deleting it at program exit.

As I mentioned in a separate message, I am not keen on a global default. 
With configuration properties, it would be very easy to achieve what you 
want, even with the current implementation.

Regarding cache flush, like Marcel, I don't think it should be the 
default behavior, but it could certainly be a configurable option.

Regarding the purpose of this thread, I certainly don't mind hearing 
people's opinions. I know this issue will likely be a bike shed issue, 
but mostly I want to make sure that the community isn't totally against 
changes in this area. I will listen to people's opinions and try to do 
something reasonable.

-> richard

>
> Thanks,
> Sahoo
>
> ---------------------------------------------------------------------
> 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: Felix profile directories

Posted by Marcel Offermans <ma...@luminis.nl>.
> I definitely like the idea of starting Felix without specifying any  
> profile information, but I don't like programs writing to CWD. It's  
> very easy to forget to delete such directories and several such  
> directories are scattered through out the file system. A better  
> alternative is to write to either a default directory inside felix  
> installation directory or in /tmp. More over, when Felix is started  
> without any profile or cache dir information, the default behavior  
> should be to flush the cache upon restart. So, may be Felix can  
> create a temporary cache dir at startup and deleting it at program  
> exit.

I'm not sure if Richard intended this thread as an opinion gathering  
thread or a discussion thread, but I don't agree with "degrading" the  
cache to something that should be written to a /tmp folder, nor would  
I like the default behaviour to be to flush the cache. The spec  
clearly intends the cache to be something that is persistent, and the  
framework should normally startup in the same state you left it. Not  
having this behaviour by default promotes the wrong model.

Greetings, Marcel


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


Re: Felix profile directories

Posted by Sahoo <sa...@sun.com>.

Richard S. Hall wrote:
> I am going to be making some changes to how Felix creates bundle caches.
>
> Currently, when you create an instance of Felix it needs one of the 
> following pieces of information to create a bundle cache:
>
>    * Profile name - in which case it creates a directory named after
>      the profile name inside the default "~/.felix" profile directory
>      for caching bundles (you can also specify a cache directory and a
>      profile name) or
>    * Profile directory - in which case it caches the bundles in the
>      specified directory directly.
>
> The change that I want to make is so that it is possible to start 
> Felix without specifying any information, in which case it would 
> default to creating a bundle cache directory (e.g., "felix-cache") in 
> the current working directory.
I definitely like the idea of starting Felix without specifying any 
profile information, but I don't like programs writing to CWD. It's very 
easy to forget to delete such directories and several such directories 
are scattered through out the file system. A better alternative is to 
write to either a default directory inside felix installation directory 
or in /tmp. More over, when Felix is started without any profile or 
cache dir information, the default behavior should be to flush the cache 
upon restart. So, may be Felix can create a temporary cache dir at 
startup and deleting it at program exit.

Thanks,
Sahoo

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


Re: Felix profile directories

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Richard S. Hall schrieb:
> The change that I want to make is so that it is possible to start Felix
> without specifying any information, in which case it would default to
> creating a bundle cache directory (e.g., "felix-cache") in the current
> working directory.

Sounds usefull.

I just recently used the Felix launcher again (having forgot about all
that stuff because I always used the Sling launcher) and was trapped
into finding, where the actual stuff would be going ... Well I found
out, but ... ;-)

> 
> This change seems simple enough, but then I started to wonder about the
> profile notion altogether. I wonder if people feel we should keep the
> profile notion or get rid of it. If we got rid of it, we could still
> have something similar.
> 
> For example, we could modify the launcher to ask for a cache directory,
> instead of a profile name. The resulting behavior would be something like:
> 
>   1. If the user just hits return (i.e., doesn't specify anything) then
>      the default "felix-cache" directory is created/used in the current
>      working directory.
>   2. If the user types a simple name (e.g., "mycache") then a
>      corresponding directory is created/used in the current working
>      directory.
>   3. If the user types an absolute directory name, then that directory
>      is used/created for the bundle cache.

Agreed, except that I would not prompt for entry but either interpret a
special argument to the launcher or a environment variable or so...

Regards
Felix

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


Re: Felix profile directories

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Ok, I would like to call everyone's attention to the changes around 
Felix' bundle cache and its launcher. For more details, please check out:

    https://issues.apache.org/jira/browse/FELIX-754

I think the new approach is pretty slick. We will address cache cleaning 
separately.

-> richard

Richard S. Hall wrote:
> I am going to be making some changes to how Felix creates bundle caches.
>
> Currently, when you create an instance of Felix it needs one of the 
> following pieces of information to create a bundle cache:
>
>    * Profile name - in which case it creates a directory named after
>      the profile name inside the default "~/.felix" profile directory
>      for caching bundles (you can also specify a cache directory and a
>      profile name) or
>    * Profile directory - in which case it caches the bundles in the
>      specified directory directly.
>
> The change that I want to make is so that it is possible to start 
> Felix without specifying any information, in which case it would 
> default to creating a bundle cache directory (e.g., "felix-cache") in 
> the current working directory.
>
> This change seems simple enough, but then I started to wonder about 
> the profile notion altogether. I wonder if people feel we should keep 
> the profile notion or get rid of it. If we got rid of it, we could 
> still have something similar.
>
> For example, we could modify the launcher to ask for a cache 
> directory, instead of a profile name. The resulting behavior would be 
> something like:
>
>   1. If the user just hits return (i.e., doesn't specify anything) then
>      the default "felix-cache" directory is created/used in the current
>      working directory.
>   2. If the user types a simple name (e.g., "mycache") then a
>      corresponding directory is created/used in the current working
>      directory.
>   3. If the user types an absolute directory name, then that directory
>      is used/created for the bundle cache.
>
> If the user wanted a similar "profile" experience just use simple 
> names, where the main difference is that the profiles are kept 
> locally. If you want profiles kept globally, then just specify the 
> full path.
>
> The profile notion is merely a convenience and we could still mimic it 
> completely in the launcher if people still like it as a convenience, 
> so it is not necessarily an either-or situation. But if most people do 
> not find the profile concept useful, then there is no reason to keep 
> dragging it along since I will be making changes in this area now.
>
> It would also be possible to go further an not have the launcher be 
> interactive at all and only accept this information through properties.
>
> I know that Oscar had "profiles" since the beginning, but that doesn't 
> mean that we cannot question them. :-)
>
> Thoughts?
>
> -> richard
>
> ---------------------------------------------------------------------
> 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