Examples of CacheObject


Examples of org.fjank.jcache.CacheObject

     *
     * @throws CacheException if an error occurs.
     */
    public final void setAttributes(final Object handle,
        final Attributes attributes) throws CacheException {
        CacheObject cacheObj = convertHandle(handle);
        if (attributes == null) {
            cacheObj.setAttributes(CacheAccessFactory.getInstance().getDefaultAttributes());
        } else {
            cacheObj.setAttributes(attributes);
        }
    }
View Full Code Here

Examples of org.fjank.jcache.CacheObject

        }
        if (!(handle instanceof CacheObject)) {
            throw new InvalidArgumentException(
                "The handle was not a valid CacheObject.");
        }
        CacheObject cacheObj = ((CacheObject) handle);
        return cacheObj;
    }
View Full Code Here

Examples of org.fjank.jcache.CacheObject

     * @throws NullObjectException if an object is discovered with required
     *         variables which is null.
     */
    protected final String getRegion(final Object handle)
        throws CacheException {
        final CacheObject cacheObj = convertHandle(handle);
        final CacheRegion region = cacheObj.getRegion();
        if (region == null) {
            throw new NullObjectException("The object " + cacheObj
                + " is not attached to a region.");
        }
        final Object name = region.getName();
View Full Code Here

Examples of org.fjank.jcache.CacheObject

     * @throws InvalidArgumentException if some of the arguments are not valid
     *         in this context
     */
    public final OutputStream createStream(final Object handle)
        throws ObjectExistsException, InvalidArgumentException {
        CacheObject co = convertHandle(handle);
        try {
            StreamCacheObject str =
                new StreamCacheObject(co.getKey(), null, co.getGroup(),
                    co.getRegion(), CacheImpl.getCache(true).getReferenceQueue());
            return str.getOutputStream();
        } catch (CacheNotAvailableException e) {
            throw new InvalidArgumentException("The cache is not available.");
        } catch (CacheException e) {
            throw new InvalidArgumentException(
View Full Code Here

Examples of org.fjank.jcache.CacheObject

     *         another cache is in the progress of loading, or any other
     *         strange exceptions occurs.
     */
    public final File createDiskObject(final Object handle,
        final String extension) throws CacheException {
        CacheObject cacheObj = convertHandle(handle);
        CacheAttributes att = getCacheAttributes();
        String rootPath = att.getDiskPath();
        String ext;
        if (extension == null) {
            ext = "";
        } else {
            ext = '.' + extension;
        }
        return new File(rootPath + File.separatorChar + cacheObj.getKey() + ext);
    }
View Full Code Here

Examples of org.jboss.cache.aop.test.CacheObject

      log_.info("testSerializableSubObject() ....");

      Student ben = new Student();
      ben.setName("Ben");
      ben.setYear("9th grade");
      CacheObject co1 = new CacheObject("1");
      ben.setCO1(co1);
      CacheObject co2 = new CacheObject("2");
      ben.setCO2(co2);

      cache_.putObject("/test", ben);

      Student be = (Student)cache1_.getObject("/test");
View Full Code Here

Examples of org.jboss.cache.aop.test.CacheObject

      log_.info("testSerializableSubObjectRelation() ....");

      Student ben = new Student();
      ben.setName("Ben");
      ben.setYear("9th grade");
      CacheObject co1 = new CacheObject("1");
      ben.setCO1(co1);

      Student elynne = new Student();
      elynne.setName("Elynne");
      elynne.setYear("9th grade");
View Full Code Here

Examples of org.jboss.cache.aop.test.CacheObject

   public void testPlainSeriazable() throws Exception
   {
      log_.info("testPlainSerializable() ....");
      // First the flag is set to false
      CacheObject co = new CacheObject("1");
      cache_.putObject("/test", co);
      CacheObject co1 = (CacheObject)cache1_.getObject("/test");
      assertNotNull("co on remote cache should not be null", co1);
      assertEquals("co should be the same", co.getId(), co1.getId());

   }
View Full Code Here

Examples of org.jboss.test.cluster.cache.aop.CacheObject

   public void bind(String id) throws Exception
   {
      MBeanServer server = (MBeanServer)MBeanServerFactory.findMBeanServer(null).get(0);
      PojoCache cache = (PojoCache)server.getAttribute(new ObjectName("jboss.cache:service=testTreeCacheAop"),
              "PojoCache");
      cache.attach(new Fqn(new Object[] {"sessions", id}).toString(), new CacheObject(id));
   }
View Full Code Here

Examples of org.nemesis.forum.util.cache.CacheObject

    }
    return subCache;
  }

  public synchronized void remove(Object key) {
    CacheObject cacheObject = (CacheObject) cachedObjectsHash.get(key);
    //If the object is not in cache, stop trying to remove it.
    if (cacheObject == null) {
      return;
    }
    //remove from the hash map
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.