|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.zphinx.spine.data.AbstractDataProxy
com.zphinx.spine.data.impl.FileProxy
public class FileProxy
FileProxy serves as a proxy for DataAccessObjects which require a file or a properties file for data persistence.
It automatically retrieves the file at a known file path and loads it into an AbstractFileDAO either as a byte[] array or as a properties object which can then be used directly by the client programmer.
copyright ©Zphinx Software Solutions
| Field Summary |
|---|
| Fields inherited from class com.zphinx.spine.data.AbstractDataProxy |
|---|
DATA_DATABASE, DATA_EJB, DATA_HIBERNATE, DATA_JAVASPACE, DATA_LDAP, DATA_PROPERTIES_FILE |
| Constructor Summary | |
|---|---|
FileProxy()
|
|
| Method Summary | |
|---|---|
void |
close(DataAccessObject dao)
Close and dispose of all opened resources. |
protected DataAccessObject |
open(Object obj1,
String className,
DAOInput daoCons)
Open the datastore and fetch the correct type of persistence. |
| Methods inherited from class com.zphinx.spine.data.AbstractDataProxy |
|---|
createDataAccessImpl, execute, getDataAccessObject, getInstance, getStoreType, init |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileProxy()
| Method Detail |
|---|
protected DataAccessObject open(Object obj1,
String className,
DAOInput daoCons)
This method will initialize the file referenced at the stated path, load the file and save it in object format either as a properties file or as a byte[] array in AbstractFileDAO.
This can latter be retrieved by the client programmer who simply makes a call to AbstractFileDAO.getFileBytes() or AbstractFileDAO.getProperties() to retrieve the constituents of the file.
The developer does not need to write the object to the file system but must ensure that if changes are made to the object form of the file, these changes must be represented in the object form which this proxy will persist automatically.
open in class AbstractDataProxyobj1 - Arbitary object to pass to this methodclassName - A String representing the type of DAO to create.daoCons - The DaoConstructor passed to this object
Throws - a SpineApplicationException if unable to load a the appropriate DataAbstract ObjectAbstractDataProxy.open(java.lang.Object, java.lang.String, com.zphinx.spine.vo.DAOInput)public void close(DataAccessObject dao)
Persists the contents of the file or properties file back to the file system. Any changes made to the object obtained from AbstractFileDAO.getProperties() or AbstractFileDAO.getFileBytes() will be automatically persisted by this method.
close in class AbstractDataProxydao - The DataAccessObject associated with this proxy
SpineApplicationExceptionAbstractDataProxy.close(com.zphinx.spine.data.DataAccessObject)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||