basically implement org.apache.tomcat:tomcat-catalina/7.0.x
org.apache.catalina.LifecycleListener interface, doing sthg like:

       if (event.getType() == Lifecycle.START_EVENT && event.getSource()
instanceof Host) {

            System.setProperty("xxx", System.getEnv("..."));
        }

then simply activate it in server.xml (you can also set this listener in
META-INF/context.xml of your war but you'll need to listen even INIT_EVENT
and check source is instanceof Context)

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2013/7/11 mauro2java2011 <[email protected]>
>
> you can please wirte a example ?
> let me says that i would add a variable:
>  $MY_MESSAGE= Hi all user tomee
>
> --------------------------------------
> openejb hook, a simple jar with a singleton deployed through
> > <Deployements/> in
> > tomee.xml...)  ?????????????????????????????????????????
> >
> >
>
>
>
> > it is on trunk, for earlier versions the workaround is to add
> > something
> > started before setting the correct system properties (tomcat
> > Listener,
> > openejb hook, a simple jar with a singleton deployed through
> > <Deployements/> in tomee.xml...)
> >
> >
> > *Romain Manni-Bucau*
> > *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> > *Blog:
> > **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> > *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> > *Github: https://github.com/rmannibucau*
> >
> >
> >
> > 2013/7/11 mauro2java2011 <[hidden email]>
> >
> > > i have think that it is not possible read the variables environment
> > only
> > > with
> > > :
> > >   ${NAME_OF_VARIABLE_ENVIRONMENT}
> > >
> > >
> > > OTher question:
> > >
> > > 2) how i can add variables environments at TOMEE startup?  a esample
> > for
> > > > add
> > > > a variable ?????
> > > > for example : i would add a variable environment named
> > $MYMESSAGE=Hi to
> > > > all
> > > > user of TOMEE
> > > > how i can declare for TOMEE ?
> > > > tank you very much
> > > > Mauro
> > > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
http://openejb.979440.n4.nabble.com/how-set-system-properties-for-datasource-into-resources-xml-from-variables-environments-tp4664217p4664219.html
> > > Sent from the OpenEJB User mailing list archive at Nabble.com.
> > >
> >
> >
> >
> >
> > ______________________________________________________________________
> > If you reply to this email, your message will be added to the
> > discussion below:
> >
http://openejb.979440.n4.nabble.com/how-set-system-properties-for-datasource-into-resources-xml-from-variables-environments-tp4664217p4664220.html
> > To unsubscribe from how set system properties for datasource into
> > resources.xml from variables environments, click here.
> > NAML
>
>
>
>
>
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/how-set-system-properties-for-datasource-into-resources-xml-from-variables-environments-tp4664217p4664221.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to