|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Cacheable | defines an object that can be stored in a CacheTable |
CacheTableEntryInterface | CacheTableEntryInterface is used to make access to Entrys possible |
TableRecordCacheInterface | a cache for TableRecord objects. |
Class Summary | |
---|---|
Access | Access-Objects contain information about single access actions See scone.examples.OberserverTestPlugin for an example how to use the acess-Events |
AccessCache | caches the access table from the database and provides means to update the database |
AccessEvent | used to tell all interested observers about the latest webpage loaded into the browser |
CacheTable | A CacheTable is used to cache the entries of the database. |
DBTableAdapter | stores the database meta information about a TableRecord. |
FieldValueHashTable | holds the values of a TableRecord object. |
Frame | may represent a frame in a web browser in future scone releases |
HtmlNode | a HtmlNode represents a Html document. |
HtmlNodeCache | caches all HtmlNode objects. |
Inclusion | An Inclusion represents the objects included in one web page, like applets, pictures etc. |
InclusionCache | caches all Inclusion objects. |
Keyword | represents a keyword of a NetNode object. |
KeywordCache | Access and cache Keywords and provides means to update the database |
Link | a Link represents a links-set from the database |
LinkCache | caches the links table from the database and provides means to update the database |
LinkToken | a HtmlToken for a link |
LinkVector | a Vector of Link objects |
NetNode | a NetNode represents a node from the Internet. |
NetNodeCache | Caches all NetNode objects. |
Node2Key | a Link represents a links-set from the database |
Node2KeyCache | |
Person | |
PersonCache | Used to access and cache Person objects |
Schema | represents the table definitions of the database restrictions for the sql definition file: Table and column definitions must start in a new line. |
Server | a Server represents a ServerCache-set from the database |
ServerCache | caches the Server table from the database and provides means to update the database |
SimpleUri | This implementation tries to be compliant with RFC2396 (it is not by default, see below!). |
TableRecord | Defines which methods an object must implement to be handled by a cache |
User | A User represents a Scone user. |
UserCache | This Class is used to access User objects and cache them in a hashtable. |
This package provides objects which represent real objects from the internet and the WWW. These objects are persitent in the scone database.
This is the view from outside the package. As an example we have taken NetNode. This example is analogous to Link, HtmlNode, Server, User, etc.
The NetNode objects represent nodes from the internet. They are internally stored in the scone database (this database may run on a local or a remote serer). How this is done is left to the package. Furthermore, NetNode objects are cached in NetNodeCache, a fully static class. You cannot instantiate a NetNode object, you must obtain it from NetNodeCache. This is important for consistency and speed. Please refer to the NetNodeCache documentation to learn how NetNode objects may be obtained from the NetNodeCache.
It is assumed that two pieces of code may write to the same NetNode object at the same time, ie. transactions are not supported.
Example:
NetNode node=NetNodeCache.get("http://www.informatik.uni-hamburg.de");
This line of code will set node to a NetNode object which represents the node located at "http://www.informatik.uni-hamburg.de". NetNodeCache will look up for the specific node in its internal cache. If it is not there, it will create a new NetNode object and cache and return it. The newly created NetNode object will load its data from the database or create a new row in the NetNodes table if neccessary.
How it internally works:
Please note that NetNode and NetNodeCache are the only public classes in this example! All other classes work in the background and and are only visible inside the package. The user never has to store a NetNode instance in the database or read it from there. This is done automatically.
NetNode is the central class in this figure so lets have a look at it:
NetNode extends DBSet. DBSet organizes its data conviniently so that it can easily be stored to the database (that is: it declares Hashtable objects). No direct database access is possible by this class. A DBSet represents a row in a table from the scone database. Consistency lies in the (virtual) hands of DBTable.
NetNode has a class variable which holds a DBTable object which encapsulates access to a specific table (NetNodes) in the scone database. All database access is done through this object.
When a new NetNode is instantiated, DBTable loads the corresponding data from the database or creates a corresponding row in the database. Thus, it is guaranteed that every NetNode object corresponds to a set in the NetNodes table and you do not have to bother to create this correspondence manually.
However, NetNode objects may only be obtained through a NetNodeCache.
NetNode extends DBSet which implements the interface Cacheable. Thus, a CacheTable may cache it. A CacheTable is a Hashtable that allows two keys per value and uses lava.lang.ref.SoftReference objects to free unused entries from memory. NetNode must implement methods which return those two keys. They are public and you can use it in your own scone plugin if you store NetNodes in your own Hashtable.
NetNodeCache is a fully static class. It has a CacheTable to store NetNode objects. You may obtain NetNode objects from this class by using its get methods. NetNodeCache may create a new NetNode object if the desired one is currently not in the CacheTable, or just indicate whether such an object exists. This of course depends on the method invoked.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |