|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceStore
A resource store implements persistency for a set of resources. A resource store may implement a number of strategies along different axis, for example:
Method Summary | |
---|---|
boolean |
acceptUnload()
Can this resource store be unloaded now ? This method gets called by the ResourceStoreManager before calling the shutdown method, when possible. |
void |
addResource(Resource resource)
Add this resource to this resource store. |
java.util.Enumeration |
enumerateResourceIdentifiers()
Enumerate all the resources saved in this store. |
java.lang.String |
getIdentifier()
Get the identifier for that store. |
int |
getVersion()
Get the version of that resource store. |
boolean |
hasResource(java.lang.String identifier)
Check for the existence of a resource in this store. |
void |
initialize(ResourceStoreManager manager,
java.lang.Object token,
java.io.File repository,
Serializer serializer)
This resource store is being built, initialize it with the given arg. |
Resource |
loadResource(java.lang.String identifier,
java.util.Hashtable defs)
Restore the resource whose name is given. |
Resource |
lookupResource(java.lang.String identifier)
Get this resource, but only if already loaded. |
void |
markModified(Resource resource)
Mark this resource as modified. |
void |
removeResource(java.lang.String identifier)
Remove this resource from the repository. |
void |
renameResource(java.lang.String oldid,
java.lang.String newid)
Rename a given resource. |
void |
save()
Save this store. |
void |
saveResource(Resource resource)
Stabilize the given resource. |
void |
shutdown()
Shutdown this store. |
Method Detail |
---|
int getVersion()
java.lang.String getIdentifier()
Resource loadResource(java.lang.String identifier, java.util.Hashtable defs) throws InvalidResourceException
identifier
- The identifier of the resource to restore.defs
- Default attribute values. If the resource needs to be
restored from its pickled version, this Hashtable provides
a set of default values for some of the attributes.
InvalidResourceException
- If the resource could not
be restored from the store.Resource lookupResource(java.lang.String identifier)
identifier
- The resource identifier.
void saveResource(Resource resource)
resource
- The resource to save.void addResource(Resource resource)
resource
- The resource to be added.void removeResource(java.lang.String identifier)
identifier
- The identifier of the resource to be removed.void renameResource(java.lang.String oldid, java.lang.String newid)
oldid
- The olde resource identifier.newid
- The new resource identifier.void markModified(Resource resource)
resource
- The resource that has changed (and will have to be
pickled some time latter).boolean acceptUnload()
shutdown
method, when possible. An implementation
of that method is responsible for checking the acceptUnload
method of all its loaded resource before returning
true, meaning that the resource store can be unloaded.
void shutdown()
void save()
java.util.Enumeration enumerateResourceIdentifiers()
boolean hasResource(java.lang.String identifier)
identifier
- The identifier of the resource to check.
void initialize(ResourceStoreManager manager, java.lang.Object token, java.io.File repository, Serializer serializer)
manager
- The ResourceStoreManager instance that asks yourself
to initialize.token
- The resource store manager key to that resource store,
this token should be used when calling methods from the manager that
are to act on yourself.repository
- A file, giving the location of the associated
repository.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |