>>
>>For i.e you have a limit in the MRUMemoryStore for about 200 objects.
When
>>this
>>limit is reached we swap out the oldest object down to the Filesystem.
The
>>key word here is generated data. When we don't do this, then we have
>>to generate this object new, which is very CPU and Memory expensive! So
we
>>introduced this swapping. But it is more application depend!
>>
>> Gerhard
>We need to test Store, It is nothing to talk about at this time.
>I believe it must work good without StoreJanitor.
>I know some situations then it will not work , but it is possible there
are
>more.
Agree! I wanted to setup a junit test enviroment at the weekend! Do you
have
experience with junit?
>It must look like this:
>Store store = new SynchronizedStore( new StoreIfFaundInGet( new
>SoftRefMemoryStore( new JispFilesystemStore( new Tester(CONST,CONST1) ),
>CONST2 ) );
>
>class Tester implements Store{
> Object get(Object key)throws NotFoundException{
> Object value = null;
> for( int i = 0; i < count; i++ )
> value = byte[ size ];
> return value;
> }
> .............................................
>}
>
>class StoreIfFaundInGet implements Store{
>
> Object get(Object key)throws NotFoundException{
> Object value = nextStore.get(key); // Exception if not found
>or IO error
> nextStore.store(key,value);
>
> }
> ............................................
>}
>
>
>We need to call "get"
>
>I think we need to modify JispFilesystemStore this way :
>
>
>public Object get(Object key) throws NeadMeanigfulException{
> Object readObj = null;
>
> try {
> readObj = mDatabase.read(this.wrapKeyObject(key), mIndex);
> } catch (Exception e) {
> //is it means not found ?
> if(nextStore == null ) throw new NeadMeanigfulException(e);
> nextStore.get(key);//it will be generator and tester in test;
>
> e.printStackTrace();
> }
> return readObj;
> }
Ahhh I see, looks interesting too me. I had the similar idea. But I wanted
to implement a SwappingListener which handles this nextStore() stuff. And
the stores much register to this listener, etc...
What do you think!
>================================
>Not very meaningful methods for this kind of store :
>
> void hold(Object key, Object value) throws IOException;
> void free();
> boolean containsKey(Object key);
> Enumeration keys();
Yes you're right. We can change the interface. I just copied from Cocoon
and there I wasn't allowed to change it ;-).
Gerhard
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>