Then the only thing I have to do is to define the class as a bean in my 
core.xml (which is loaded from applicationContext.xml). Nice!
 
Thanks a lot Andre
 
PS: I'm using Cocoon 2.2 and Spring 2.5, I forgot to say it.
 
________________________________


Hi,

if you rely on Cocoon 2.2, then creating classes with Spring would be
the way to go:

Spring 3.*
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/ch04s04.html#beans-factory-scopes-singleton

Spring 2.5.*
http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-factory-scopes-singleton

While most developers with Spring would prefer XML to define their
beans, one can also do so by annotation.

Cheers,
Andre


Perez Guerrero, Antonio Javier wrote:
> Hi,
> 
> Is there any way I can "bind" a class with Cocoon, or make it
> persistent, so it's never destroyed by the garbage collector?
> 
> I've a singleton class containing some data structures (basically
> Maps), which need to be shared between users (so, I can't store them
> in session). I could write the data to a XML file, but I'd really
> prefer to avoid it, because the data is going to change very frecuently.
> 
> Thanks


--
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: [email protected]
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Reply via email to