    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class org.w3c.tools.resources.FramedResource

    java.lang.Object
       |
       +----org.w3c.tools.resources.AttributeHolder
               |
               +----org.w3c.tools.resources.Resource
                       |
                       +----org.w3c.tools.resources.FramedResource

public class FramedResource
extends Resource
implements FrameEventListener

A FramedResource manage frames which are called during the lookup and the perform.

##

ATTR_OID
  Attribute index - The object identifier.
attrListener
  Our AttributeChangedListener.
debugEvent
event_disabled
framesRef
  Our frames references.
structListener
  Our StructureChangedListener.

##

FramedResource()

##

addAttributeChangedListener(AttributeChangedListener)
  Add an attribute change listener.
addStructureChangedListener(StructureChangedListener)
  Add a structure change listener.
collectFramesReference(Class)
  Collect any frame reference pointing to an instance of the given class.
delete()
  Delete this Resource instance, and remove it from its store.
disableEvent()
displayEvent(FramedResource, EventObject)
enableEvent()
fireAttributeChangeEvent(AttributeChangedEvent)
  Fire an attribute change event.
fireStructureChangedEvent(int)
  Fire an structure change event.
fireStructureChangedEvent(StructureChangedEvent)
  Fire an structure change event.
frameAdded(FrameEvent)
  This handles the `FRAME_ADDED` kind of events.
frameModified(FrameEvent)
  This handles the `FRAME_MODIFIED` kind of events.
frameRemoved(FrameEvent)
  A frame is about to be removed This handles the `FRAME_REMOVED` kind of events.
getClone(Object[])
  Clone this attribute holder, and init it with the given attributes.
getFrameReference(Class)
  Get the first occurence of a frame of the given class.
getFrameReference(ResourceFrame)
  Get The FrameReference of the given frame, or null if the frame is not registered.
getFramesReference()
  Collect all frames references.
getOid()
  Get this resource's object identifier.
getServer()
  Get the server this resource is served by.
initialize(Object[])
  Initialize the frames of that framed resource.
lookup(LookupState, LookupResult)
  FIXME doc
markModified()
  Mark this resource as having been modified.
perform(RequestInterface)
  FIXME doc
performFrames(RequestInterface)
  Perform the request on all the frames of that resource.
postAttributeChangeEvent(int, Object)
  post an attribute change event.
postEvent(ResourceEvent)
  Post an Event in the Event Queue.
postStructureChangedEvent(int)
  post an structure change event.
postStructureChangedEvent(ResourceReference, int)
  post an structure change event.
processEvent(ResourceEvent)
  (AWT Like), dspatch the Event to all our listeners.
registerFrame(ResourceFrame, Hashtable)
  Initialize and attach a new ResourceFrame to that resource.
registerFrameIfNone(String, String)
  Register a new ResourceFrame if none (from the same class) has been registered.
removeAttributeChangedListener(AttributeChangedListener)
  Remove an attribute change listener.
removeStructureChangedListener(StructureChangedListener)
  Remove a structure change listener.
setValue(int, Object)
  Set some of this resource attribute.
unregisterFrame(ResourceFrame)
  Unregister a resource frame from the given resource.

##

framesRef

     protected transient Hashtable framesRef

  Our frames references.

attrListener

     protected transient AttributeChangedListener attrListener

  Our AttributeChangedListener.

structListener

     protected transient StructureChangedListener structListener

  Our StructureChangedListener.

debugEvent

     protected transient boolean debugEvent

event_disabled

     protected transient boolean event_disabled

ATTR_OID

     protected static int ATTR_OID

  Attribute index - The object identifier.

##

FramedResource

     public FramedResource()

##

disableEvent

     protected void disableEvent()

enableEvent

     protected void enableEvent()

getClone

     public Object getClone(Object values[])

  Clone this attribute holder, and init it with the given attributes.

  Overrides:
    getClone in class Resource

getServer

     public ServerInterface getServer()

  Get the server this resource is served by.

  Returns:
    The first instance of Jigsaw this resource was attached to.

getOid

     public int getOid()

  Get this resource's object identifier. An object identifier is to be used specifically in etags. It's purpose is to uniquify the etag of a resource. It's computed as a random number , on demand only.

  Returns:
    A uniq object identifier for that resource, as an inteeger.

displayEvent

     protected void displayEvent(FramedResource fr,
                                 EventObject evt)

frameAdded

     public void frameAdded(FrameEvent evt)

  This handles the `FRAME_ADDED` kind of events.

  Parameters:
    evt - The FrameEvent.

frameModified

     public void frameModified(FrameEvent evt)

  This handles the `FRAME_MODIFIED` kind of events.

  Parameters:
    evt - The event describing the change.

frameRemoved

     public void frameRemoved(FrameEvent evt)

  A frame is about to be removed This handles the `FRAME_REMOVED` kind of events.

  Parameters:
    evt - The event describing the change.

registerFrame

     public void registerFrame(ResourceFrame frame,
                               Hashtable defs)

  Initialize and attach a new ResourceFrame to that resource.

  Parameters:
    frame - An uninitialized ResourceFrame instance.
    defs - A default set of attribute values.
  Overrides:
    registerFrame in class Resource

