Implementing a singleton bean in Spring
===

I am trying to create a cache class for my website using Spring and have added the following code to my applicationContect.xml file:

    <bean id="SiteCache" class="Cache.SiteCache">

What I am unsure of is how to initialize this class. Do I even need to initialize it myself or does Spring take care of that when the site loads? If so, how would I accept parameters within the constructor?

I would like the class to be used most of the time, as a quicker way of accessing variables to populate the site, but I need a way of checking if there is an instance in the first place, so that I can load an XML file from source otherwise.

What would be the best way to implement a cache in spring?

Many thanks,

