|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.lightwolf.Process org.lightwolf.FileProcess
public class FileProcess
A process that stores data on a file.
Field Summary |
---|
Fields inherited from class org.lightwolf.Process |
---|
ACTIVE, PASSIVE, state |
Constructor Summary | |
---|---|
FileProcess(File file)
|
|
FileProcess(ProcessManager manager,
File file)
|
|
FileProcess(ProcessManager manager,
String fileName)
|
|
FileProcess(String fileName)
|
Method Summary | |
---|---|
protected void |
discardData()
Called to indicate that the stored data is not necessary anymore. |
protected Object |
loadData()
Called by Process.activate() to retrieve data stored by
Process.storeData(Object) . |
protected void |
storeData(Object data)
Called by Process.passivate() to store data on some media. |
Methods inherited from class org.lightwolf.Process |
---|
accept, acceptMany, activate, activeFlows, addEventListener, call, connect, connectMany, current, getFlows, getState, notify, notifyAll, passivate, receive, receiveMany, removeEventListener, safeCurrent, send, serve, serveMany, stateName, suspendedFlows, wait, waitMany |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileProcess(ProcessManager manager, File file)
public FileProcess(File file)
public FileProcess(ProcessManager manager, String fileName)
public FileProcess(String fileName)
Method Detail |
---|
protected void storeData(Object data) throws IOException
Process
Process.passivate()
to store data on some media. The default
implementation throws IllegalStateException
indicating that the
process cannot be passivated.
This method must be implemented along with Process.loadData()
and
Process.discardData()
by subclasses that support long-running-processes.
The implementation must associate the informed data with this process.
This method might be called more than once. Any data stored by the
previous invocation to this method must be discarded.
This method typically serializes the informed data
object,
so that an unserialized version is returned by the next call to
Process.loadData()
.
storeData
in class Process
data
- A serializable object to be stored on some media.
IOException
- If some error happens during access to storage.protected Object loadData() throws IOException, ClassNotFoundException
Process
Process.activate()
to retrieve data stored by
Process.storeData(Object)
. The default implementation throws
AssertionError
.
This method must be implemented along with Process.storeData(Object)
and
Process.discardData()
by subclasses that support long-running-processes.
This method must not discard data from the storage.
loadData
in class Process
IOException
- If some error happens during access to storage.
ClassNotFoundException
- If the system can't find a class for a
serialized object while assembling the result.protected void discardData() throws IOException
Process
AssertionError
.
This method must be implemented along with Process.storeData(Object)
and
Process.loadData()
by subclasses that support long-running-processes.
This method must simply discard data from the storage.
discardData
in class Process
IOException
- If some error happens during the storage access.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |