|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.space4j.implementation.SimpleSpace4J
public class SimpleSpace4J
The simplest possible implementation of a Space4J.
| Field Summary | |
|---|---|
protected java.lang.String |
dirname
|
protected IndexManager |
im
|
protected Logger |
logger
|
protected long |
snapTime
|
protected Space |
space
|
protected java.lang.Thread |
thread
|
| Constructor Summary | |
|---|---|
SimpleSpace4J(java.lang.String dirname)
|
|
SimpleSpace4J(java.lang.String dirname,
long snapTime)
Initializes the SimpleSpace4J, initializes the Logger, recover the Space from disk if there is a snapshot saved and reapply the commands to the Space. |
|
| Method Summary | |
|---|---|
int |
exec(Command cmd)
Execute a command and log it. |
protected int |
exec(Command cmd,
boolean log)
|
void |
executeSnapshot()
Take a snapshot of the Space to disk. |
java.lang.String |
getDirName()
|
Space |
getSpace()
Returns the Space where the Objects are stored, so the client can direct access them. |
Space |
readSnapshot()
|
int |
reapply(Command cmd)
Re-apply a command on the underlying Space. |
void |
reapplyCommandsFromLog()
|
void |
run()
|
void |
start()
Starts the Space4J. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Space space
protected Logger logger
protected java.lang.String dirname
protected IndexManager im
protected java.lang.Thread thread
protected long snapTime
| Constructor Detail |
|---|
public SimpleSpace4J(java.lang.String dirname,
long snapTime)
throws LoggerException,
CommandException
LoggerException
CommandException
public SimpleSpace4J(java.lang.String dirname)
throws LoggerException,
CommandException
LoggerException
CommandException| Method Detail |
|---|
public java.lang.String getDirName()
public Space getSpace()
Space4J
getSpace in interface Space4Jpublic void run()
run in interface java.lang.Runnable
public void start()
throws java.net.UnknownHostException,
java.io.IOException,
java.lang.ClassNotFoundException
Space4J
start in interface Space4Jjava.net.UnknownHostException
java.io.IOException
java.lang.ClassNotFoundException
public int exec(Command cmd)
throws CommandException,
LoggerException
exec in interface Space4Jcmd - The command to be executed and logged.
CommandException - if there is a problem executing this command
LoggerException - if there is a problem logging thie command
public int reapply(Command cmd)
throws CommandException,
LoggerException
Space4J
reapply in interface Space4Jcmd - The command to execute.
CommandException - if there is a problem executing this command
LoggerException - if there is a problem logging thie command
protected int exec(Command cmd,
boolean log)
throws CommandException,
LoggerException
CommandException
LoggerException
public void executeSnapshot()
throws LoggerException
Space4J
executeSnapshot in interface Space4JLoggerException
public Space readSnapshot()
throws LoggerException
LoggerException
public void reapplyCommandsFromLog()
throws CommandException,
LoggerException
CommandException
LoggerException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||