5.2. Detachment

5.2. Detachment

/**
 * Remove aop-enabled object from the cache. After successful call of this API, the returning
 * POJO is no longer managed by the cache.
 *
 * @param fqn Instance that associates with this node.
 * @return Original POJO stored under this node.
 * @throws CacheException
 */
Object removeObject(Fqn fqn) throws CacheException;

This call will detach the POJO from the cache management by removing the contents under fqn and return the POJO instance stored there (null if it doesn't exist). After successfully call, any POJO operation on the returned POJO reference is not intercepted by the cache system anymore. So in essence, you will use this Api should you decide that the POJO under fqn is no longer necessary. For example, if a POJO is no longer in context, you will need explicitly invoke this Api otherwise it won't get garbage collected by the VM. Note this call will also remove everything stored under fqn even if you have put other plain cache data there.