|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.globus.wsrf.utils.FilePersistenceHelper
org.globus.wsrf.utils.XmlPersistenceHelper
This helper is used to persist a ReflectionResource
by serializing the resource implementation JavaBean used in constructing the
ReflectionResource. The result of storing the resource is an XML
file that corresponds exactly to the XML Schema Resource document defined
for this resource. Future versions will offer alternative modes of
persistence.
Usage:
Use this helper on the model of
PersistentReflectionResource
ReflectionResource,
PersistentReflectionResource,
ResourceHomeImpl,
PersistentResource,
RemoveCallback| Nested Class Summary |
| Nested classes inherited from class org.globus.wsrf.utils.FilePersistenceHelper |
|
| Field Summary | |
private static java.lang.String |
FILE_SUFFIX
|
private static org.globus.util.I18n |
i18n
|
private static org.apache.commons.logging.Log |
logger
|
| Fields inherited from class org.globus.wsrf.utils.FilePersistenceHelper |
beanClass, fileSuffix, SERVER_ID, storageDir |
| Constructor Summary | |
XmlPersistenceHelper(java.lang.Class beanClass)
|
|
| Method Summary | |
java.lang.Object |
load(java.lang.Object key)
Loads and returns the object of the given key from the persistent storage. |
void |
load(java.lang.Object key,
ReflectionResource resource)
Loads and initialize the resource. |
void |
remove(ReflectionResource resource)
Removes the resource from persistent storage. |
void |
store(java.lang.Object key,
java.lang.Object object,
javax.xml.namespace.QName topElementQName)
Stores the object of the given key to persistent storage. |
void |
store(ReflectionResource resource)
Store the resource into an XML document (current implementation). |
| Methods inherited from class org.globus.wsrf.utils.FilePersistenceHelper |
getBeanClass, getDefaultStorageDir, getFileSuffix, getKeyAsFile, getStorageDirectory, list, remove, removeAll, setStorageDirectory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static org.globus.util.I18n i18n
private static org.apache.commons.logging.Log logger
private static final java.lang.String FILE_SUFFIX
| Constructor Detail |
public XmlPersistenceHelper(java.lang.Class beanClass)
throws java.io.IOException
| Method Detail |
public void load(java.lang.Object key,
ReflectionResource resource)
throws ResourceException
key - the key of the potentially new resourceresource - the new resource to load.
Its key and implementation bean are null.
They will be set by a call from this method to
resource.initialize().
ResourceExceptionPersistentResource
public void store(ReflectionResource resource)
throws ResourceException
getKeyAsFile().
This stores the state of the implementation JavaBean. If some resource
properties have been implemented with something else (for instance
getters and setters from another object) they will not be
persisted with the current state. This is not a problem if their state
is immutable after initial creation, as their values will be set by
initialize,
ReflectionResource.initialize()} which is called by
this method.
(TODO: persist based on each RP?)
resource - the resource to store the state of.
ResourceException - if the resource could not be storedgetKeyAsFile(),
PersistentResource
public void remove(ReflectionResource resource)
throws ResourceException
resource - the resource to remove from storage.
ResourceException - if the resource could not be removed.RemoveCallback
public java.lang.Object load(java.lang.Object key)
throws ResourceException
key - key of object to load.
ResourceException - If the object cannot be loaded from file.
public void store(java.lang.Object key,
java.lang.Object object,
javax.xml.namespace.QName topElementQName)
throws ResourceException
key - key of object.object - object to persist.topElementQName - the top element name of the XML object.
ResourceException - If the object cannot be saved to a file.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||