|
|||||
|
|||||
Back to > Overview > Developers Guide |
Authors: | |
Szabo Csaba <crow@nolimits.ro> | |
Antal Attila <atech@nolimits.ro> |
1. Using JNDI naming system
2. Scheduling the lexical jobs 2.1. Why Datastore need the scheduler? 2.2. Using the Avalon Cornerstone 2.3. The StoreScheduler 2.4. StoreScheduler targets |
For passing parameters between block (services) the Datastore is use the JNDI naming system. The JNDI MemoryContextFactory was make static to obtain only one reference for every block. In the initial context factory we have this static object named StaticMemoryContextFactory. This context is uploaded first time together with the naming block. This block file is the naming.jar. All blocks which using the naming system is dependent from this block.
The following example shows, how you can initialize the naming system:
|
In each block where was used the naming you will find this context initialization, and after this, everywhere was used the ctx.bind(), and the ctx.lookup() methods for put and get objects.
When Datastore stores data in database you need to cut the data to obtain and store the words. These words will be used for the indexed search. This procedure can take a longer period of time and depends on the volume of stored data. This method was separated from the engine and it was attached to a self-scheduler system. In other case it can be called directly.
The cornerstone is an Avalon utility package for the framework and has some utilities. One of them is the scheduler and the Datastore it was used.
The StoreScheduler is a Datastore scheduler service using the cornerstone scheduler, on the other hand the StoreScheduler is a block named scheduler.jar having a dependency from cornerstone.bar. The offered service and the dependency was registered in the self-.xinfo file and in the assembly.xml, they are the following:
StoreScheduler.xinfo
|
assembly.xml
|
The important thing in configuration is the conversion of the crontables. The cornerstone scheduler uses a special self-format. Datastore uses the Unix like crontab. The Unix systems crontab format was need to be converted to a format named cornerstone crontable.
Each class can be a target of StoreScheduler, for this you need:
In the Datastore we have only a single target named LexiconManager. You can see there the whole implementation of the target.