public class IlvGanttSessionAttribute extends IlvComponentSessionAttribute
IlvGanttSessionAttribute class acts as a proxy for an
IlvHierarchyChart bound to an HttpSession. When you bind
a Gantt or Schedule chart as an attribute of an HttpSession,
proper cleanup of the chart must occur when the session is invalidated or
expires. This allows the chart to be garbage-collected or restored to a pool
of available charts, depending on your choice of strategies. Instead of
binding the chart directly to the session, use an instance of this class as
a proxy:
When all the sessions that the proxy and its component are associated with expire, theIlvHierarchyChart chart = null; HttpSession session = request.getSession(); if (session.isNew()) { chart = ... create new chart or fetch from pool ... IlvGanttSessionAttribute proxy = new IlvGanttSessionAttribute(chart); session.setAttribute(CHART_KEY, proxy); } else { IlvGanttSessionAttribute proxy = (IlvGanttSessionAttribute)session.getAttribute(CHART_KEY); if (proxy != null) chart = proxy.getChart(); } if (chart == null) throw new ServletException("session problem");
componentUnbound() method of the proxy will be invoked.
You can override this method to customize your strategy for handling charts
that are no longer associated with any sessions.| Constructor and Description |
|---|
IlvGanttSessionAttribute(IlvHierarchyChart chart)
Creates an
IlvGanttSessionAttribute proxy for the
specified chart. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
componentUnbound()
This method is automatically invoked when the proxy is unbound from its
last HTTP session.
|
IlvHierarchyChart |
getChart()
Returns the proxy's chart.
|
getComponent, valueBound, valueUnboundpublic IlvGanttSessionAttribute(IlvHierarchyChart chart)
IlvGanttSessionAttribute proxy for the
specified chart.chart - The chart.public IlvHierarchyChart getChart()
protected void componentUnbound()
Window it may have
been added to, such as through
IlvJHiddenPrintWindowFactory.createHiddenPrintWindow(),
disposes the window, and unbinds the chart from its data model.componentUnbound in class IlvComponentSessionAttribute© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.