commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Smuts" <aaron.smu...@verizon.net>
Subject RE: [simplestore] enhancements (was: [simplestore] inital check in)
Date Wed, 16 Jan 2002 13:51:05 GMT
 
> 
> Good candidate for example is javax.servlet.http.HttpSession
> implementation :
> 
>   public class  PersistentHttpSession implements
> javax.servlet.http.HttpSession{
>     .....................................
>   public   PersistentHttpSession( javax.servlet.http.HttpSession
> session,Store store){
>        this.session = session;
>        this.store = store;
>   }
> 
> public void setAttribute(String key,Object value){
> 
>     store.store( new KeyPair(session.getId(),key),value);
>   // it is answer why KeyPair is useful. You can use new String(
> session.getId() +" somethig to separate "+ key ) here,
> // but this will not work for all types of keys and all cases
> 
> }
> 
> 
>
........................................................................
> 
> }
 
The example prompts a few points.  You'd be creating some sort of
secondary session.  How would you go about getting the attribute name
list?  Would you really want to tie the store to the user and have a
half baked session?  Why even have a special servlet?  You just get a
store instance and use it.  If you want to do session like work then you
are going to need wrappers and some group functionality.  I'm working on
the same stuff today in JCS.  I'm trying to clean up the distributed
sessions. 

Oh, if you come up with a good memory store, I'd like to talk about the
API.  I made the memory manager pluggable in JCS.  The memory manager
needs to be able to call an overflow method on the cache hub though.  It
should at least call some sort of overflow() method in itself when it
needs to clean up the list, so an extended class could implement it. 

Cheers,

Aaron




--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message