users@glassfish.java.net

Re: How to transport applicative data across method calls like a context

From: <glassfish_at_javadesktop.org>
Date: Wed, 25 Jul 2007 06:56:49 PDT

In fact i would like to have the same behaviour as a statefull session bean but for a stateless one. Yes it is strange but i am not sure that the standalone client application calls the remove method of the bean.

I do not have a conversationnal state or any kind of session communication but i would like to transport transparently some transversal data in a kind of invocation context when the client invokes a method and for all its subordinates methods.

For example, when the security is activated in the application server it is possible for all methods to known which is the principal name that calls the method (SessionContext.getCallerPrincipal()). This principal is not defined in any bean and does not appears in methods signature but it is accessible by all methods of all beans through the session context. This is that i would like to do in order to memorize transparently some information and be sure that this data is not visible in the api but could be reached everywhere in the code.

So for that, stateful session bean does not match my requirement.

Do you have an other solution?

Franck.
[Message sent by forum member 'franck_mosse' (franck_mosse)]

http://forums.java.net/jive/thread.jspa?messageID=228156