com.marringtons.util
Class Session.Key

java.lang.Object
  extended bycom.marringtons.util.Session.Key
Enclosing class:
Session

public abstract static class Session.Key
extends Object

Key is returned by Session factory methods to create a private static key to keep in calling classes to provide class, package or global scope session data. It is advisable to cache it as a static value of the calling class since xxx.class is (surprisingly) a non-trivial library operation using Class.forName (at least using the Sun 1.4 JVM).

 public class Panel extends Page
   {
     protected void setup()
       {
          ...
          HashMap portals =
            (HashMap) request.session.get( panelCacheKey);
          ...
        }
      private static final Session.Key panelCacheKey =
        Session.classScope( Panel.class, "data", HashMap.class, true);
   }
 


Field Summary
 String key
          key used to retrieve this item
 Class valueClass
          Class for the item - used to create when needed
 
Constructor Summary
Session.Key()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public String key
key used to retrieve this item


valueClass

public Class valueClass
Class for the item - used to create when needed

Constructor Detail

Session.Key

public Session.Key()


Copyright © 2005 Paul Marrington http://library.marringtons.com