Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 65429 invoked from network); 16 Jun 2003 01:16:13 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 16 Jun 2003 01:16:13 -0000 Received: (qmail 21325 invoked by uid 97); 16 Jun 2003 01:18:38 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 21318 invoked from network); 16 Jun 2003 01:18:38 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 16 Jun 2003 01:18:38 -0000 Received: (qmail 64010 invoked by uid 500); 16 Jun 2003 01:15:59 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 63997 invoked from network); 16 Jun 2003 01:15:58 -0000 Received: from sid.armstrong.com (204.74.20.252) by daedalus.apache.org with SMTP; 16 Jun 2003 01:15:58 -0000 Received: from joedog.org (pcp01470022pcs.lncstr01.pa.comcast.net [68.82.237.147]) by sid.armstrong.com (8.12.8p1/8.12.8) with ESMTP id h5G1AiM0000610 for ; Sun, 15 Jun 2003 20:10:45 -0500 Message-ID: <3EED1A48.4060306@joedog.org> Date: Sun, 15 Jun 2003 21:15:52 -0400 From: Tim Funk Organization: Human being User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en, es-mx, de, sv MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Singleton across multiple contexts References: <3EEC8F01.5030201@terra.es> <3EECA103.10603@joedog.org> <3EECB6D7.8090107@terra.es> In-Reply-To: <3EECB6D7.8090107@terra.es> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Place the jar (or class) in common/lib (or common/classes) and all will be "ok". That is - until you need to make a change to your singleton class (or a class used by it) - in which case you will need to restart tomcat. (and not restart your webapp) -Tim Antonio Fiol Bonn�n wrote: > This is the best I could find: > -------------- > Each application is loaded with sepperate classloaders, so as long as the > servlets are in the same application and the singleton is in it's classpath > too it works. > -------------- > > My singleton has to work *across* applications. > > Any ideas? > > > Thank you very much. > > > Antonio Fiol > > > > Tim Funk wrote: > >> Look in the archives and search for past Singleton discussions. >> >> http://marc.theaimsgroup.com/?l=tomcat-user&w=2&r=1&s=singleton&q=b >> http://marc.theaimsgroup.com/?l=tomcat-dev&w=2&r=1&s=singleton&q=b >> >> Otherwise ... >> - EJB (???) >> - Use a custom JNDI Factory (see tomcat jndi docs) >> >> -Tim >> >> Antonio Fiol Bonn�n wrote: >> >>> Hello, >>> >>> This question is probably not specific to Tomcat, but a >>> Tomcat-specific answer could well suit my needs. >>> >>> I have an application which I have split in several different >>> contexts. I have done so, to allow different kinds of access to the >>> app, depending on the web server the requests are coming from. >>> >>> However, I need a common unique component that "ties" all the >>> contexts together. >>> >>> There must be a *single* instance of this component, otherwise >>> inconsistencies or duplicate work might arise. OTOH, it must be >>> accessible from all the contexts. >>> >>> Calls to this component are very simple (calls to void methods) but >>> moderately frequent. >>> >>> I have thought of several possibilities: >>> >>> - Extract the component into a separate JVM, and connect to it via >>> socket. >>> - Extract the component into another context, and connect to it via >>> HTTP. >>> --- I like none of those. >>> >>> - Create the instance from the first context needing it, and making >>> it available to all of them. >>> --- I like this best, but I have no idea of how to do that. >>> >>> >>> Yours sincerely, >>> >>> >>> Antonio Fiol >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org