[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] HttpService, Jetty, Session timeout

Simon,

I don't quite understand the solution that you have in mind.  We set the timeout value on a per-Servlet basis (using the reflection code that Ben posted).  Does your solution support this, or is it an HttpService-global setting?

-Jeremy

On 2/12/07, Simon Kaegi <simon.kaegi@xxxxxxxxx> wrote:
Hi Frank and Ben,

Please create an enhancement request in bugzilla.
This could be added to the ServletHandler when the Jetty Server instance is
being created very easily.

-Simon

----- Original Message -----
From: "Benjamin Schmaus" <benjamin.schmaus@xxxxxxxxx>
To: "Equinox development mailing list" <equinox-dev@xxxxxxxxxxx >
Sent: Monday, February 12, 2007 1:32 PM
Subject: Re: [equinox-dev] HttpService, Jetty, Session timeout


> Hi Frank -
>
> I've run into this issue before.  Since the OSGi HTTP service doesn't
> support the use of a web.xml file (to the best of my knowledge
> anyway), session timeouts can't be set in the standard way.
>
> What I've done to work around this is to use reflection to invoke a
> Jetty-specific method for setting session timeouts.
>
> For example:
>
>    public void setSessionTimeout(HttpServlet servlet, int timeoutSeconds)
> {
>        ServletContext sc = servlet.getServletContext();
>
>        Object handler = reflector.invokeMethod(sc,
> "getServletHandler", null, null);
>        reflector.invokeMethod(
>                handler,
>                "setSessionInactiveInterval",
>                new Class[]{Integer.TYPE},
>                new Object[]{new Integer(timeoutSeconds)}
>        );
>    }
>
> (The 'reflector' object uses the java.lang.reflect API under the hood.)
>
> AOP might be another approach to setting session timeout under Jetty
> that's worth investigating.
>
> HTH
>
> - Ben
>
> On 2/12/07, Frank Appel < fappel@xxxxxxxxxxxxxx> wrote:
>>
>> Hi,
>>
>> I've been looking a while for a possibility to set the session timeout of
>> the HttpService using Jetty as the underlying engine. Is there a simple
>> system property like org.osgi.service.http.port which is used to set the
>> port and if so, where can I find documentation about the available
>> properties?
>>
>> Thanks
>> Frank Appel
>> _______________________________________________
>> equinox-dev mailing list
>> equinox-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/equinox-dev
>>
>>
> _______________________________________________
> equinox-dev mailing list
> equinox-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/equinox-dev

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev