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 StoreDataAccessor
data
The backing object.protected long
id
The id assigned to this resource by this session.protected java.lang.String
name
The unique name given this resource (the file name).protected boolean
read_only
True 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 long
getID()
Returns the unique id of this page.int
getPageSize()
Returns the size of the page.(package private) abstract void
notifyPostRecover()
(package private) abstract void
persistClose()
(package private) abstract void
persistDelete()
(package private) abstract void
persistPageChange(long page, int off, int len, java.io.DataInputStream din)
(package private) abstract void
persistSetSize(long new_size)
(package private) abstract void
synch()
java.lang.String
toString()
-
-
-
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:
getPageSize
in interfaceJournalledResource
-
getID
public long getID()
Returns the unique id of this page.- Specified by:
getID
in interfaceJournalledResource
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-