org.dbforms.event.datalist.dao
Class DataSourceSessionList

java.lang.Object
  extended by org.dbforms.event.datalist.dao.DataSourceSessionList
All Implemented Interfaces:
EventListener, HttpSessionBindingListener

public class DataSourceSessionList
extends Object
implements HttpSessionBindingListener

Holds a list of DataSourceFactory object in the session context. Needed by the navigation events to store the datasource by a per session mode. So it is possible to reuse the data between different calls and it's not neccessary to refetch again.

Author:
hkk

Method Summary
 DataSourceFactory get(Table table, HttpServletRequest request)
          Get a DataSourceFactory object.
static DataSourceSessionList getInstance(HttpServletRequest request)
          Returns an unique instance of this class for each session
 void put(Table table, HttpServletRequest request, DataSourceFactory ds)
          Adds a DataSourceFactory object to the list.
 DataSourceFactory remove(Table table, HttpServletRequest request)
          Remove a DataSource object from the list.
 void valueBound(HttpSessionBindingEvent event)
          Receive notification that this session will be passivated.
 void valueUnbound(HttpSessionBindingEvent event)
          Receive notification that this session was activated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DataSourceSessionList getInstance(HttpServletRequest request)
Returns an unique instance of this class for each session

Parameters:
request - the request object
Returns:
DOCUMENT ME!

get

public DataSourceFactory get(Table table,
                             HttpServletRequest request)
Get a DataSourceFactory object.

Parameters:
table - the table object
request - the request object
Returns:
the DataSourceFactory object related to the input table

put

public void put(Table table,
                HttpServletRequest request,
                DataSourceFactory ds)
         throws SQLException
Adds a DataSourceFactory object to the list. If object exists in the Hashtable close first!

Parameters:
table - the table object
request - the request object
ds - the DataSourceFactory object to store into the list
Throws:
SQLException - DOCUMENT ME!

remove

public DataSourceFactory remove(Table table,
                                HttpServletRequest request)
Remove a DataSource object from the list.

Parameters:
table - the table object
request - the request object
Returns:
the DataSource object related to the input table. Note that the returned DataSource object has just been closed by this method.

valueBound

public void valueBound(HttpSessionBindingEvent event)
Receive notification that this session will be passivated.

Specified by:
valueBound in interface HttpSessionBindingListener
Parameters:
event - The session event that has occurred

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Receive notification that this session was activated.

Specified by:
valueUnbound in interface HttpSessionBindingListener
Parameters:
event - The session event that has occurred


Copyright © 2002-2006 DbForms. All Rights Reserved.