cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Deploying multiple instances from a single war
Date Wed, 15 Sep 2010 13:48:19 GMT
Hi Emanuele,

The trick would be to create a custom subclass of Cayenne HessianService, overriding 'initCayenneStack(Map
properties)'. Based on some property value in a properties map, you can load Cayenne stack
from an alternative location (e.g. by renaming one of the cayenne.xml files, and passing it
as a parameter to DefaultConfiguration).

After that map 2 HessianServlets in web.xml using different URLs, passing each a custom "service-class"
parameter, as well as the custom Cayenne stack name parameter. 

This way the same webapp will serve 2 separate Cayenne stacks at different URLs.

HTH,
Andrus


The properties map passed to this service is taken from servlet init parameters in web.xml.
So

On Sep 14, 2010, at 6:51 PM, emanuele@mengozzi.com wrote:

> I have a Swing ROP application, and i had to create another database,
> which is equal to the one im using, and i wasen't able to figureout
> another way to address the other database, cept copying/renaming the
> webapplication war, and changing the Node.driver.xml.
> 
> So far now i got WebApp1.war - > http://..:8080/WebApp1/,  WebApp2.war ->
> http://..:8080/WebApp2/.
> 
> Is there a way to specify in the tomcat Context.xml, which dataDomain to use?
> 
> Thanks in advice,
> 
> Emanuele.
> 
> 
> 
> 


Mime
View raw message