[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2884) Provide a sessionFactory close event or hook for the event listeners

Anirudh Vyas (JIRA) noreply at atlassian.com
Wed Feb 6 11:12:55 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2884?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29451 ] 

Anirudh Vyas commented on HHH-2884:
-----------------------------------

Copied this from Documentation on Events comment, as i thought it'd be more appropriate.

Hi,

Hibernate Event System lacks documentation as well as some of the parts ( or i think so, correct me if i go wrong somewhere ).

In the Event System ( for example OnSaveOrUpdateEvent )
It would be appropriate to move all the Event delegation based code to an Event Delegate which has all the listeners registered to it and then use a Broadcast agent to do broadcast ( or Fire an event in Hibernate Terminology ) the events and loop through listeners to check.

something like :

// fire the event
SessionImpl.broadcastSaveEvent( SaveEvent( Phase.SAVE, Source etc etc ) , BaseEventDelegate );

// use a BroadCast interface and implement a DefaultBroadcastAgent and do something like
DefaultBroadcastAgent.processBroadcast( BaseEventDelegate )

// broadcaster above uses event delegate passed to it to loop through listeners.
// same as in SessionImpl.

we could also check if listeners passed to this was an appropriate listener or not.

Let me know in case you need more clarifications.
Regards
Vyas, Anirudh

> Provide a sessionFactory close event or hook for the event listeners
> --------------------------------------------------------------------
>
>                 Key: HHH-2884
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2884
>             Project: Hibernate3
>          Issue Type: New Feature
>          Components: core
>            Reporter: Emmanuel Bernard
>             Fix For: 3.3
>
>
> It can be done either:
>  - as an event/eventListener
>  - as a method that eventlisteners implement (symmetric of initialize())
> The former being more flexible

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list