org.ow2.wildcat.hierarchy.resource
Interface Resource

All Superinterfaces:
Mountable

public interface Resource
extends Mountable

Define a resource holding some attributes and other resources.


Method Summary
 void attachAttribute(Path attribute, Attribute attr)
          Attach an attribute at specified location.
 void attachResource(Path resource, Resource res)
          Attach Resource at specified location.
 void createAttribute(Path attribute, WEventInterface.Scope scope, Object value)
          Create a POJO attribute at specified location.
 void createResource(Path resource)
          Creates resources along a path
 void detachAttribute(Path attribute)
          Detach an attribute at specified location.
 void detachResource(Path resource)
          Detach a resource at specified location.
 Attribute getAttribute(Path path)
          Return the attribute at specified location.
 Resource getResource(Path res)
          Return the resource at specified location.
 Object getValue(Path path)
          Fetch attribute value.
 Set<String> list(Path resource)
          List resources and attributes.
 Object setValue(Path path, Object value)
          Set Attribute's value.
 
Methods inherited from interface org.ow2.wildcat.hierarchy.Mountable
isMount, mount, unMount
 

Method Detail

attachAttribute

void attachAttribute(Path attribute,
                     Attribute attr)
                     throws ResourceException
Attach an attribute at specified location.

Parameters:
attribute - path of the Attribute
attr - the Attribute
Throws:
ResourceException - if the attribute cannot be attached

createAttribute

void createAttribute(Path attribute,
                     WEventInterface.Scope scope,
                     Object value)
                     throws ResourceException
Create a POJO attribute at specified location.

Parameters:
attribute - path of the attribute
scope - scope of the events generated when setting the value of POJO
value - attribute initial value
Throws:
ResourceException - if the attribute cannot be created

getAttribute

Attribute getAttribute(Path path)
                       throws ResourceException
Return the attribute at specified location.

Parameters:
path - path of the attribute
Returns:
the attribute
Throws:
ResourceException - if the attribute cannot be retrieved

detachAttribute

void detachAttribute(Path attribute)
                     throws ResourceException
Detach an attribute at specified location.

Parameters:
attribute - path of the attribute
Throws:
ResourceException - if the attribute cannot be detached

getValue

Object getValue(Path path)
                throws ResourceException
Fetch attribute value.

Parameters:
path - attribute's path
Returns:
the value of the attribute
Throws:
ResourceException - if the attribute cannot be accessed

setValue

Object setValue(Path path,
                Object value)
                throws ResourceException
Set Attribute's value.

Parameters:
path - path of the Attribute
value - new value of the Attribute
Returns:
previous value of the Attribute
Throws:
ResourceException - if the attribute cannot be accessed

createResource

void createResource(Path resource)
                    throws ResourceException
Creates resources along a path

Parameters:
resource - path of resource
Throws:
ResourceException - if the resource cannot be created

attachResource

void attachResource(Path resource,
                    Resource res)
                    throws ResourceException
Attach Resource at specified location.

Parameters:
resource - path of the Resource
res - the Resource
Throws:
ResourceException - if the resource cannot be attached

detachResource

void detachResource(Path resource)
                    throws ResourceException
Detach a resource at specified location.

Parameters:
resource - path of the Resource
Throws:
ResourceException - if the resource cannot be detached

getResource

Resource getResource(Path res)
                     throws ResourceException
Return the resource at specified location.

Parameters:
res - path of the Resource
Returns:
the resource at specified location.
Throws:
ResourceException - if the resource cannot be accessed

list

Set<String> list(Path resource)
                 throws ResourceException
List resources and attributes.

Parameters:
resource - indicates the resource to inspect, or 'this' if null
Returns:
A set of String, attribute's names preceded with '#'
Throws:
ResourceException - if the resource cannot be accessed


Copyright © 2010 OW2 Consortium. All Rights Reserved.