01: // VirtualHostResource.java
02: // $Id: VirtualHostResource.java,v 1.15 2002/06/26 17:55:05 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1998.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigsaw.resources;
07:
08: import java.util.Hashtable;
09: import org.w3c.tools.resources.ContainerResource;
10: import org.w3c.tools.resources.ResourceContext;
11:
12: public class VirtualHostResource extends ContainerResource {
13:
14: /**
15: * Update default child attributes.
16: * A parent can often pass default attribute values to its children,
17: * such as a pointer to itself (the <em>parent</em> attribute).
18: * <p>This is the method to overide when you want your container
19: * to provide these kinds of attributes. By default this method will set
20: * the following attributes:
21: * <dl><dt>name<dd>The name of the child (it's identifier) -
22: * String instance.
23: * <dt>parent<dd>The parent of the child (ie ourself here) -
24: * a ContainerResource instance.
25: * <dt>url<dd>If a <em>identifier</em> attribute is defined, that
26: * attribute is set to the full URL path of the children.
27: * </dl>
28: */
29:
30: protected ResourceContext updateDefaultChildAttributes(
31: Hashtable attrs) {
32: ResourceContext context = super
33: .updateDefaultChildAttributes(attrs);
34: if (context == null) {
35: context = new ResourceContext(getContext());
36: attrs.put(co, context);
37: }
38: attrs.put(ur, "/");
39: return context;
40: }
41: }
|