Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
WildCAT: A Generic Framework for Context-Aware Applications. Copyright (C) 2008-2009 Bull S.A.S. Copyright (C) 2008 EMN Contact: wildcat@ow2.org This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Authors: - Pierre-Charles David (initial) - Nicolas Loriant -------------------------------------------------------------------------- $Id: Resource.java 403 2009-01-08 16:26:46Z loris $ --------------------------------------------------------------------------
 
 package org.ow2.wildcat.hierarchy.resource;
 
 import java.util.Set;
 
Define a resource holding some attributes and other resources.
 
 public interface Resource extends Mountable {

    
Attach an attribute at specified location.

Parameters:
attribute path of the Attribute
attr the Attribute
Throws:
ResourceException if the attribute cannot be attached
 
     void attachAttribute(Path attributeAttribute attrthrows 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
 
     void createAttribute(Path attributeWEventInterface.Scope scopeObject valuethrows ResourceException;

    
Return the attribute at specified location.

Parameters:
path path of the attribute
Returns:
the attribute
Throws:
ResourceException if the attribute cannot be retrieved
 
     Attribute getAttribute(Path paththrows ResourceException;

    
Detach an attribute at specified location.

Parameters:
attribute path of the attribute
Throws:
ResourceException if the attribute cannot be detached
 
     void detachAttribute(Path attributethrows ResourceException;

    
Fetch attribute value.

Parameters:
path attribute's path
Returns:
the value of the attribute
Throws:
ResourceException if the attribute cannot be accessed
 
     Object getValue(Path paththrows 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
    Object setValue(Path pathObject valuethrows ResourceException;

    
Creates resources along a path

Parameters:
resource path of resource
Throws:
ResourceException if the resource cannot be created
    void createResource(Path resourcethrows ResourceException;

    
Attach Resource at specified location.

Parameters:
resource path of the Resource
res the Resource
Throws:
ResourceException if the resource cannot be attached
    void attachResource(Path resourceResource resthrows ResourceException;

    
Detach a resource at specified location.

Parameters:
resource path of the Resource
Throws:
ResourceException if the resource cannot be detached
    void detachResource(Path resourcethrows 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
    Resource getResource(Path resthrows 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
    Set<Stringlist(Path resourcethrows ResourceException;
New to GrepCode? Check out our FAQ X