Class InMemPersistenceManager
- java.lang.Object
-
- org.apache.jackrabbit.core.persistence.AbstractPersistenceManager
-
- org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManager
-
- All Implemented Interfaces:
PersistenceManager
@Deprecated public class InMemPersistenceManager extends AbstractPersistenceManager
Deprecated.Please migrate to a bundle persistence manager (JCR-2802)InMemPersistenceManageris a very simpleHashMap-basedPersistenceManagerfor Jackrabbit that keeps all data in memory and that is capable of storing and loading its contents using a simple custom binary serialization format (seeSerializer).It is configured through the following properties:
initialCapacity: initial capacity of the hash map used to store the dataloadFactor: load factor of the hash map used to store the datapersistent: iftruethe contents of the hash map is loaded on startup and stored on shutdown; iffalsenothing is persisted
-
-
Field Summary
Fields Modifier and Type Field Description protected FileSystemblobFSDeprecated.protected BLOBStoreblobStoreDeprecated.protected static intINITIAL_BUFFER_SIZEDeprecated.protected intinitialCapacityDeprecated.protected booleaninitializedDeprecated.protected floatloadFactorDeprecated.protected static byteNODE_ENTRYDeprecated.protected booleanpersistentDeprecated.protected static bytePROP_ENTRYDeprecated.protected static StringREFS_FILE_PATHDeprecated.protected Map<NodeId,byte[]>refsStoreDeprecated.protected static StringSTATE_FILE_PATHDeprecated.protected Map<ItemId,byte[]>stateStoreDeprecated.protected FileSystemwspFSDeprecated.file system where the content of the hash maps are read from/written to (ifpersistent==true)
-
Constructor Summary
Constructors Constructor Description InMemPersistenceManager()Deprecated.Creates a newInMemPersistenceManagerinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected static StringbuildBlobFilePath(String parentUUID, Name propName, int index)Deprecated.voidclose()Deprecated.Closes the persistence manager.protected voiddestroy(NodeReferences refs)Deprecated.Destroy a node references object.protected voiddestroy(NodeState state)Deprecated.Destroy a node state.protected voiddestroy(PropertyState state)Deprecated.Destroy a property state.booleanexists(NodeId id)Deprecated.Checks whether the identified node exists.booleanexists(PropertyId id)Deprecated.Checks whether the identified property exists.booleanexistsReferencesTo(NodeId id)Deprecated.Checks whether references of the identified target node exist.StringgetInitialCapacity()Deprecated.StringgetLoadFactor()Deprecated.voidinit(PMContext context)Deprecated.Initializes the persistence manager.booleanisPersistent()Deprecated.NodeStateload(NodeId id)Deprecated.Load the persistent members of a node state.PropertyStateload(PropertyId id)Deprecated.Load the persistent members of a property state.voidloadContents()Deprecated.Reads the content of the hash maps from the file systemNodeReferencesloadReferencesTo(NodeId id)Deprecated.Load the persisted references to the node with the given identifier.voidsetInitialCapacity(int initialCapacity)Deprecated.voidsetInitialCapacity(String initialCapacity)Deprecated.voidsetLoadFactor(float loadFactor)Deprecated.voidsetLoadFactor(String loadFactor)Deprecated.voidsetPersistent(boolean persistent)Deprecated.voidsetPersistent(String persistent)Deprecated.protected voidstore(NodeReferences refs)Deprecated.Store a references object.protected voidstore(NodeState state)Deprecated.Store a node state.protected voidstore(PropertyState state)Deprecated.Store a property state.voidstoreContents()Deprecated.Writes the content of the hash maps to the file system-
Methods inherited from class org.apache.jackrabbit.core.persistence.AbstractPersistenceManager
checkConsistency, createNew, createNew, store
-
-
-
-
Field Detail
-
initialized
protected boolean initialized
Deprecated.
-
INITIAL_BUFFER_SIZE
protected static final int INITIAL_BUFFER_SIZE
Deprecated.- See Also:
- Constant Field Values
-
STATE_FILE_PATH
protected static final String STATE_FILE_PATH
Deprecated.- See Also:
- Constant Field Values
-
REFS_FILE_PATH
protected static final String REFS_FILE_PATH
Deprecated.- See Also:
- Constant Field Values
-
NODE_ENTRY
protected static final byte NODE_ENTRY
Deprecated.- See Also:
- Constant Field Values
-
PROP_ENTRY
protected static final byte PROP_ENTRY
Deprecated.- See Also:
- Constant Field Values
-
blobFS
protected FileSystem blobFS
Deprecated.
-
blobStore
protected BLOBStore blobStore
Deprecated.
-
wspFS
protected FileSystem wspFS
Deprecated.file system where the content of the hash maps are read from/written to (ifpersistent==true)
-
initialCapacity
protected int initialCapacity
Deprecated.
-
loadFactor
protected float loadFactor
Deprecated.
-
persistent
protected boolean persistent
Deprecated.
-
-
Method Detail
-
setInitialCapacity
public void setInitialCapacity(int initialCapacity)
Deprecated.
-
setInitialCapacity
public void setInitialCapacity(String initialCapacity)
Deprecated.
-
getInitialCapacity
public String getInitialCapacity()
Deprecated.
-
setLoadFactor
public void setLoadFactor(float loadFactor)
Deprecated.
-
setLoadFactor
public void setLoadFactor(String loadFactor)
Deprecated.
-
getLoadFactor
public String getLoadFactor()
Deprecated.
-
isPersistent
public boolean isPersistent()
Deprecated.
-
setPersistent
public void setPersistent(boolean persistent)
Deprecated.
-
setPersistent
public void setPersistent(String persistent)
Deprecated.
-
buildBlobFilePath
protected static String buildBlobFilePath(String parentUUID, Name propName, int index)
Deprecated.
-
loadContents
public void loadContents() throws ExceptionDeprecated.Reads the content of the hash maps from the file system- Throws:
Exception- if an error occurs
-
storeContents
public void storeContents() throws ExceptionDeprecated.Writes the content of the hash maps to the file system- Throws:
Exception- if an error occurs
-
init
public void init(PMContext context) throws Exception
Deprecated.Initializes the persistence manager. The persistence manager is permanently bound to the given context, and any required external resources are acquired.An appropriate exception is thrown if the persistence manager initialization fails for whatever reason. In this case the state of the persistence manager is undefined and the instance should be discarded.
- Parameters:
context- persistence manager context- Throws:
Exception- if the persistence manager initialization failed
-
close
public void close() throws ExceptionDeprecated.Closes the persistence manager. The consistency of the persistent storage is guaranteed and all acquired resources are released. It is an error to invoke any methods on a closed persistence manager, and implementations are free to enforce this constraint by throwing IllegalStateExceptions in such cases.An appropriate exception is thrown if the persistence manager could not be closed properly. In this case the state of the persistence manager is undefined and the instance should be discarded.
- Throws:
Exception- if the persistence manager failed to close properly
-
load
public NodeState load(NodeId id) throws NoSuchItemStateException, ItemStateException
Deprecated.Load the persistent members of a node state.- Parameters:
id- node id- Returns:
- loaded node state
- Throws:
NoSuchItemStateException- if the node state does not existItemStateException- if another error occurs
-
load
public PropertyState load(PropertyId id) throws NoSuchItemStateException, ItemStateException
Deprecated.Load the persistent members of a property state.- Parameters:
id- property id- Returns:
- loaded property state
- Throws:
NoSuchItemStateException- if the property state does not existItemStateException- if another error occurs
-
store
protected void store(NodeState state) throws ItemStateException
Deprecated.Store a node state. Subclass responsibility.- Specified by:
storein classAbstractPersistenceManager- Parameters:
state- node state to store- Throws:
ItemStateException- if an error occurs
-
store
protected void store(PropertyState state) throws ItemStateException
Deprecated.Store a property state. Subclass responsibility.- Specified by:
storein classAbstractPersistenceManager- Parameters:
state- property state to store- Throws:
ItemStateException- if an error occurs
-
destroy
protected void destroy(NodeState state) throws ItemStateException
Deprecated.Destroy a node state. Subclass responsibility.- Specified by:
destroyin classAbstractPersistenceManager- Parameters:
state- node state to destroy- Throws:
ItemStateException- if an error occurs
-
destroy
protected void destroy(PropertyState state) throws ItemStateException
Deprecated.Destroy a property state. Subclass responsibility.- Specified by:
destroyin classAbstractPersistenceManager- Parameters:
state- property state to destroy- Throws:
ItemStateException- if an error occurs
-
loadReferencesTo
public NodeReferences loadReferencesTo(NodeId id) throws NoSuchItemStateException, ItemStateException
Deprecated.Load the persisted references to the node with the given identifier.- Parameters:
id- reference target node id- Throws:
NoSuchItemStateException- if the target node does not existItemStateException- if another error occurs
-
store
protected void store(NodeReferences refs) throws ItemStateException
Deprecated.Store a references object. Subclass responsibility.- Specified by:
storein classAbstractPersistenceManager- Parameters:
refs- references object to store- Throws:
ItemStateException- if an error occurs
-
destroy
protected void destroy(NodeReferences refs) throws ItemStateException
Deprecated.Destroy a node references object. Subclass responsibility.- Specified by:
destroyin classAbstractPersistenceManager- Parameters:
refs- node references object to destroy- Throws:
ItemStateException- if an error occurs
-
exists
public boolean exists(PropertyId id) throws ItemStateException
Deprecated.Checks whether the identified property exists.- Parameters:
id- property id- Returns:
trueif the property exists,falseotherwise- Throws:
ItemStateException- on persistence manager errors
-
exists
public boolean exists(NodeId id) throws ItemStateException
Deprecated.Checks whether the identified node exists.- Parameters:
id- node id- Returns:
trueif the node exists,falseotherwise- Throws:
ItemStateException- on persistence manager errors
-
existsReferencesTo
public boolean existsReferencesTo(NodeId id) throws ItemStateException
Deprecated.Checks whether references of the identified target node exist.- Parameters:
id- target node id- Returns:
trueif the references exist,falseotherwise- Throws:
ItemStateException- on persistence manager errors
-
-