A more detailed interface to {@link Node}, which is used when writing plugins for or extending JBoss Cache. References are usually obtained by calling methods on {@link org.jboss.cache.CacheSPI}.
You should NEVER attempt to directly cast a {@link Node} instance to this interface. In future, the implementation may not allow it. This interface contains overridden method signatures of some methods from {@link Node}, overridden to ensure return types of {@link Node} are replaced with {@link NodeSPI}.
An important note on the xxxDirect() methods below. These methods are counterparts to similarly named methods in {@link Node} - e.g., {@link NodeSPI#getDirect(Object)} is a direct access counterpart to {@link Node#get(Object)}, the difference being that:
- {@link Node#get(Object)} - Passes the call up the interceptor stack, applies all aspects including node locking, cache loading, passivation, etc etc.
- {@link NodeSPI#getDirect(Object)} - directly works on the underlying data in the node.
The big difference with the direct access methods are that it is the onus of the caller to ensure proper locks are obtained prior to the call. A proper call should have gone through a locking-capable interceptor first and based on the cache configuration's locking policy, an appropriate lock should be obtained prior to the call. These direct access methods will throw {@link org.jboss.cache.lock.LockingException}s if appropriate locks haven't been obtained by the caller.
It is important to node that the direct
read methods, such as getDataDirect(), return unmodifiable collections. In addition to being unmodifiable, they are also defensively copied from the underlying data map to ensure view consistency.
@author
Manik Surtani (manik AT jboss DOT org)
@see Node
@see org.jboss.cache.CacheSPI
@since 2.0.0