Package javax.jcache

Examples of javax.jcache.CacheAccess


    public boolean invalidateObject(String id,String region)      
    throws CacheException {
       
      boolean isInvalidate = false;           
    try{
      CacheAccess access = factory.getAccess(region);
      if(access.isPresent(id)){             
        access.invalidate(id);
        //access.destroy(id);
        isInvalidate = true;
        logger.log(Level.INFO,
                   Messages.format("CacheManager.remove",id));
      }     
View Full Code Here


    
       try{     
            Iterator iter = views.iterator();
            Cache cache = factory.getCache();
           while(iter.hasNext()){
         CacheAccess access = null;
               RepositoryView view = (RepositoryView)iter.next();
               BeanDescriptor beanDesc = view.getBeanDescriptor();
               String region = beanDesc.getDatabaseName();
               String group = beanDesc.getRepositoryViewName();
         try{        
             factory.defineRegion(region);
         }
         catch(ObjectExistsException e){
         }
         finally{
               access = factory.getAccess(region);  
         }
         access.defineGroup(group);
                        
           }
       int size = cache.getAttributes().getMemoryCacheSize();
       logger.log(Level.INFO,Messages.format("CacheManager.size",
                       new Integer(size)));                    
View Full Code Here

    public void putInCache(String id, ObjectMapped object,
                           String region,String group)       
    throws CacheException {
               
    try{
      CacheAccess access = factory.getAccess(region)
      if(!access.isPresent(id)){     
        access.put(id,group,object);
        logger.log(Level.INFO,Messages.format("CacheManager.put",id));
      }
    }   
    catch(Exception e){
      throw new CacheException(e);
View Full Code Here

    public void replaceObject(String id, ObjectMapped object,
                   String region,String group)       
    throws CacheException {
               
    try{
      CacheAccess access = factory.getAccess(region);
      if(access.isPresent(id))
        access.replace(id,group,object);
    }   
    catch(Exception e){
      throw new CacheException(e);
    }
    }          
View Full Code Here

TOP

Related Classes of javax.jcache.CacheAccess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.