ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | enhydra List | July 2005 Index

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

Re: [enhydra] Session Data Destruction Event


Hi,

'SessionHome' and 'SessionUserTable' go in pair. Therefore, if you are using custom 'SessionHome' implementation you are obligate to use custom 'SessionUserTable' implementation.

SessionUserTable is table used by 'StandardSessionManager' to cross reference User objects and sessions. 'BasicSessionUserTable' implementation does not hold references to the user and session objects. Instead it only cross-references the session keys and user names. An underlying assumption is that the user name can be used as a unique reference to the user.

Therefore, 'BasicSessionUserTable' implementation doesn't do anything special itself. CustomSessionUserTable could extend it. Just include some additional implementation if its needed!

If nothing else is needed, you can even use
'com.lutris.appserver.server.sessionEnhydra.BasicSessionUserTable'
as 'SessionUserTable' Class parameter setting.

Just note that 'SessionHome' AND 'SessionUserTable' Class settings are obligate when 'SessionHome.Mode' is set to CUSTOM!

Hope this clears things up!

Regards,
 Slobodan Vujasinovic
Enhydra Development Team



cristiano cunha wrote:

Hi, Its working!!
It was my mistake(in web.xml a bad class reference), just a last request, is
it necessary to rewrite CustomSessionUserTable? Or did it work without it?
I'm asking because our implementation of CustomSessionUserTable does'nt do
anything.

Thanks for your help.

Cristiano.

-----Original Message-----
From: cristiano cunha [mailto:ccunha@xxxxxxxxxxxx] Sent: quarta-feira, 20 de Julho de 2005 12:09
To: enhydra@xxxxxxxxxxxxx
Subject: RE: [enhydra] Session Data Destruction Event

Hi, Thanks for your quick answer, but we tried to put our implementation in the
shared/lib, and in fact the error do not occur but my implementation are not
called. Is there anything that I'm forgetting about?

Thanks for your help.

Cristiano.

-----Original Message-----
From: Slobodan Vujasinovic [mailto:slobodan@xxxxxxxxxxxxx] Sent: quarta-feira, 20 de Julho de 2005 11:11
To: enhydra@xxxxxxxxxxxxx
Subject: Re: [enhydra] Session Data Destruction Event

Hi Cristiano,

problem probably is EAF-APP binary deployment issue!

EAF binaries (including StandardSessionManager implementation) are placed in '<enhydra_root>/multiserver/shared/lib' directory and they are loaded by 'Shared Class Loader'. Your application binaries are placed in application context 'lib' ('WEB-INF/lib') directory and are loaded by 'Webapp Class Loader'. 'Shared Class Loader' is parent loader of 'Webapp Class Loader' and classes loaded by him ('Shared Class Loader') are not able to 'see' classes loaded by 'Webapp Class Loader'.

Your custom (SessionHome and SessionUserTable) implementation is initialized by 'StandardSessionManager'. The reason of 'java.lang.reflect.InvocationTargetException' probably is in fact that 'StandardSessionManager' implementation (loaded by 'Shared Class Loader') is not able to see your custom (SessionHome and SessionUserTable) implementation (probably loaded by 'Webapp Class Loader').

Solution would be to load your custom (SessionHome and SessionUserTable) implementation trough 'Shared Class Loader' (e.g. place this binary in '<enhydra_root>/multiserver/shared/lib' directory).

I'm waiting your response regarding this issue!

Regards,
 Slobodan Vujasinovic
Enhydra Development Team



cristiano cunha wrote:

Hi,
This way of rewriting session manager work fine in enhydra5.X, but we are
facing a problem when using enhydra6.4:
caused by class com.lutris.appserver.server.ApplicationException:
java.lang.reflect.InvocationTargetException:
java.lang.reflect.InvocationTargetException

We try your solution but this exception occur, any ideia ?
Our web.xml configuration file:
<env-entry>
  <env-entry-name>SessionManager/Class</env-entry-name>

<env-entry-value>com.lutris.appserver.server.sessionEnhydra.StandardSession
M
anager</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/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/SessionUserTable/Class</env-entry-name>
  <env-entry-value>CustomSessionUserTable</env-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

Thanks for your help.

Cristiano.

-----Original Message-----
From: Ricardo Tedim [mailto:rjtedim@xxxxxxxxxxxx] Sent: sexta-feira, 6 de Maio de 2005 18:20
To: enhydra@xxxxxxxxxxxxx
Subject: Re: [enhydra] Session Data Destruction Event

Seems to be what I was looking for. I'll give it a try and get back to you.

Thanks for your help.

Ricardo


Slobodan Vujasinovic wrote:



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







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


--
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.