Re: Servlet inter-communication

2006-05-06 Thread Michael Echerer
Samuli Elomaa wrote: Hi, Is there any otherway for two servlets in same tomcat to communicate together except by http requests? Eg. could two servlets use somekind of shared memory? or send signals to each other? Hi, whatever others suggested, just use the Servlet Spec 2.3+ standard: The

Re: Servlet inter-communication

2006-05-04 Thread Antonio Petrelli
Leon Rosenberg ha scritto: Hmm... instead of using a 3-liner I'm supposed to plug in a whole container, even a lightweight one? What will come next? Installing Jboss for config-file-reading? You know; i really liked singleton when I used to be a Swing programmer. But it raises a serious

Servlet inter-communication

2006-05-03 Thread Samuli Elomaa
Hi, Is there any otherway for two servlets in same tomcat to communicate together except by http requests? Eg. could two servlets use somekind of shared memory? or send signals to each other? Samuli - To unsubscribe,

RE: Servlet inter-communication

2006-05-03 Thread Thomas Bolding
might help you. Regards Thomas -Original Message- From: Samuli Elomaa [mailto:[EMAIL PROTECTED] Sent: 3. maj 2006 09:57 To: Tomcat Users List Subject: Servlet inter-communication Hi, Is there any otherway for two servlets in same tomcat to communicate together except by http requests? Eg

Re: Servlet inter-communication

2006-05-03 Thread Antonio Petrelli
Thomas Bolding ha scritto: Indeed. If it is within the same context this is trivial - look into singleton design pattern. It's a bad idea to use singletons in a web application, especially when the application needs to be reloaded (this is one of the causes that make lots of people write

RE: Servlet inter-communication

2006-05-03 Thread Peter Crowther
From: Samuli Elomaa [mailto:[EMAIL PROTECTED] Is there any otherway for two servlets in same tomcat to communicate together except by http requests? Eg. could two servlets use somekind of shared memory? or send signals to each other? Both could in theory rendezvous at a common filename.

Re: Servlet inter-communication

2006-05-03 Thread Samuli Elomaa
Thanks, Solved the problem by using singleton, hopefully I won't end up with deadlock in somepoint. Samuli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Servlet inter-communication

2006-05-03 Thread gslt
From: Samuli Elomaa [mailto:[EMAIL PROTECTED] Is there any otherway for two servlets in same tomcat to communicate together except by http requests? Eg. could two servlets use somekind of shared memory? or send signals to each other? Both could in theory rendezvous at a common filename.

Re: Servlet inter-communication

2006-05-03 Thread Stas Ostapenko
How about JMS stuff ? For example Commons Messenger - http://jakarta.apache.org/commons/sandbox/messenger/. Does anybody used it ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Servlet inter-communication

2006-05-03 Thread Leon Rosenberg
On 5/3/06, Antonio Petrelli [EMAIL PROTECTED] wrote: Thomas Bolding ha scritto: Indeed. If it is within the same context this is trivial - look into singleton design pattern. It's a bad idea to use singletons in a web application, especially when the application needs to be reloaded (this is

RE: Servlet inter-communication

2006-05-03 Thread Peter Crowther
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Could you explain it a bit more? What's the difference whether I have 10 instances of the same class or just one for reloading? In a Singleton: - the class holds a reference to the classloader; - the class holds a reference to the singleton

Re: Servlet inter-communication

2006-05-03 Thread Leon Rosenberg
On 5/3/06, Peter Crowther [EMAIL PROTECTED] wrote: From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Could you explain it a bit more? What's the difference whether I have 10 instances of the same class or just one for reloading? In a Singleton: - the class holds a reference to the classloader;

RE: Servlet inter-communication

2006-05-03 Thread Peter Crowther
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] I mean reloading a webapp in production environment is a greater nogo than using a singleton, isn't it? Given the number of posts in here about OOMEs over the last year or so that have been traced down to running out of PermGen due to reloading

Re: Servlet inter-communication

2006-05-03 Thread Darryl Miles
Maybe a useful URL to help address this matter when it bites, look for the java code in the forum thread: http://forum.hibernate.org/viewtopic.php?t=935948start=150 Something to put at the end of your javax.servlet.ServletContextListener#contextDestroyed(ServletContextEvent). Abstracting

Re: Servlet inter-communication

2006-05-03 Thread Leon Rosenberg
On 5/3/06, Antonio Petrelli [EMAIL PROTECTED] wrote: Leon Rosenberg ha scritto: Even if it doesn't, is this a real problem? I mean reloading a webapp in production environment is a greater nogo than using a singleton, isn't it? Yes it is! In our case we have an webapp update system that

Re: Servlet inter-communication

2006-05-03 Thread Leon Rosenberg
On 5/3/06, Darryl Miles [EMAIL PROTECTED] wrote: Maybe a useful URL to help address this matter when it bites, look for the java code in the forum thread: http://forum.hibernate.org/viewtopic.php?t=935948start=150 Something to put at the end of your