[ 
https://issues.apache.org/jira/browse/OPENJPA-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470294
 ] 

Craig Russell commented on OPENJPA-117:
---------------------------------------

Maybe this case would best be handled by having the TransactionListener itself 
register for the event.

I'm assuming that the listener is stateful and is listening on a specific 
Broker. Then add a method on the TransactionListenerImpl like void 
listenOn(Broker broker). If it is already listening on the parameter, it 
returns. Otherwise it registers itself. This can be exended if a listener can 
listen on multiple Brokers. In that case, the listener can manage a Set of 
Brokers that it is listening on.

I'm not so concerned about different users of a Broker getting information 
about other users. As Abe points out, all the actors who share a Broker are 
already intimately connected, and any one can cause damage. So it's not about 
isolation, it's more about separation of concerns. In this case, why should an 
actor care if a listener is already listening? The listener can be active 
making sure it's not registered multiple times with the same Broker.

> Collection of TransactionListeners registered to a Broker should be available 
> as unmodifiable collection
> --------------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-117
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-117
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: kernel
>            Reporter: Pinaki Poddar
>         Assigned To: Pinaki Poddar
>            Priority: Minor
>
> Currently TransactionListeners can be added/removed to a broker but the list 
> of transaction listeners registered to a particular broker is not available. 
> Such a collection can be made available in read-only mode so a caller can 
> determine whether to add a new listener or not, or whether a particular 
> listener is already registered. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to