Hi Thierry,
      Got it working now, it with the CompositeCacheManager, I just need to 
clean up everything. 
      Thanks


////////////////////////////////////////////////////////////////////////////////////////////

public class MainPEITCacheApplication extends Application {
        
        String cachePropLoc=null;
        /**
         * A method to instantiate MainPEITCacheApplication
         * @param cachePropLoc String location of the cache property file
         */
        public MainPEITCacheApplication(String cachePropLoc){
                this.cachePropLoc=cachePropLoc;
        }
    /** 
     * Creates a root Restlet that will receive all incoming calls. 
     */  
        @Override
        public synchronized Restlet createInboundRoot() {
                
        Router router = new Router(getContext());  
        /**
         * 
         */
        router.attach("/", CacheManagerResource.class);
        
        router.attach("/{region}",CacheManagerResource.class);
        
        TemplateRoute route= router.attach("/{region}/{dynamicurl}", 
CacheManagerResource.class);
        Variable v=new Variable(Variable.TYPE_ALL);
        route.getTemplate().getVariables().put("dynamicurl", v);
        
        try {
                CompositeCacheManager ccm=null;
                ccm = CompositeCacheManager.getUnconfiguredInstance();
                Properties props = new Properties(); 
                props.load(new FileInputStream(this.cachePropLoc));
                ccm.configure(props);
                } catch (Exception ex) {
                        ex.printStackTrace();
                }
        
                return router;  
    }  
        
         @Override
         public synchronized void stop() throws Exception {
                        /**
                         * Close any open processes
                         */
                        String[] 
cacheNames=CompositeCacheManager.getInstance().getCacheNames();
                        int len=cacheNames.length;
                        for(int i=0;i<len;i++){
                                
CompositeCacheManager.getInstance().freeCache(cacheNames[i]);
                        }
                        CompositeCacheManager.getInstance().release();
                        CompositeCacheManager.getInstance().shutDown();
                super.stop();
         }

}

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2590534

Reply via email to