geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Blevins <>
Subject Re: Summary?
Date Tue, 14 Mar 2006 02:54:59 GMT

On Mar 9, 2006, at 5:59 AM, Jules Gosnell wrote:

> David Blevins wrote:
>> Sorry, was referring to this thread.  Seems like it's winding  
>> down  and just looking for a clear idea of what the current  
>> thinking is.
> David,
> since you are here - a few SFSB questions...
> what provisions does the EJB spec make for timing out of SFSBs, if  
> any ? what metadata does this require associated with each session ?

What I can recal is that you can't passivate a stateful bean in mid- 
transaction.  You must activate a stateful bean if a client attempts  
to invoke it and the instance has not yet been timed out.  And unlike  
Entities, Stateful session bean data isn't required to survive a  
server crash or restart.

> what provisions/requirements over and above these does OpenEJB make/ 
> have ?
> Aside from lifecycle management, retrieval and timing out, what  
> other requirements might OpenEJB have for SFSB management ?

Nothing I can think of.  Maybe you are looking for something very  

> I seem to remember that SFSBs need notification on activation/ 
> passivation ? is this correct ? are any other notifications required ?

A notification before a passivation (ejbPassivate()/@PrePassivate)  
and another after activation (ejbActivate()/@PostActivate).

> Is it possible for one client to pass the handle of an SFSB to  
> another ? Does the spec touch on this ? Does it ever happen ?

I know that per spec, the client identity cannot change mid- 
transaction.  Aside from that we allow it.

> Are Local SFSBs to be considered Serialisable/Passivatable/ 
> Migratable or not ?

I think you may be thinking that a client using a Local vs Remote  
interface to access a stateful bean has a different impact on the  
stateful bean's lifecycle.  The lifecycle is the same regardless of  
how a client accesses it.  In other words, there is no such thing as  
a local or remote bean, just local or remote reference to beans.

> and finally :
> Would it be simple to change OpenEJB to use an SFSB handle that  
> included an ID to a 'SuperSession' (Object containing all Session  
> objects pertaining to a single client for a given Server) along  
> with an ID to particular 'SubSession' (The SFSB itself) within this  
> 'SuperSession', instead of whatever scheme you currently use ?

That wouldn't be simple as we don't have any concept of provisioning  
client ids aside from the optional security identity associated with  
incoming calls.  In general the spec isn't really strict on the  
server's view of a client, it's more focused on a client's view of a  
bean (e.g. server).  That is to say, beans have strict and spelled  
out identity rules whereas client's do not.

We could invent a universal client id concept but it would be a fair  
amount of work to reconcile that concept across the various ways  
people can invoke stateful beans; IIOP+IDL, IIOP+Remote interface,  
Custom protocol + Remote interface, Local interface.  Using just  
Local interfaces, is the client id:
  - The id of the servlet or ejb
  - The id of the war or ejb-jar
  - The id of the ear (if there is one)
  - The id of the VM

Remote interfaces really get you in trouble as they have the same  
questions, plus they can be invoked by j2ee app clients as well as  
non-j2ee java clients, or even non-java clients via IDL/IIOP.

I guess I'm not sure at what level you are thinking when you say the  
word "client" or what you'd be looking to get out of the concept.   
That'd probably be the most productive way to look at the concept --  
otherwise it becomes one of those existentialist "what is a  
component" type of things.

> looking forward to some interesting answers...

Hope they help!


> Jules
>> -David
>> On Mar 7, 2006, at 9:36 AM, Dain Sundstrom wrote:
>>> Looks good.
>>> -dain
>>> On Mar 6, 2006, at 12:49 AM, Greg Wilkins wrote:
>>>> Dain Sundstrom wrote:
>>>>> My guess is we're going to need to add an event notification   
>>>>> system  to
>>>>> the Session APIs.  What do you think about just crib off of  
>>>>> the   servlet
>>>>> ones.  I think we could just smash the three session listener
>>>>> interfaces into something like this:
>>>>> public interface SessionListener extends Listener {
>>>>>     void valueBound(SessionEvent event);
>>>>>     void valueUnbound(SessionEvent event);
>>>>>     void attributeAdded(SessionEvent event);
>>>>>     void attributeRemoved(SessionEvent event);
>>>>>     void attributeRemoved(SessionEvent event);
>>>> I think you mean:
>>>>  void attributeReplaced(SessionEvent event);
>>>>>     void valueBound(SessionEvent event);
>>>>>     void valueUnbound(SessionEvent event);
>>>>>     void sessionCreated(SessionEvent event)
>>>>>     void sessionDestroyed(SessionEvent event)
>>>>> }
>>>>> public class SessionEvent extends Event {
>>>>>     Session getSession();
>>>>>     String getName();
>>>>>     String getValue();
>>>>> }
>>>>> We would bind a listener with a method on the Locator:
>>>>>     void addSessionListener(SessionListener listener);
>>>>>     void removeSessionListener(SessionListener listener);
>>>> that would certainly do it - the only change I'd like to see
>>>> is that the SessionEvent is
>>>>  public class SessionEvent extends Event {
>>>>      Session getSession();
>>>>      String getName();
>>>>      String getOldValue();
>>>>      String getNewValue();
>>>>  }
>>>> As it is confusing for remove and replace what getValue() returns.
>>>> Also as the bound/unbound events are actually called on the
>>>> value itself, you need both old and new values so you can call
>>>> unbind and bind during a replace.
>>>> cheers
> -- 
> "Open Source is a self-assembling organism. You dangle a piece of
> string into a super-saturated solution and a whole operating-system
> crystallises out around it."
> /**********************************
> * Jules Gosnell
> * Partner
> * Core Developers Network (Europe)
> *
> *
> *
> * Open Source Training & Support.
> **********************************/

View raw message