|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rhi.architecture.resource.shmem.PersistentSharedMemory
Object used to share memory between threads. The shared memory is persisted to a file.
Constructor Summary | |
PersistentSharedMemory()
|
Method Summary | |
void |
close()
Set our shared data to null |
java.lang.Object |
getSharedData()
Returns the sharedData. |
void |
init(java.util.Properties props)
No initialization is required |
void |
setPersistenceFile(java.lang.String fileName)
Sets the file to be used to persist the stored object. |
void |
setSharedData(java.lang.Object sharedData)
Sets the sharedData and then persists it to a file, if the file is available |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PersistentSharedMemory()
Method Detail |
public void init(java.util.Properties props)
init
in interface Resource
props
- public void close()
close
in interface Resource
Resource.close()
public void setPersistenceFile(java.lang.String fileName) throws java.io.IOException, java.lang.ClassNotFoundException
fileName
- Name of the file to be used for persistance
java.io.IOException
- Thrown if an error occurs while reading from the
file
java.lang.ClassNotFoundException
- Thrown if the loaded object's class
cannot be foundpublic void setSharedData(java.lang.Object sharedData) throws java.io.IOException
setSharedData
in interface SharedMemory
sharedData
- The sharedData to set
java.io.IOException
- Thrown if an error occurs while writing to the filepublic java.lang.Object getSharedData()
getSharedData
in interface SharedMemory
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |