[ 
https://issues.apache.org/jira/browse/FELIX-6080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Amit Mondal updated FELIX-6080:
-------------------------------
    Description: 
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()_.

The SCR Component is ACTIVE, that means, it is not ignored but never triggered.

 
 GitHub Repo replicating the problem: 
[https://github.com/amitjoy/whiteboard-httplistener-problem]

  was:
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]


> 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.6, http.jetty-4.0.8
>            Reporter: Amit Mondal
>            Priority: Major
>
> 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()_.
> The SCR Component is ACTIVE, that means, it is not ignored but never 
> triggered.
>  
>  GitHub Repo replicating the problem: 
> [https://github.com/amitjoy/whiteboard-httplistener-problem]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to