jrun.servlet.session
Interface SessionStorage

All Known Implementing Classes:
FileSessionStorage, JDBCSessionStorage

public interface SessionStorage

Implemented by session storage providers that wish to store and retrieve session objects and their data.

For a full example of how this interface can be implemented to provide a custom storage mechanism, see jrun.servlet.session.FileSessionStorage.

Author:
Karl Moss
See Also:
FileSessionStorage

Method Summary
 void destroy()
          Destroy the service.
 void init(java.util.Properties initConfigs)
          Initialize the storage service
 void purge()
          Gives the storage provider an opportunity to perform housekeeping.
 void remove(java.lang.String id)
          Removes the session data for the given session ID
 java.io.InputStream retrieve(java.lang.String id)
          Retrieves the session data for the given session ID.
 void store(java.lang.String id, java.io.InputStream in, int len)
          Stores the given session data.
 

Method Detail

init

public void init(java.util.Properties initConfigs)
          throws java.lang.Exception
Initialize the storage service
Parameters:
initConfigs - A List containing the InitConfigMetaData objects for persistence configuration

destroy

public void destroy()
Destroy the service. This is called whenever the webapp is destroyed

store

public void store(java.lang.String id,
                  java.io.InputStream in,
                  int len)
           throws java.lang.Exception
Stores the given session data. Note that the input stream will be closed by the caller.
Parameters:
id - The session ID
in - InputStream containing the session data
len - The length of the session data

retrieve

public java.io.InputStream retrieve(java.lang.String id)
                             throws java.lang.Exception
Retrieves the session data for the given session ID. Note that the input stream will be closed by the caller
Parameters:
id - The session ID
Returns:
The InputStream used to read the session data

remove

public void remove(java.lang.String id)
            throws java.lang.Exception
Removes the session data for the given session ID
Parameters:
id - The session ID

purge

public void purge()
           throws java.lang.Exception
Gives the storage provider an opportunity to perform housekeeping. This is called during server startup after sessions have been restored.


Copyright � 2002 Macromedia Corporation. All Rights Reserved.