geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Session API, was: heads up: initial contribution of a client API to session state management for OpenEJB, ServiceMix, Lingo and Tuscany
Date Tue, 07 Mar 2006 17:36:34 GMT
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


Mime
View raw message