Amit Mondal created FELIX-6080:
----------------------------------
Summary: HttpSessionListeners ain't getting triggered
Key: FELIX-6080
URL: https://issues.apache.org/jira/browse/FELIX-6080
Project: Felix
Issue Type: Bug
Components: HTTP Service
Affects Versions: http.jetty-4.0.8, http.jetty-4.0.6
Reporter: Amit Mondal
I am currently struggling with HTTP Whiteboard Session Listener. The custom
_HttpSessionListener_ callbacks are never getting triggered when
_HttpRequest#getSession()_ is invoked in servlets.
As an example,
{code:java}
@Component
@HttpWhiteboardListener
public final class ApplicationSession implements HttpSessionListener {
private final AtomicInteger activeSessions = new AtomicInteger();
@Override
public void sessionCreated(final HttpSessionEvent sessionEvent) {
activeSessions.incrementAndGet();
}
@Override
public void sessionDestroyed(final HttpSessionEvent sessionEvent) {
activeSessions.decrementAndGet();
}
public boolean isSessionValid() {
return activeSessions.get() != 0;
}
}
{code}
This is the custom listener I registered with the HTTP Whiteboard and it never
gets invoked when I call _HttpRequest#getSession()_.
GitHub Repo replicating the problem:
[https://github.com/amitjoy/whiteboard-httplistener-problem]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)