registerFrameIfNone

     protected void registerFrameIfNone(String classname,
                                        String identifier) throws ClassNotFoundException, IllegalAccessException, InstantiationException, ClassCastException

  Register a new ResourceFrame if none (from the same class) has been registered.

  Parameters:
    classname - The ResourceFrame class
    identifier - The ResourceFrame identifier
  Throws: ClassNotFoundException
    if the class can't be found
  Throws: IllegalAccessException
    if the class or initializer is not accessible
  Throws: InstantiationException
    if the class can't be instanciated
  Throws: ClassCastException
    if the class is not a ResourceFrame

unregisterFrame

     public synchronized void unregisterFrame(ResourceFrame frame)

  Unregister a resource frame from the given resource.

  Parameters:
    frame - The frame to unregister from the resource.
  Overrides:
    unregisterFrame in class Resource

getFramesReference

     public synchronized ResourceReference[] getFramesReference()

  Collect all frames references.

  Returns:
    An array of ResourceReference, containing a set of FrameReference instances or null if no resource frame is available.

collectFramesReference

     public synchronized ResourceReference[] collectFramesReference(Class c)

  Collect any frame reference pointing to an instance of the given class.

  Parameters:
    cls - The class of frames we are looking for.
  Returns:
    An array of ResourceReference, containing a set of FrameReference pointing to instances of the given class, or null if no resource frame is available.

getFrameReference

     public synchronized ResourceReference getFrameReference(Class c)

  Get the first occurence of a frame of the given class.

  Parameters:
    cls - The class of te frame to look for.
  Returns:
    A ResourceReference instance, or null.

getFrameReference

     public synchronized ResourceReference getFrameReference(ResourceFrame frame)

  Get The FrameReference of the given frame, or null if the frame is not registered.

  Parameters:
    frame - The ResourceFrame.
  Returns:
    A ResourceReference instance.

processEvent

     public void processEvent(ResourceEvent evt)

  (AWT Like), dspatch the Event to all our listeners.

  Parameters:
    evt - The resourceEvent to dispatch.

postEvent

     public void postEvent(ResourceEvent evt)

  Post an Event in the Event Queue.

  Parameters:
    evt - The Event to post.

addAttributeChangedListener

     public void addAttributeChangedListener(AttributeChangedListener l)

  Add an attribute change listener.

  Parameters:
    l - The new attribute change listener.

removeAttributeChangedListener

     public void removeAttributeChangedListener(AttributeChangedListener l)

  Remove an attribute change listener.

  Parameters:
    l - The listener to remove.

postAttributeChangeEvent

     protected void postAttributeChangeEvent(int idx,
                                             Object newvalue)

  post an attribute change event.

  Parameters:
    idx - The index of the attribute that has changed.
    newvalue - The new value for that attribute.

fireAttributeChangeEvent

     protected void fireAttributeChangeEvent(AttributeChangedEvent evt)

  Fire an attribute change event.

  Parameters:
    evt - the AttributeChangedEvent to fire.

addStructureChangedListener

     public void addStructureChangedListener(StructureChangedListener l)

  Add a structure change listener.

  Parameters:
    l - The new structure change listener.

removeStructureChangedListener

     public void removeStructureChangedListener(StructureChangedListener l)

  Remove a structure change listener.

  Parameters:
    l - The listener to remove.

postStructureChangedEvent

     protected void postStructureChangedEvent(ResourceReference rr,
                                              int type)

  post an structure change event.

  Parameters:
    rr - the ResourceReference of the source.
    type - The type of the event.

postStructureChangedEvent

     protected void postStructureChangedEvent(int type)

  post an structure change event.

  Parameters:
    type - The type of the event.

fireStructureChangedEvent

     protected void fireStructureChangedEvent(int type)

  Fire an structure change event.

  Parameters:
    type - The type of the event.

fireStructureChangedEvent

     protected void fireStructureChangedEvent(StructureChangedEvent evt)

  Fire an structure change event.

  Parameters:
    evt - the StructureChangedEvent to fire.

delete

     public synchronized void delete() throws MultipleLockException

  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).

  Overrides:
    delete in class Resource

markModified

     public void markModified()

  Mark this resource as having been modified.

  Overrides:
    markModified in class Resource

setValue

     public synchronized void setValue(int idx,
                                       Object value)

  Set some of this resource attribute. We overide setValue to post events.

  Overrides:
    setValue in class Resource

lookup

     public boolean lookup(LookupState ls,
                           LookupResult lr) throws ProtocolException

  FIXME doc

performFrames

     protected ReplyInterface performFrames(RequestInterface request) throws ProtocolException, NotAProtocolException

  Perform the request on all the frames of that resource. The Reply returned is the first non-null reply.

  Parameters:
    request - A RequestInterface instance.
  Returns:
    A ReplyInterface instance.

perform

     public ReplyInterface perform(RequestInterface request) throws ProtocolException, NotAProtocolException

  FIXME doc

initialize

     public void initialize(Object values[])

  Initialize the frames of that framed resource.

  Parameters:
    values - Default attribute values.
  Overrides:
    initialize in class AttributeHolder

    All Packages  Class Hierarchy  This Package  Previous  Next  Index