tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Lucia" <timlu...@yahoo.com>
Subject RE: How to create global resources on the fly?
Date Tue, 05 Dec 2006 22:21:11 GMT
My project's ant build.xml takes a 'master context' file and customizes by
build type -- dev, production, qa, etc., by taking a list of datasources
(properties) and applying it to the master context using the <replace ...>
task.

    <target
        name="create-context-descriptor"
        description="Create the context.xml context descriptor from
MasterContext.xml and datasources-*.properties">
        <echo level="verbose">Creating META-INF/context.xml from
'datasources-${build.type}.properties'</echo>
        <copy
            overwrite="false" 
            file="META-INF/MasterContext.xml" 
            tofile="META-INF/context.xml"/>
        <replace
            file="META-INF/context.xml"
            replacefilterfile="datasources-${build.type}.properties"
        />
    </target>    

HTH,
Tim

> -----Original Message-----
> From: Mikolaj Rydzewski [mailto:miki@ceti.pl]
> Sent: Monday, December 04, 2006 10:53 AM
> To: users@tomcat.apache.org
> Subject: How to create global resources on the fly?
> 
> Hi,
> 
> There's one thing I don't like in Tomcat: I have to edit server.xml file
> to add new global resources (i.e. data ource definition). It's not a big
> problem on a production, one doesn't change such things often. But on
> developement server it's quite annoing.
> 
> I don't want to put datasource definition inside META-INF/context.xml.
> There's already resourceLink there (in my case). Sure, I could have two
> versions of context.xml, one for production and the other for dev,
> but... but I dont't want to change that ;-)
> 
> I'd like to be able to: place a small xml file (i.e. resource
> definition, exactly like in the server.xml) in some directory watched by
> Tomcat, and Tomcat to 'deploy' it (create a datasource, mail session,
> etc). Just like it do with resource elements. I think that JBoss has
> that feature, but it's too heavy for my needs.
> 
> I have tried and it is possible to create new datasources via JMX,
> without restarting Tomcat.
> 
> Is there such a tool or I have to write it? ;-)
> 
> There're some promising entries in the server.xml file:
>   <Listener className="org.apache.catalina.core.AprLifecycleListener" />
>   <Listener
> className="org.apache.catalina.mbeans.ServerLifecycleListener" />
>   <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>   <Listener
> className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
> 
> What do you think?
> 
> --
> Mikolaj Rydzewski <miki@ceti.pl>




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message