David Sean Taylor escribió:
I'll send it CC to the list, with the old subject, so that the answer is
public and other people can contribute.
> Hi Santiago,
>
> I think you may have missed my email yesterday on the mailing list, so Im
> including it again below.
> Hope you don't mind me asking you directly, but I often do not receive
> responses to threads that I start on the mailing list, for what reasons I
> really dont know.
>
I was waiting until now, that I'm back in the office, to answer. This
time I
even flagged it to make sure I would remember,
>
> On a more serious subject :), I believe that you and I have broken the
> build.
> On your part, NewRSSPortlet uses the JetspeedXMLReaderFactory, which was
> deleted.
>
It seems that I forgot to commit this one. I have just done it. Sorry
aboutthat one :-(
>
> Here is the email from yesterday:
>
> "
> Santiago, could you help me in understanding how the DiskCache works?
> What I'd like to do is cache content in memory, but when the resource
> changes on the disk, then refresh it.
With the old cache, entries are checked only when the DiskCacheDaemon
runs.
The method "hasExpired" for a cache entry tells wether it has expired,
and
something like:
URLFetcher.refresh( url ) should try to refresh (in the same thread)
and
return true, if it got refreshed, or false, if either it was not expired
or
there was some problem, or it was not modified in the server.
The whole interface is changing. For the new version, I am implementing
the
cache entries as java.util.Observable, so that any object can declare
itself
as an observer of the entry, and be notified either when it expires or
when it
gets refreshed. Also, the entries will have a refresh method that will
handle
the refresh, if needed.
I'm using Observable for tests, but we can change this class by some
other
interface if needed after the concept is tested. I will look for similar
patterns in Turbine/Avalon code.
>
> Like the XSLPortlet. To optimize its performance it shouldn't have to run
> the transform everytime.
> Is caching content something that the DiskCache should be providing, or
> should we be writing that code in our portlets (like the XSLPortlet)?
>
> Or for a simple html file. Is the DiskCache supposed to cache the file in
> memory, and then figure out when its been modified and keep the memory copy
> sychronized?
The actual disk cache does not handle caching in memory. For what you
want, we
should probably have a "glue" object that contains the object, caches
itself
in memory using the memory cache, and takes care of the interaction with
the
disk cache.
The portlet used a memory cache, so your portlet should be cached in
memory,
until it expires. Once it expires, it will be reinstantiated. Look at
the
code in PortletFactory.
You should think of the disk cache as URLManager, or ResourceManager. It
is on
charge of synchronising fetching and caching of external resources, more
or
less like what a HTTP proxy would do.
I think that the portlet expiration mechanism has some flaws, and
possibly
also the Disk Cache.
I don't look at it very much, since the code is very messy and I'm
working in
a replacement. It has to be ready "real soon now". :-)
>
> "
>
> Thanks,
>
> David
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?: [EMAIL PROTECTED]