Package com.mckoi.store
Class JournalledSystem.AbstractResource
- java.lang.Object
-
- com.mckoi.store.JournalledSystem.AbstractResource
-
- All Implemented Interfaces:
JournalledResource
- Direct Known Subclasses:
JournalledSystem.NonLoggingResource,JournalledSystem.Resource
- Enclosing class:
- JournalledSystem
private abstract class JournalledSystem.AbstractResource extends java.lang.Object implements JournalledResource
An abstract resource.
-
-
Field Summary
Fields Modifier and Type Field Description protected StoreDataAccessordataThe backing object.protected longidThe id assigned to this resource by this session.protected java.lang.StringnameThe unique name given this resource (the file name).protected booleanread_onlyTrue if this resource is read_only.
-
Constructor Summary
Constructors Constructor Description AbstractResource(java.lang.String name, long id, StoreDataAccessor data)Constructs the resource.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description longgetID()Returns the unique id of this page.intgetPageSize()Returns the size of the page.(package private) abstract voidnotifyPostRecover()(package private) abstract voidpersistClose()(package private) abstract voidpersistDelete()(package private) abstract voidpersistPageChange(long page, int off, int len, java.io.DataInputStream din)(package private) abstract voidpersistSetSize(long new_size)(package private) abstract voidsynch()java.lang.StringtoString()
-
-
-
Field Detail
-
name
protected final java.lang.String name
The unique name given this resource (the file name).
-
id
protected final long id
The id assigned to this resource by this session. This id should not be used in any external source.
-
data
protected final StoreDataAccessor data
The backing object.
-
read_only
protected boolean read_only
True if this resource is read_only.
-
-
Constructor Detail
-
AbstractResource
AbstractResource(java.lang.String name, long id, StoreDataAccessor data)Constructs the resource.
-
-
Method Detail
-
persistClose
abstract void persistClose() throws java.io.IOException- Throws:
java.io.IOException
-
persistDelete
abstract void persistDelete() throws java.io.IOException- Throws:
java.io.IOException
-
persistSetSize
abstract void persistSetSize(long new_size) throws java.io.IOException- Throws:
java.io.IOException
-
persistPageChange
abstract void persistPageChange(long page, int off, int len, java.io.DataInputStream din) throws java.io.IOException- Throws:
java.io.IOException
-
synch
abstract void synch() throws java.io.IOException- Throws:
java.io.IOException
-
notifyPostRecover
abstract void notifyPostRecover()
-
getPageSize
public int getPageSize()
Returns the size of the page.- Specified by:
getPageSizein interfaceJournalledResource
-
getID
public long getID()
Returns the unique id of this page.- Specified by:
getIDin interfaceJournalledResource
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-