Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr.cache.document
Class WorkspaceCache

    java.lang.Object
      org.modeshape.jcr.cache.document.WorkspaceCache

All Implemented Interfaces:
  ChangeSetListener, DocumentCache, NodeCache

    public class WorkspaceCache

extends Object
implements DocumentCache, ChangeSetListener

A `NodeCache` implementation that uses Infinispan's `SchematicDb` for storage, with each node represented as a single `Document`. The nodes in this cache represent the actual, unmodified values.

Constructor Summary
`WorkspaceCache(ExecutionContext context, String repositoryKey, String workspaceName, SchematicDb database, long largeValueSize, NodeKey rootKey, ChangeSetListener changeSetListener)`

Method Summary
`void` | `changed(ChangeSet changes)` Signal that changes have been made to the persisted data.
`protected void` | `checkNotClosed()`
`void` | `clear()` Clears all changes in the cache.
`CachedNode` | `getNode(ChildReference reference)` Get the cached representation of the node as represented by the supplied child reference.
`CachedNode` | `getNode(NodeKey key)` Get the cached representation of the node with the supplied node key.
`String` | `getProcessKey()`
`String` | `getRepositoryKey()`
`NodeKey` | `getRootKey()` Get the node key for the root node.
`String` | `getWorkspaceKey()`
`String` | `getWorkspaceName()`
`void` | `notify(ChangeSet changeSet)`
`void` | `setMinimumBinarySizeInBytes(long largeValueSize)`
`void` | `signalDeleted()`
`WorkspaceCache` | `workspaceCache()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WorkspaceCache

    public WorkspaceCache(ExecutionContext context,
                          String repositoryKey,
                          String workspaceName,
                          SchematicDb database,
                          long largeValueSize,
                          NodeKey rootKey,
                          ChangeSetListener changeSetListener)

Method Detail

### setMinimumBinarySizeInBytes

    public void setMinimumBinarySizeInBytes(long largeValueSize)

### workspaceCache

    public final WorkspaceCache workspaceCache()

  Specified by:
    `workspaceCache` in interface `DocumentCache`

### getProcessKey

    public final String getProcessKey()

### getRepositoryKey

    public final String getRepositoryKey()

### getWorkspaceKey

    public final String getWorkspaceKey()

### getWorkspaceName

    public final String getWorkspaceName()

### getRootKey

    public NodeKey getRootKey()

  Description copied from interface: `NodeCache`
  Get the node key for the root node.

  Specified by:
    `getRootKey` in interface `NodeCache`
  Returns:
    the root node's key; never null

### getNode

    public CachedNode getNode(NodeKey key)

  Description copied from interface: `NodeCache`
  Get the cached representation of the node with the supplied node key.

  Specified by:
    `getNode` in interface `NodeCache`
  Parameters:
    `key` - the node key; may not be null
  Returns:
    the cached node, or null if there is no such node

### getNode

    public CachedNode getNode(ChildReference reference)

  Description copied from interface: `NodeCache`
  Get the cached representation of the node as represented by the supplied child reference. This is a convenience method that is equivalent to calling:

       getNode(reference.getKey());

  Specified by:
    `getNode` in interface `NodeCache`
  Parameters:
    `reference` - the child node reference; may not be null
  Returns:
    the cached node to which the reference points, or null if the child reference no longer points to a valid node

### clear

    public void clear()

  Description copied from interface: `NodeCache`
  Clears all changes in the cache.

  Specified by:
    `clear` in interface `NodeCache`

### notify

    public void notify(ChangeSet changeSet)

  Specified by:
    `notify` in interface `ChangeSetListener`

### changed

    public void changed(ChangeSet changes)

  Signal that changes have been made to the persisted data. Related information in the cache is cleared, and this workspace's listener is notified of the changes.

  Parameters:
    `changes` - the changes to be made; may not be null

### checkNotClosed

    protected final void checkNotClosed()

### signalDeleted

    public void signalDeleted()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.