Java Doc for Resource.java in  » Web-Server » Jigsaw » org » w3c » tools » resources » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.tools.resources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.w3c.tools.resources.AttributeHolder
      org.w3c.tools.resources.Resource

All known Subclasses:   org.w3c.tools.resources.FramedResource,  org.w3c.jigsaw.auth.AuthUser,  org.w3c.jigsaw.config.PropertySet,
Resource
public class Resource extends AttributeHolder (Code)
The resource class describes an object, accessible through the server. Resource objects are required to have the following properties:
  • They must be persistent (their life-time can span multiple server life-time).
  • They must be editable, so that one can change some of their aspects (such as any associated attribute).
  • They must be self-described: each resource must now what kind of attribute it understands.
  • They must be able to update themselves: some of the meta-information associated with a resource may require lot of CPU to compute.
  • They must implement some name-service policy.

These resource objects do not define how they are accessed. See the sub-classes for specific accesses.



Field Summary
protected static  intATTR_CONTEXT
     Attribute index - The hierarchical context of the resource.
protected static  intATTR_HELP_URL
    
protected static  intATTR_IDENTIFIER
     Attribute index - The index for the identifier attribute.
protected static  intATTR_LAST_MODIFIED
     Attribute index - The index for the last-modified attribute.
protected static  intATTR_PARENT
     Attribute index - The index for our parent attribute.
protected static  intATTR_RESOURCE_FRAMES
    
protected static  intATTR_STORE_ENTRY
     Attribute index - The index of the resource store entry attribute.
protected static  intATTR_URL
     Attribute index - The index for our URL attribute.
public static  Stringco
    
public static  Stringid
    

Constructor Summary
public  Resource()
     Create an empty resource instance.

Method Summary
public  booleanacceptUnload()
     Is that resource willing to be unloaded. This method is a bit tricky to implement.
protected  voidcheckMultipleLock(ResourceReference rr)
     Check if this resource is loked more than one time.
public synchronized  ResourceFrame[]collectFrames(Class c)
     Collect any frame that's an instance of the given class.
Parameters:
  cls - The class of frames we are looking for.
public synchronized  voiddelete()
     Delete this Resource instance, and remove it from its store.
public  ObjectgetClone(Object values)
    
protected  ResourceContextgetContext()
     Get the hierarchical context for that resource.
public synchronized  ResourceFramegetFrame(Class c)
     Get the first occurence of a frame of the given class.
Parameters:
  cls - The class of te frame to look for.
public synchronized  ResourceFrame[]getFrames()
     Collect all frames.
public  StringgetHelpURL()
     Get this resource's help url.
public  StringgetHelpURL(String topics)
     Get the help URL for that resource's topic.
Parameters:
  topic - The topic you want help for.
public  StringgetIdentifier()
     Get this resource identifier.
public  longgetLastModified()
     Get this resource last modification time.
public  ResourceReferencegetParent()
     Get this resource parent resource.
public  ResourceReferencegetResourceReference()
     Get the ResourceReference of that resource.
public  ServerInterfacegetServer()
     Get the server this resource is served by.
protected  ResourceSpacegetSpace()
     Get the ResourceSpace where this resource is stored.
protected  SpaceEntrygetSpaceEntry()
     Get the space entry for that resource.
public  ObjectgetStoreEntry()
     Get the store entry for that resource. Only the resource store in charge of this resource knows about the type of the resulting object.
public  StringgetURLPath()
     Get the file part of the URL this resource is attached to.
public synchronized  ObjectgetValue(int idx, Object def)
    
public synchronized  ObjectgetValue(Class c, int idx, Object def)
     Get an attached frame attribute value. This method really is a short-hand that combines a getFrame and getValue method call.
Parameters:
  cls - The class of the frame we want the value of.
Parameters:
  idx - The attribute index.
