java.lang.Objectorg.objectweb.telosys.dal.tools.Serializer
Serialize tool to build basic DAO with "save/load/delete" operations
Constructor Summary | |
Serializer(java.lang.String sDataDirectory)
Constructor |
Method Summary | |
int |
delete(java.lang.Class cl,
java.lang.String sKey)
Delete the object instance file corresponding to the given key |
java.lang.Object |
load(java.lang.Class cl,
java.lang.String sKey)
Load an object from the instance file corresponding to the given key |
void |
save(java.lang.Object obj,
java.lang.String sKey)
Save the given object in a instance file indentifying by the given key |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Serializer(java.lang.String sDataDirectory)
sDataDirectory
- : the full path of the directory where to store the instances filesMethod Detail |
public void save(java.lang.Object obj, java.lang.String sKey) throws TelosysException
obj
- : the object to savesKey
- : the key to use to identify the instance
TelosysException
public java.lang.Object load(java.lang.Class cl, java.lang.String sKey) throws TelosysException
cl
- : the class of the object to loadsKey
- : the key of the object to load
TelosysException
public int delete(java.lang.Class cl, java.lang.String sKey) throws TelosysException
cl
- : the class of the object to deletesKey
- : the key of the object to delete
TelosysException