ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | enhydra List | May 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [enhydra] Session Data Destruction Event


Hi,

New (custom) 'SessionManager' implementation in Enhydra 5.X mid be a problem
while in Enhydra 6.X you have 'SessionManager.Class' configuration option so
you are able to elegantly integrate custom 'SessionManager' implementation.
But, I think that faster and cleaner way to do this is to generate custom
implementations of "SessionHome" and "SessionUserTable".
This is configurable in both Enhydra 5.X and Enhydra 6.X Server.

Depending on "SessionHome.Mode" that you are using (BASIC by default) you
can extend existing Enhydra (EAF) implementations.
As explanation example I'll use BASIC "SessionHome.Mode" option.

You can create your 'CustomSessionHome' class that extends
'BasicSessionHome' enhydra implementation and override its
'removeSession(String sessionKey)' method.
-------------------------------------------------------
public synchronized void removeSession(String sessionKey)
         throws SessionException {
         /**
          *  Do your thing here
          */
         super.removeSession(sessionKey);
     }
--------------------------------------------------------

Note that 'BasicSessionHome' class has dummy implementation of 'shutdown()'
method (called on application shutdown) so I recommend you to additionally
override (implement) this method.

After that you can create 'CustomSessionUserTable' class that extends
already existing 'BasicSessionUserTable' implementation (class is not public
so you can expect packaging issue here) without any additional
implementation.

At the end, don't forget to change (add) adequate application configuration
properties:

CONF configuration file:
SessionManager.SessionHome.Class = CusomSessionHome


SessionManager.SessionHome.Mode = CUSTOM


SessionManager.SessionUserTable.Class = CustomSessionUserTable


web.xml configuration file:
<env-entry>

      <env-entry-name>SessionManager/SessionHome/Class</env-entry-name>

      <env-entry-value>CustomSessionHome</env-entry-value>

     <env-entry-type>java.lang.String</env-entry-type>

</env-entry>


<env-entry>

     <env-entry-name>SessionManager/SessionHome/Mode</env-entry-name>

    <env-entry-value>CUSTOM</env-entry-value>

    <env-entry-type>java.lang.String</env-entry-type>

</env-entry>


<env-entry>

     <env-entry-name>SessionManager/SessionUserTable/Class</env-entry-name>

     <env-entry-value>CustomSessionUserTable</env-entry-value>

     <env-entry-type>java.lang.String</env-entry-type>

</env-entry>

Hope this helps!

Regards,
     Slobodan Vujasinovic
Enhydra Development Team




----- Original Message -----
From: "Ricardo Tedim" <rjtedim@xxxxxxxxxxxx>
To: <enhydra@xxxxxxxxxxxxx>
Sent: Thursday, May 05, 2005 10:12 PM
Subject: [enhydra] Session Data Destruction Event


> Hi,
>
> I need to intercept the session destruction "event" in order to trigger
> some backend operations. I looked through the mailing list and I haven't
> found any answer on this. Do you how this can be done in Enhydra 5.1 and
> 6.3? Do I have to write a custom session manager for this?
>
> Thanks in advance,
> Ricardo Tedim
>
>
>
>


----------------------------------------------------------------------------
----


>
> --
> You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx
mailing list.
> To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.