Parameters:
  def - The default value (if the attribute value isn't defined).
public  voidinitialize(Hashtable defs)
     Initialization method for attribute holders.
public  voidinitialize(Object values)
    
public  booleanisInitialized()
    
public  booleanisUnloaded()
    
public  voidmarkModified()
     Mark this resource as having been modified.
public  voidnotifyUnload()
     This resource is being unloaded.
public  voidpickleValues(Hashtable defs)
     Set the values.
public  voidregisterFrame(ResourceFrame frame, Hashtable defs)
     Initialize and attach a new ResourceFrame to that resource.
protected  voidsetContext(ResourceContext context)
     Set the given context as the current context of this resource.
protected  voidsetContext(ResourceContext context, boolean keepmodules)
     Set the given context as the current context of this resource.
public synchronized  voidsetValue(Class c, int idx, Object val)
     Set an attached frame attribute value.
public  voidsetValue(int idx, Object value)
     We overide setValue, to mark the resource as modified.
public synchronized  voidunregisterFrame(ResourceFrame frame)
     Unregister a resource frame from the given resource.
 ResourceFrame[]unsafeCollectFrames(Class c)
     Collect any frame that's an instance of the given class.
Parameters:
  cls - The class of frames we are looking for.
protected  ResourceContextunsafeGetContext()
    
public  ResourceFrameunsafeGetFrame(Class c)
     Get the first occurence of a frame of the given class.
Parameters:
  cls - The class of te frame to look for.
public  ResourceFrame[]unsafeGetFrames()
     Collect all frames.
public  StringunsafeGetIdentifier()
     Get this resource identifier.
public  ResourceReferenceunsafeGetResourceReference()
     Get the ResourceReference of that resource.
public  StringunsafeGetURLPath()
     Get the file part of the URL this resource is attached to.
public  ObjectunsafeGetValue(int idx, Object def)
    
public  voidupdateAttributes()
     The web admin wants us to update any out of date attribute.

Field Detail
ATTR_CONTEXT
protected static int ATTR_CONTEXT(Code)
Attribute index - The hierarchical context of the resource.



ATTR_HELP_URL
protected static int ATTR_HELP_URL(Code)
Attribute index - The help URL for this resource (Ref doc)



ATTR_IDENTIFIER
protected static int ATTR_IDENTIFIER(Code)
Attribute index - The index for the identifier attribute.



ATTR_LAST_MODIFIED
protected static int ATTR_LAST_MODIFIED(Code)
Attribute index - The index for the last-modified attribute.



ATTR_PARENT
protected static int ATTR_PARENT(Code)
Attribute index - The index for our parent attribute.



ATTR_RESOURCE_FRAMES
protected static int ATTR_RESOURCE_FRAMES(Code)
Attribute index - Associated resource frames



ATTR_STORE_ENTRY
protected static int ATTR_STORE_ENTRY(Code)
Attribute index - The index of the resource store entry attribute.



ATTR_URL
protected static int ATTR_URL(Code)
Attribute index - The index for our URL attribute.



co
public static String co(Code)



id
public static String id(Code)




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




Method Detail
acceptUnload
public boolean acceptUnload()(Code)
Is that resource willing to be unloaded. This method is a bit tricky to implement. The guideline is that you should not dynamically change the returned value (since you can't control what happens between a call to that method and a call to the notifyUnload method).

Returning false should never be needed, except for very strange resources. A boolean true if the resource can be unloadedfalse otherwise.




checkMultipleLock
protected void checkMultipleLock(ResourceReference rr) throws MultipleLockException(Code)
Check if this resource is loked more than one time.
exception:
  MultipleLockException - is thrown if true.



collectFrames
public synchronized ResourceFrame[] collectFrames(Class c)(Code)
Collect any frame that's an instance of the given class.
Parameters:
  cls - The class of frames we are looking for. An array of ResourceFrame, containing a set of frames instancesof the given class, or null if no resource frame isavailable.



delete
public synchronized void delete() throws MultipleLockException(Code)
Delete this Resource instance, and remove it from its store. This method will erase definitely this resource, for ever, by removing it from its resource store (when doable).
exception:
  MultipleLockException - if someone else has locked this resource



getClone
public Object getClone(Object values)(Code)



getContext
protected ResourceContext getContext()(Code)
Get the hierarchical context for that resource. A ResourceContext instance, guaranteed not to be null



getFrame
public synchronized ResourceFrame getFrame(Class c)(Code)
Get the first occurence of a frame of the given class.
Parameters:
  cls - The class of te frame to look for. A ResourceFrame instance, or null.



getFrames
public synchronized ResourceFrame[] getFrames()(Code)
Collect all frames. An array of ResourceFrame, containing a set of frames instancesor null if no resource frame is available.



getHelpURL
public String getHelpURL()(Code)
Get this resource's help url. An URL, encoded as a String, or null if notavailable.



getHelpURL
public String getHelpURL(String topics)(Code)
Get the help URL for that resource's topic.
Parameters:
  topic - The topic you want help for. A String encoded URL, or null if nonewas found.



getIdentifier
public String getIdentifier()(Code)
Get this resource identifier. The String value for the identifier.



getLastModified
public long getLastModified()(Code)
Get this resource last modification time. A long giving the date of the last modification time, or-1 if undefined.



getParent
public ResourceReference getParent()(Code)
Get this resource parent resource. The parent of a resource can be either null if it is the server root resource, or any Resource. An instance of ResourceReference, or null



getResourceReference
public ResourceReference getResourceReference()(Code)
Get the ResourceReference of that resource. ResourceReference is the only public way to access a resource. a ResourceReference instance.



getServer
public ServerInterface getServer()(Code)
Get the server this resource is served by. The first instance of Jigsaw this resource was attached to.



getSpace
protected ResourceSpace getSpace()(Code)
Get the ResourceSpace where this resource is stored. A ResourceSpace instance.



getSpaceEntry
protected SpaceEntry getSpaceEntry()(Code)
Get the space entry for that resource. This Object is use to retrieve the resource in the resource space. A spaceEntry instance.



getStoreEntry
public Object getStoreEntry()(Code)
Get the store entry for that resource. Only the resource store in charge of this resource knows about the type of the resulting object. Buy declaring the class of that object private, the resource store can assume some private access to it. A java Object instance, or null if no store entry is attached to that resource.



getURLPath
public String getURLPath()(Code)
Get the file part of the URL this resource is attached to. An URL object specifying the location in the information space of this resource.



getValue
public synchronized Object getValue(int idx, Object def)(Code)



getValue
public synchronized Object getValue(Class c, int idx, Object def)(Code)
Get an attached frame attribute value. This method really is a short-hand that combines a getFrame and getValue method call.
Parameters:
  cls - The class of the frame we want the value of.
Parameters:
  idx - The attribute index.
Parameters:
  def - The default value (if the attribute value isn't defined). The attribute value as an Object instance, or the provideddefault value if the attribute value isn't defined.



initialize
public void initialize(Hashtable defs)(Code)
Initialization method for attribute holders. This method allows to initialize an attribute holder by providing its attributes values through a Hashtable mapping attribute names to attribute values.
Parameters:
  defs - The Hashtable containing the default values.



initialize
public void initialize(Object values)(Code)



isInitialized
public boolean isInitialized()(Code)



isUnloaded
public boolean isUnloaded()(Code)
unloaded? true if the resource has been unloaded.



markModified
public void markModified()(Code)
Mark this resource as having been modified.



notifyUnload
public void notifyUnload()(Code)
This resource is being unloaded. The resource is being unloaded from memory, perform any additional cleanup required.



pickleValues
public void pickleValues(Hashtable defs)(Code)
Set the values. (MUST be called before initialize).
Parameters:
  defs - The Hashtable containing the values.



registerFrame
public void registerFrame(ResourceFrame frame, Hashtable defs)(Code)
Initialize and attach a new ResourceFrame to that resource.
Parameters:
  frame - An uninitialized ResourceFrame instance.
Parameters:
  defs - A default set of attribute values.



setContext
protected void setContext(ResourceContext context)(Code)
Set the given context as the current context of this resource.
Parameters:
  context - The new context.



setContext
protected void setContext(ResourceContext context, boolean keepmodules)(Code)
Set the given context as the current context of this resource.
Parameters:
  context - The new context.
Parameters:
  keepmodules - If true the new context will have the samemodules than the old one.



setValue
public synchronized void setValue(Class c, int idx, Object val)(Code)
Set an attached frame attribute value. This method really is a short-hand that combines a getFrame and a setValue method call.
Parameters:
  cls - The class of the frame we want to modify.
Parameters:
  idx - The attribute to modify.
Parameters:
  val - The new attribute value.



setValue
public void setValue(int idx, Object value)(Code)
We overide setValue, to mark the resource as modified.
Parameters:
  idx - The index of the attribute to modify.
Parameters:
  value - The new attribute value.



unregisterFrame
public synchronized void unregisterFrame(ResourceFrame frame)(Code)
Unregister a resource frame from the given resource.
Parameters:
  frame - The frame to unregister from the resource.



unsafeCollectFrames
ResourceFrame[] unsafeCollectFrames(Class c)(Code)
Collect any frame that's an instance of the given class.
Parameters:
  cls - The class of frames we are looking for. An array of ResourceFrame, containing a set of frames instancesof the given class, or null if no resource frame isavailable.



unsafeGetContext
protected ResourceContext unsafeGetContext()(Code)



unsafeGetFrame
public ResourceFrame unsafeGetFrame(Class c)(Code)
Get the first occurence of a frame of the given class.
Parameters:
  cls - The class of te frame to look for. A ResourceFrame instance, or null.



unsafeGetFrames
public ResourceFrame[] unsafeGetFrames()(Code)
Collect all frames. An array of ResourceFrame, containing a set of frames instancesor null if no resource frame is available.



unsafeGetIdentifier
public String unsafeGetIdentifier()(Code)
Get this resource identifier. The String value for the identifier.



unsafeGetResourceReference
public ResourceReference unsafeGetResourceReference()(Code)
Get the ResourceReference of that resource. ResourceReference is the only public way to access a resource. a ResourceReference instance.



unsafeGetURLPath
public String unsafeGetURLPath()(Code)
Get the file part of the URL this resource is attached to. An URL object specifying the location in the information space of this resource.



unsafeGetValue
public Object unsafeGetValue(int idx, Object def)(Code)



updateAttributes
public void updateAttributes()(Code)
The web admin wants us to update any out of date attribute.



Fields inherited from org.w3c.tools.resources.AttributeHolder
protected Attribute attributes(Code)(Java Doc)
protected Object values(Code)(Java Doc)

Methods inherited from org.w3c.tools.resources.AttributeHolder
public boolean definesAttribute(int idx) throws IllegalAttributeAccess(Code)(Java Doc)
public boolean definesAttribute(String name) throws IllegalAttributeAccess(Code)(Java Doc)
public Attribute[] getAttributes()(Code)(Java Doc)
public boolean getBoolean(int idx, boolean def)(Code)(Java Doc)
public char getChar(int idx, char def)(Code)(Java Doc)
public Object getClone(Object values)(Code)(Java Doc)
public synchronized Object getClone()(Code)(Java Doc)
public synchronized Object getClone(Hashtable defs)(Code)(Java Doc)
public double getDouble(int idx, double def)(Code)(Java Doc)
public float getFloat(int idx, float def)(Code)(Java Doc)
public int getInt(int idx, int def)(Code)(Java Doc)
public long getLong(int idx, long def)(Code)(Java Doc)
public String getString(int idx, String def)(Code)(Java Doc)
public synchronized Object getValue(int idx, Object def) throws IllegalAttributeAccess(Code)(Java Doc)
public Object getValue(String name, Object def) throws IllegalAttributeAccess(Code)(Java Doc)
public synchronized void initialize(Object nvalues)(Code)(Java Doc)
public synchronized void initialize(Hashtable defs)(Code)(Java Doc)
public int lookupAttribute(String name)(Code)(Java Doc)
public synchronized void pickleValues(Hashtable defs)(Code)(Java Doc)
public void print(PrintStream out)(Code)(Java Doc)
public void setBoolean(int idx, boolean b)(Code)(Java Doc)
public void setChar(int idx, char ch) throws IllegalAttributeAccess(Code)(Java Doc)
public void setDouble(int idx, double d) throws IllegalAttributeAccess(Code)(Java Doc)
public void setFloat(int idx, float f) throws IllegalAttributeAccess(Code)(Java Doc)
public void setInt(int idx, int i) throws IllegalAttributeAccess(Code)(Java Doc)
public void setLong(int idx, long l) throws IllegalAttributeAccess(Code)(Java Doc)
public void setString(int idx, String s) throws IllegalAttributeAccess(Code)(Java Doc)
public synchronized void setValue(int idx, Object value)(Code)(Java Doc)
public void setValue(String name, Object value)(Code)(Java Doc)
public boolean unsafeDefinesAttribute(int idx) throws IllegalAttributeAccess(Code)(Java Doc)
public double unsafeGetDouble(int idx, double def)(Code)(Java Doc)
public String unsafeGetString(int idx, String def)(Code)(Java Doc)
public Object unsafeGetValue(int idx, Object def) throws IllegalAttributeAccess(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.