You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2008/02/19 09:39:20 UTC
[RT] Running Modes
Hi,
what do you think about supporting running modes in Sling?
I'm thinking of providing different configuration sets for different
environments and having an easy way of switching.
One use case is to a have a pre-defined "development" running mode
where for example logging is set to debug mode, or some configuration
settings for services are set to a more developer friendly way like
caching turned off etc.
Now, support of running modes in non OSGi environments is much easier
than supporting it in an OSGi env where services come from various
bundles and might be optional etc.
So, I would like to get your opinion if you think that this is useful
for OSGi environments at all.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [RT] Running Modes
Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Feb 19, 2008 9:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>
>> ...what do you think about supporting running modes in Sling?...
>
> Might be useful but also confusing in some cases.
>
> I'm ok to discuss and specify that, but I would postpone implementing
> until we have a release out.
>
Oh, yes - sorry, forgot to mention this :)
Yes, if at all I see this as a long term goal which has to be done very
carefully and need some time to think out.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [RT] Running Modes
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Feb 19, 2008 9:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...what do you think about supporting running modes in Sling?...
Might be useful but also confusing in some cases.
I'm ok to discuss and specify that, but I would postpone implementing
until we have a release out.
-Bertrand
Re: [RT] Running Modes
Posted by Carsten Ziegeler <cz...@apache.org>.
Tobias Bocanegra wrote:
> what running modes do you have in mind? if just 'DEBUG' and 'NORMAL' i
> suggest to
> use system properties.
>
I guess those two are the most common. I would like to have some default
configuration for these modes already provided. So the only thing you
have to do via a system property would be to switch the running mode.
With OSGi we should also be able to switch the running mode at
runtime...but I don't think that we really need this.
We've added such a support to Cocoon some time ago, and there you
specify the running mode by a system property and each jar file can
provide configuration values for a running mode (by using a convention
path to find these property files). So providing a different
configuration for a running mode is just dropping a jar into the
classpath. (We can also overwrite spring bean definitions in an easy and
convenient way.) With OSGi this could perhaps be just installing a bundle.
Now, I could imagine to have more than one running mode, like one for
testing where you have a different setup, or different debug settings.
If we are able to provide running modes it shouldn't matter if we
support two or more.
Perhaps we don't need this, but once you have a set of services that
provide lets say special debug settings, it's really convenient to just
switch all of them into debug mode (or verbose mode) by setting one
single property. Another example apart from logging is to change the
output of the json writer to pretty print and nicely indent the data
which makes checking the output much easier.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [RT] Running Modes
Posted by Tobias Bocanegra <to...@day.com>.
what running modes do you have in mind? if just 'DEBUG' and 'NORMAL' i
suggest to
use system properties.
regards, toby
On 2/19/08, Carsten Ziegeler <cz...@apache.org> wrote:
> Bertrand Delacretaz wrote:
> > On Feb 19, 2008 9:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> >
> >> ...One use case is to a have a pre-defined "development" running mode
> >> where for example logging is set to debug mode, or some configuration
> >> settings for services are set to a more developer friendly way like
> >> caching turned off etc....
> >
> > We could simply use properties files named sling-RRRR.properties,
> > where RRRR is the running mode name, look for them in the current
> > directory and in the classpath, and override standard settings with
> > their values.
> >
> > That sounds useful and easy to implement and use.
> >
> Yes, something along these lines. The reading part is easy :) applying
> the configuration might be more complicated as we have to go through the
> config admin service.
>
> Carsten
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---
Re: [RT] Running Modes
Posted by Carsten Ziegeler <cz...@apache.org>.
Bertrand Delacretaz wrote:
> On Feb 19, 2008 9:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>
>> ...One use case is to a have a pre-defined "development" running mode
>> where for example logging is set to debug mode, or some configuration
>> settings for services are set to a more developer friendly way like
>> caching turned off etc....
>
> We could simply use properties files named sling-RRRR.properties,
> where RRRR is the running mode name, look for them in the current
> directory and in the classpath, and override standard settings with
> their values.
>
> That sounds useful and easy to implement and use.
>
Yes, something along these lines. The reading part is easy :) applying
the configuration might be more complicated as we have to go through the
config admin service.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [RT] Running Modes
Posted by Bertrand Delacretaz <bd...@apache.org>.
On Feb 19, 2008 9:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...One use case is to a have a pre-defined "development" running mode
> where for example logging is set to debug mode, or some configuration
> settings for services are set to a more developer friendly way like
> caching turned off etc....
We could simply use properties files named sling-RRRR.properties,
where RRRR is the running mode name, look for them in the current
directory and in the classpath, and override standard settings with
their values.
That sounds useful and easy to implement and use.
-Bertrand
Re: [RT] Running Modes
Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi,
>
> Am Dienstag, den 19.02.2008, 09:39 +0100 schrieb Carsten Ziegeler:
>> Hi,
>>
>> what do you think about supporting running modes in Sling?
>> I'm thinking of providing different configuration sets for different
>> environments and having an easy way of switching.
>> One use case is to a have a pre-defined "development" running mode
>> where for example logging is set to debug mode, or some configuration
>> settings for services are set to a more developer friendly way like
>> caching turned off etc.
>>
>> Now, support of running modes in non OSGi environments is much easier
>> than supporting it in an OSGi env where services come from various
>> bundles and might be optional etc.
>>
>> So, I would like to get your opinion if you think that this is useful
>> for OSGi environments at all.
>
> Configuration comes from the ConfigurationAdmin Service. I suggest, that
> we would base an implementation of such a feature on the Configuration
> Admin Service. We might well think of actually provide such an extension
> in the Apache Felix Configuration Admin implementation.
>
> This would be something like a "configuration switch".
>
Yes, my first thoughts were providing the configuration to the config
admin service, but obviously this creates problems as switching back
would be difficult (switching back to what is the problem there).
But yes, if we would add support to the config admin itself, it could work.
This would be something like a configuration overwrite. The service
reads the usual config from the persistent store and before providing
the config to the services overwrites values from the running mode.
The only problem could be if someone tries to change the config through
the admin service.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: [RT] Running Modes
Posted by Felix Meschberger <fm...@gmail.com>.
Hi,
Am Dienstag, den 19.02.2008, 09:39 +0100 schrieb Carsten Ziegeler:
> Hi,
>
> what do you think about supporting running modes in Sling?
> I'm thinking of providing different configuration sets for different
> environments and having an easy way of switching.
> One use case is to a have a pre-defined "development" running mode
> where for example logging is set to debug mode, or some configuration
> settings for services are set to a more developer friendly way like
> caching turned off etc.
>
> Now, support of running modes in non OSGi environments is much easier
> than supporting it in an OSGi env where services come from various
> bundles and might be optional etc.
>
> So, I would like to get your opinion if you think that this is useful
> for OSGi environments at all.
Configuration comes from the ConfigurationAdmin Service. I suggest, that
we would base an implementation of such a feature on the Configuration
Admin Service. We might well think of actually provide such an extension
in the Apache Felix Configuration Admin implementation.
This would be something like a "configuration switch".
Regards
Felix