-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Implement the Singleton pattern for it. A static method in the class
that returns an instance cached in a static variable. For an example,
see any of the Turbine/Fulcrum service classes.

Though George's suggestion of using JCS is probably even better. It's
designed to do pretty much exactly what you're doing.

- -----Original Message-----
From: Edmund Urbani [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:12 PM
To: Turbine Users List
Subject: Re: sharing objects between applications


Scott Brickner wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> "Different contexts" isn't necessarily the same as "different
> JVMs". I think that tomcat uses a single JVM instance for all of
> the
> webapps. They just use different classloaders to keep things from
> "accidentally" interfering with one another. This might be as
> simple as explicitly loading the common class through the system
> classloader.

Even if I manage to access the system classloader (which would
probably be a problem with Tomcat's SecurityManager, but that
should just be a matter of configuring it properly...I hope), I am
not sure
whether this will help, since I still do not have access to the same
instance of a class (which is what I actually need)...
...then again, maybe I could work with static attributes of the
common
class, to get a reference to the same object. Has anybody on this
list ever
tried something like that? ... successfully?

I might give this a try tomorrow or Friday.
Ie. unless somebody has a better idea.

 Edmund



- --
To unsubscribe, e-mail:  
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.2 for non-commercial use <http://www.pgp.com>

iQA/AwUBPP5lvEpqmA4oA4kCEQLT5ACg+9T0tjMCwf0mSJXZ8bafy47wYHwAoLy4
ldhfhsTqoCCVRttjkReRFNfC
=OFGp
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to