Details
Description
Upon session expiry the WindowScopeManager can check the session for existence of window scoped beans and scan for the @PostConstruct and @PreDestroy annotations and invoke the appropriate methods if present.
Issue Links
- depends on
-
ICE-7055 Window scoped beans get reactivated after disposal
- Closed
Activity
Jack Van Ooststroom
created issue -
Ken Fyten
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [] | |
Fix Version/s | 2.1 [ 10241 ] | |
Affects | [Documentation (User Guide, Ref. Guide, etc.)] | |
Assignee Priority | P3 | |
Assignee | Jack van Ooststroom [ jack.van.ooststroom ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Assignee Priority | P3 | P2 |
Jack Van Ooststroom
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #25012 | Tue Jul 12 13:24:22 MDT 2011 | jack.van.ooststroom | Partial Fix for JIRA |
Files Changed | ||||
MODIFY
/icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/SessionExpiredListener.java
MODIFY /icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java |
Jack Van Ooststroom
made changes -
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #25054 | Tue Jul 19 12:01:45 MDT 2011 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/SessionExpiredListener.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #25059 | Thu Jul 21 07:53:08 MDT 2011 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
|
Jack Van Ooststroom
made changes -
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #25062 | Thu Jul 21 12:16:32 MDT 2011 | jack.van.ooststroom | Fixed JIRA |
Files Changed | ||||
MODIFY
/icefaces2/trunk/icefaces/core/src/main/java/org/icefaces/impl/application/WindowScopeManager.java
|
Ken Fyten
made changes -
Fix Version/s | 2.1-Beta [ 10291 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
The @PostConstruct and @PreDestroy annotation support on CustomScoped beans already seemed to be partially supported. Though I haven't looked into the JSF source code, I suspect the following two calls in WindowScopeManager to help out with the current support of this:
These calls and the locations in the code where these calls are made seem to explain the 2 working scenarios:
The one missing case seem to be the invocation of @PreDestroy upon session expiry for all remaining window scoped beans in the session. However, upon session expiry you're not guaranteed to have a FacesContext. Therefore the similar mechanism cannot be used. Instead, the SessionExpiredListener now invokes the newly created WindowScopeManager.disposeWindows(HttpSession) upon session expiry:
public void sessionDestroyed(HttpSessionEvent httpSessionEvent)
{ ... HttpSession session = httpSessionEvent.getSession(); WindowScopeManager.disposeWindows(session); ... }public static void disposeWindows(final HttpSession session) {
{ callPreDestroy(windowScopedBean); }State state = (State)session.getAttribute(WindowScopeManager.class.getName());
Collection<ScopeMap> scopeMaps = state.windowScopedMaps.values();
for (final ScopeMap scopeMap : scopeMaps) {
Collection<Object> windowScopedBeans = scopeMap.values();
for (final Object windowScopedBean : windowScopedBeans)
}
}
However, currently the @PreDestroy on an abandoned window scoped bean gets invoked twice:
ICE-7055