W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 1997

Re: Global Information Store between resources

From: Karen Cheng <karenkay@sholink.com>
Date: Tue, 28 Jan 1997 08:56:52 -0800 (PST)
Message-Id: <m0vpGq4-0002zZC@PebbleBeach.sholink.com>
To: abaird@www10.w3.org
Cc: www-jigsaw@www10.w3.org
Hi Anselm,

> 
> Karen Cheng writes:
>  > Hi Anselm,
>  > 
>  > Thanks for your reply.
>  > 
>  > >  > public class ResourceManager extends HTTPResource {
>  > >  >   static GlobalResource gr;
>  > >  > 
>  > >  >   public ResourceManager() {}
>  > >  > 
>  > >  >   public synchronized GlobalResource getGlobalResource() {
>  > >  >     if (gr == null) {
>  > >  >       // Get the container resource.
>  > >  >       Resource parent = getParent();
>  > >  >       // Lookup the global resource within that container.
>  > >  >       gr = (GlobalResource) ((DirectoryResource) parent).lookup("globalResource\
>  > >  > ");
>  > >  >     }
>  > >  >     return gr;
>  > >  >   }
>  > >  > }
> 
> Where do you get the above "parent" from ? It should rather be
> getParent() by the way.

I have the line Resource parent = getParent(); right above the lookup line,
so I don't quite understand what you mean.

>  > The following is my GlobalResource class:
>  > ...
> This looks ok to me,
> 
> Can you point out line 17 in getGlobalResource ?

Yes, it's:

abstract public class HtmlPage extends PostableResource {

	:	:	:	:	:

  public HtmlPage() {
    ResourceManager rm = new ResourceManager();
    GlobalResource gr = rm.getGlobalResource();   <---- Line 17
	:	:	:	:	:

Thanks,
Karen
Received on Tuesday, 28 January 1997 11:57:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:26 GMT