next up previous
Next: Cache Applet Examples Up: The Active Cache Protocol Previous: The Active Cache Protocol

Active Cache Interface

The cache applet must implement an interface called ``ActiveCacheInterface.'' Currently, we require that the applet be written in Java. The interface defines a function called FromCache. The function is called when an access hits in the document, and the arguments of the function call include the user request, the IP address of the client machine, the name of the client machine, the document in cache, and a new file descriptor for the applet to write when constructing a new Web page. The prototype of the function is listed below:

The arguments are included based on the principle that any information that the server can gather if the request goes to the server can be seen by the cache applet. The function can only return three values: All other return values are treated as -1.

The cache applet can only call the ActiveProxy class to perform its functions. The ActiveProxy class provides the native methods for file access , cache query, locking and unlocking as well as sending requests to servers. Currently, the methods include:

As we gain more experience with the Active Cache paradigm, other necessary methods might be added to the ActiveProxy class.

An applet's execution can be aborted at any time. All changes to files and objects are voided if the execution is aborted. In other words, file changes are not committed until the applet finishes its execution.

The restrictions on the use of the proxy calls are the following:

Furthermore, all exceptions are caught and result in a return value of -1 for the FromCache method.

Objects created by an applet (including the log object) are invisible to the outside world except to the original server that sends the applet. A server can gather the log objects of its applets through the Internet Cache Protocol (ICP) (3, 3). ICP is originally designed for cache sharing and serves as a convenient channel for servers to gather log objects.

In addition to the ActiveProxy methods, the only other packages present in the Java run-time environments are java.util, java.text, java.math, java.security and java.sql. All other packages, including java.io, java.lang, and java.systems, are simply not loaded. The proxy can do so because the cache applet has only one purpose, that is, performing per-request processing of the document, and thus needs a very simple security interface.


next up previous
Next: Cache Applet Examples Up: The Active Cache Protocol Previous: The Active Cache Protocol
Pei Cao
7/22/1998