Bill,

You would think so but it isn't that easy. Which is good to some degree, 
because that would seem like a scary security vulnerability. Nevertheless, 
besides that, Tomcats classloader hierarchy also prevents this mechanism.

It would be useful if there was some form of publish-subscribe message bus that 
one could, well, publish or subscribe to. I realize that JMS falls into this 
category, but JMS is overkill to what I'm referring to.

I recall using a message bus type of approach in a Swing application many moons 
ago. Forget the name of the library now. Had 'bus' in its name, perhaps 
somebody here knows. 

Anyway, from the responses one can tell this isn't an easy peasy no brainer. 
*shrug*


----- Original Message ----
From: Bill Davidson <[EMAIL PROTECTED]>
To: Tomcat Users List <users@tomcat.apache.org>
Sent: Wednesday, October 8, 2008 8:17:56 PM
Subject: Re: Communicating between webapps

Darryl Pentz wrote:
> I have an issue where webapp A needs to let webapp B know about an event, and 
> then return a response to webapp B's processing of that event to the browser. 
> So basically I need to communicate between webapps in the same container.
>
> I have not found a no-brainer solution to this as yet. The one I have tried 
> is making a localhost HTTP call which I find to be rather expensive, given 
> that it requires creating a socket connection to the same container.
>  

Since you're running in the same JVM, I'm not sure why you
can't set up some sort of observer-subject scheme (kind of
like ActionListener if you're familiar with that) so that the apps
can just access each other's object directly.  You can set up a
singleton object to register the observers between webapps.
Just be sure to synchronize properly.

It should be pretty simple to do and dramatically more efficient
than RMI/SOAP or really anything over an IP connection.  It's
hard to beat direct memory access for speed.

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


      

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

Reply via email to