Class w3c.jigsaw.resources.Resource
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class w3c.jigsaw.resources.Resource

java.lang.Object
   |
   +----w3c.jigsaw.resources.AttributeHolder
           |
           +----w3c.jigsaw.resources.Resource

public class Resource
extends AttributeHolder
The resource class describes an object, accessible through the server. Resource objects are required to have the following properties:

These resource objects do not define how they are accessed. See the sub-classes for specific accesses. It might be the case that HTTP-NG allows any sub-class of resource to be accessible, although, right now HTTP-1.x only allows you to access HTTPResource instances.


Variable Index

 o ATTR_IDENTIFIER
Attribute index - The index for the identifier attribute.
 o ATTR_RESOURCE_STORE
Attribute index - The resource store associated with this resource.

Constructor Index

 o Resource()
Create an empty resource instance.

Method Index

 o getIdentifier()
Get this resource identifier.
 o getResourceStore()
Get the store associated with this resource.
 o lock(ResourceLocker)
Lock this resource in its store.
 o markModified()
Mark this resource as having been modified.
 o notifyUnload()
This resource is being unloaded.
 o setValue(int, Object)
We overide setValue, to mark the resource as modified.
 o unlock(ResourceLocker)
Unlock the given resource.
 o updateAttributes()
The web admin wants us to update any out of date attribute.

Variables

 o ATTR_IDENTIFIER
  protected static int ATTR_IDENTIFIER
Attribute index - The index for the identifier attribute.
 o ATTR_RESOURCE_STORE
  protected static int ATTR_RESOURCE_STORE
Attribute index - The resource store associated with this resource.

Constructors

 o Resource
  public Resource()
Create an empty resource instance. Initialize the instance attributes description, and its values.

Methods

 o getIdentifier
  public String getIdentifier()
Get this resource identifier.
Returns:
The String value for the identifier.
 o getResourceStore
  public ResourceStore getResourceStore()
Get the store associated with this resource.
Returns:
The associated store or null. Not all resources have a store associated with them (eg the one that whose creation is cheap, etc).
 o markModified
  public void markModified()
Mark this resource as having been modified.
 o setValue
  public void setValue(int idx,
                       Object value)
We overide setValue, to mark the resource as modified.
Parameters:
idx - The index of the attribute to modify.
value - The new attribute value.
Overrides:
setValue in class AttributeHolder
 o notifyUnload
  public void notifyUnload()
This resource is being unloaded. The resource is being unloaded from memory, perform any additional cleanup required.
 o lock
  public boolean lock(ResourceLocker locker)
Lock this resource in its store. Acquire a lock on this resource: if you do acquire the lock, than you are guaranteed that either the resource will be kept in memory, or you will be notified through a call to notifyResourceLockBreak that the resource is going down.
Parameters:
locker - The object willing to acquire the lock.
Returns:
A boolean true if locking succeeded, false otherwise.
 o unlock
  public void unlock(ResourceLocker locker)
Unlock the given resource.
Parameters:
locker - The object that wishes to relinquish the lock.
 o updateAttributes
  public void updateAttributes()
The web admin wants us to update any out of date attribute.

All Packages  Class Hierarchy  This Package  Previous  Next  Index