[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    RE: Use the same singleton class for two different services
From:       "Robert Lowe" <rmlowe () rmlowe ! com>
Date:       2004-04-30 5:04:36
Message-ID: EDENIDOKJIAFDKIPFAHPCEIKLNAA.rmlowe () rmlowe ! com
[Download RAW message or body]

Are you deploying two copies of Axis as separate Web applications? If so,
each will get its own classloader, so if the class that contains your static
files is loaded by the Web app's class loader, you'll have two copies of the
static variable.

One way around this is deploy the relevant class in the shared lib directory
of your Web container. For example, using Tomcat, put your JAR file in
shared/lib instead of webapps/axis/WEB-INF/lib.


Best regards,

Robert Lowe
http://RMLowe.com/



-----Original Message-----
From: Daniel Olmedilla [mailto:olmedilla@learninglab.de]
Sent: Wednesday, April 28, 2004 7:15 AM
To: axis-user@ws.apache.org
Subject: Use the same singleton class for two different services


Hi,

I am using axis to provide 2 different services: service1 and service2. The
1st service implements the interface1 and the 2nd one implements the
interface2.

I implemented a class (called App) which implements both interfaces with a
static singleton class. The idea is that both services would share the same
variable (in my case a HashMap with properties that could change during the
execution of the program). I created then two different wsdd and deployed
both services. Everything works fine except because of it seems that each
service runs in a different process and the singleton HashMap is not shared,
so the information service1 introduces on the HashMap is not available in
the
HashMap of service2.

How is it possible to have 2 different services and to share one variable
between both services?

Thanks in advance,

	DOC
--
     Daniel Olmedilla
     Learning Lab Lower Saxony (L3S)
     Deutscher Pavillon
     Expo plaza 1
     D - 30539 Hannover

     Phone: +49 (0)511 762.97.41
     Fax:     +49 (0)511 762.97.79

     http://www.learninglab.de/~olmedilla/
     E-Mail: olmedilla@learninglab.de


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic