Thanks Alex.
Unfortunately the status generator uses a ServiceManager object to get
the running mode, which I don't know how to get. Anyway, while
researching I found that there is a RunningModeHelper class, so now I
have this code:
Class Config {
public Config () {
...
String mode =
RunningModeHelper.determineRunningMode(null);
Settings settings = new MutableSettings(mode);
...
}
}
mode has actually the current running mode ("local"), but the properties
list within the settings object is empty. I know that the "local"
property files are loaded succesfully by the Cocoon Spring Configurator,
so I guess it's a problem with the instantiation of the Settings class.
Do I need to define Settings as a bean in core.xml, in order to use it?
Or something else? I'm quite new to Spring and Cocoon 2.2
> -----Mensaje original-----
> De: Alexander Daniel [mailto:[EMAIL PROTECTED]
> Enviado el: viernes, 10 de octubre de 2008 9:38
> Para: [email protected]
> Asunto: Re: Cocoon Configuration API usage - how to get running mode?
>
> On 10.10.2008, at 09:18, Perez Guerrero, Antonio Javier wrote:
> > How can I read spring managed properties from Java, without defining
> > my classes as beans?
> >
> > I've tried using org.apache.cocoon.configuration.MutableSettings,
> > which has all the methods that I need... But I cannot instantiate it
> > because I don't know how to determine the current running mode. Any
> > ideas on how to achieve it?
> >
>
> Unfortunately I don't know how to achieve that. But you could have a
> look into the source of the status generator which outputs the running
> mode.
>
> Alex
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]