- 
        1. Re: Need to refresh the JBoss treecache periodicallyben.wang Sep 23, 2006 2:44 AM (in response to sudarshanra)Best way is probably to use your own timer thread and then do a get from DB and then put to the cache. 
- 
        2. Re: Need to refresh the JBoss treecache periodicallysudarshanra Sep 25, 2006 3:25 PM (in response to sudarshanra)Hi, 
 Thanks for the information. I am trying to implement the same. Mean while thinking about alternatives. Any further ideas welcome.
 Regards,
 Sudarshan
- 
        3. Re: Need to refresh the JBoss treecache periodicallysudarshanra Sep 27, 2006 1:25 PM (in response to sudarshanra)Hi, 
 I have used timer thread for cache refresh and it is working fine. Now I need to enable this jboss cache implementation including DB calls as a service which should start when the server starts. Is there any way to deploy like that please?
 Thanks in advance.
 Regards,
 Sudarshan
- 
        4. Re: Need to refresh the JBoss treecache periodicallybrian.stansberry Oct 1, 2006 11:08 AM (in response to sudarshanra)Writing and deploying services in JBoss AS is covered in Chapter 2.4 of the 4.0.4 version of the JBoss Application Server Guide, available at http://labs.jboss.com/portal/jbossas/docs. 
 The various *-service.xml files found in etc/META-INF of the JBoss Cache distribution are actually service deployment descriptors that will deploy a cache in the AS as a service. Suggest you start with one of those as a template and modify it to configure your cache. Then add a second mbean in the same file to deploy your service that creates the timer thread, etc. Use dependency injection to inject the cache into your service; i.e. in your mbean declaration add:<depends optional-attribute-name="TreeCache">myco:service=MyCache</depends> 
 The above assumes your service exposes an mbean attribute named "TreeCache" and that the object name of your cache is "myco:service=MyCache".
 
     
    