|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.tools.resources.AttributeHolder org.w3c.tools.resources.Resource org.w3c.tools.resources.FramedResource org.w3c.tools.resources.AbstractContainer org.w3c.tools.resources.ContainerResource
public class ContainerResource
This resource manage children resources.
Field Summary | |
---|---|
protected boolean |
acquired
|
protected static int |
ATTR_KEY
Attribute index - The index of the resource key. |
static boolean |
debug
|
Fields inherited from class org.w3c.tools.resources.AbstractContainer |
---|
ur |
Fields inherited from class org.w3c.tools.resources.FramedResource |
---|
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener |
Fields inherited from class org.w3c.tools.resources.Resource |
---|
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id |
Fields inherited from class org.w3c.tools.resources.AttributeHolder |
---|
attributes, values |
Constructor Summary | |
---|---|
ContainerResource()
|
Method Summary | |
---|---|
protected void |
acquireChildren()
Acquire our children. |
protected ResourceReference |
addResource(Resource resource,
java.util.Hashtable defs)
Add an initialized resource into this store container instance. |
ResourceReference |
createDefaultResource(java.lang.String name)
Create a default child resource in that container. |
void |
delete()
Delete that resource container. |
void |
delete(java.lang.String name)
Remove a child resource from that container. |
protected void |
deleteChildren()
|
java.util.Enumeration |
enumerateResourceIdentifiers(boolean all)
Enumerate children resource identifiers. |
protected SpaceEntry |
getChildrenSpaceEntry()
Get the SpaceEntry of our children resources. |
java.lang.Object |
getClone(java.lang.Object[] values)
Clone this attribute holder, and init it with the given attributes. |
java.lang.Integer |
getKey()
Get the container Key. |
protected int |
getMatchingCharsCount(java.lang.String s1,
java.lang.String s2)
Get the number of matching character (case sensitive). |
protected SpaceEntry |
getSpaceEntry()
Get the space entry for that resource. |
void |
initialize(java.lang.Object[] values)
Initialize ourself. |
protected ResourceReference |
internalLookup(java.lang.String name,
SpaceEntry sp,
ResourceSpace space)
|
boolean |
lookup(LookupState ls,
LookupResult lr)
Lookup the next component of this lookup state in here. |
ResourceReference |
lookup(java.lang.String name)
Lookup a children in the container. |
void |
notifyUnload()
This resource is being unloaded. |
void |
registerResource(java.lang.String name,
Resource resource,
java.util.Hashtable defs)
Initialize and register the given resource within that container. |
void |
replace(DirectoryResource newdir)
Delete that container and its children if children is true |
void |
resourceCreated(StructureChangedEvent evt)
A new resource has been created in some space. |
void |
resourceModified(StructureChangedEvent evt)
This handles the RESOURCE_MODIFIED kind of events. |
void |
resourceRemoved(StructureChangedEvent evt)
A resource is about to be removed This handles the RESOURCE_REMOVED kind of events. |
protected ResourceContext |
updateDefaultChildAttributes(java.util.Hashtable attrs)
Update default child attributes. |
Methods inherited from class org.w3c.tools.resources.AbstractContainer |
---|
attributeChanged, enumerateResourceIdentifiers, resourceUnloaded |
Methods inherited from class org.w3c.tools.resources.Resource |
---|
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getStoreEntry, getURLPath, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes |
Methods inherited from class org.w3c.tools.resources.AttributeHolder |
---|
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean debug
protected static int ATTR_KEY
protected boolean acquired
Constructor Detail |
---|
public ContainerResource()
Method Detail |
---|
public java.lang.Object getClone(java.lang.Object[] values)
AttributeHolder
getClone
in class FramedResource
values
- Attribute values to overide in the clone.
public java.lang.Integer getKey()
protected SpaceEntry getSpaceEntry()
Resource
getSpaceEntry
in class Resource
protected SpaceEntry getChildrenSpaceEntry()
public void resourceModified(StructureChangedEvent evt)
RESOURCE_MODIFIED
kind of events.
resourceModified
in interface StructureChangedListener
resourceModified
in class AbstractContainer
evt
- The StructureChangeEvent.public void resourceCreated(StructureChangedEvent evt)
RESOURCE_CREATED
kind of events.
resourceCreated
in interface StructureChangedListener
resourceCreated
in class AbstractContainer
evt
- The event describing the change.public void resourceRemoved(StructureChangedEvent evt)
RESOURCE_REMOVED
kind of events.
resourceRemoved
in interface StructureChangedListener
resourceRemoved
in class AbstractContainer
evt
- The event describing the change.protected ResourceContext updateDefaultChildAttributes(java.util.Hashtable attrs)
This is the method to overide when you want your container to provide these kinds of attributes. By default this method will set the following attributes:
updateDefaultChildAttributes
in class AbstractContainer
attrs
- A hashtable.public java.util.Enumeration enumerateResourceIdentifiers(boolean all)
enumerateResourceIdentifiers
in interface ContainerInterface
enumerateResourceIdentifiers
in class AbstractContainer
all
- Should all resources be enumerated ? Resources are often
created on demand only, this flag allows the caller to tell the
container about wether it is interested only in already created
resources, or in all resources (even the one that have not yet been
created).
public ResourceReference createDefaultResource(java.lang.String name)
createDefaultResource
in class AbstractContainer
name
- The identifier for the new resource.protected int getMatchingCharsCount(java.lang.String s1, java.lang.String s2)
s1
- the first string.s2
- the second string.
public ResourceReference lookup(java.lang.String name)
lookup
in interface ContainerInterface
lookup
in class AbstractContainer
name
- The name of the children to lookup.protected ResourceReference internalLookup(java.lang.String name, SpaceEntry sp, ResourceSpace space)
public boolean lookup(LookupState ls, LookupResult lr) throws ProtocolException
lookup
in class FramedResource
ls
- The current lookup state.lr
- The lookup result under construction.
ProtocolException
- If an error occurs.public void delete(java.lang.String name) throws MultipleLockException
delete
in interface ContainerInterface
delete
in class AbstractContainer
name
- The name of the child to remove.
MultipleLockException
- If somone else has locked the
resource.public void replace(DirectoryResource newdir) throws MultipleLockException
MultipleLockException
- If somone else has locked one
of the resource child.public void delete() throws MultipleLockException
delete
in class FramedResource
MultipleLockException
- If somone else has locked the
resource.protected void deleteChildren() throws MultipleLockException
MultipleLockException
public void notifyUnload()
notifyUnload
in class FramedResource
protected void acquireChildren()
protected ResourceReference addResource(Resource resource, java.util.Hashtable defs)
resource
- The resource to be added to the store.public void registerResource(java.lang.String name, Resource resource, java.util.Hashtable defs) throws InvalidResourceException
registerResource
in interface ContainerInterface
registerResource
in class AbstractContainer
name
- The identifier for the resource.resource
- An unitialized resource instance.defs
- A default set of init attribute values (may be
null).
InvalidResourceException
- If an error occurs during
the registration.public void initialize(java.lang.Object[] values)
initialize
in class FramedResource
values
- Our default attribute values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |