tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Communicating between webapps
Date Thu, 09 Oct 2008 08:36:37 GMT
Leon Rosenberg wrote:
> On Thu, Oct 9, 2008 at 9:59 AM, André Warnier <> wrote:
>> I realise that this can be done via e.g. an external DB.
>> It could also probably be done, most portably, by creating an entirely
>> separate application accessed via HTTP calls e.g. (à la "Amazon DB" ?).
>> But it looks as if "within the same container", it would be much more
>> efficient if kept in local memory, and avoiding overhead like TCP/IP or JDBC
>> or RMI.
>> Not being an expert in any of the underlying matters, I would just like to
>> know from the eperts here, but preferably without too many difficult words
>> like "classloader" and "dispatchers", if this is in theory possible/allowed,
>> if it could be done in such a way as to be portable to a different container
>> etc..
> Well, it is possible by placing stuff in shared/lib and access it from
> different contextes, but it will make your life extremely complicated,
> especially if you start to reload applications on the fly, probably
> causing an outofmemory exception at some point.
> On the other side an rmi connection on the local machine is extremely
> cheap (same applies to corba), if you make one call to rmi (or corba)
> in one request to the application you won't even be able to measure
> the transport overhead (far below 1 ms), and taking in account that
> transport from browser to server is much much slower, you can ignore
> the overhead. The overhead of http or soap is much higher due to
> larger footprint of the call, parsing, connection issues (you have to
> reconnect or handle keep alives yourself) and so on.
> Behind your rmi service you can have an external db or just a hashmap
> (concurrent one) or whatever serves best.
> To sum it up, the TOC (total cost of ownership) of an RMI service are
> much much lower as of most other solutions.
Many thanks.
So, assuming that I am now convinced by RMI (Remote Method Invocation 
?), how would such a scheme be implemented ?
Are you talking about a separate daemon, running on the same host, which 
would "offer RMI services" to all these webapps ?
Or would this "thing" be living inside Tomcat ? If so, what kind of 
"thing" would this be ? It would, I guess, have to start before the 
webapps do, load its original data, then remain there waiting for client 
webapp RMI calls, yes ?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message