OPENJPA-117: provide registered TransactionListeners as unmodifiable collection

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@835280 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2009-11-12 07:35:26 +00:00
parent 70fc46f93e
commit befbc83945
3 changed files with 19 additions and 0 deletions

View File

@ -261,6 +261,13 @@ public interface Broker
* @since 0.2.5
*/
public void removeTransactionListener(Object listener);
/**
* Gets an umodifiable collection of currently registered lsteners.
*
* @since 2.0.0
*/
public Collection<Object> getTransactionListeners();
/**
* The callback mode for handling exceptions from transaction event

View File

@ -808,6 +808,10 @@ public class BrokerImpl
endOperation();
}
}
public Collection<Object> getTransactionListeners() {
return _transEventManager.getListeners();
}
public int getTransactionListenerCallbackMode() {
return _transCallbackMode;

View File

@ -825,6 +825,14 @@ public class DelegatingBroker
throw translate(re);
}
}
public Collection<Object> getTransactionListeners() {
try {
return _broker.getTransactionListeners();
} catch (RuntimeException re) {
throw translate(re);
}
}
public int getTransactionListenerCallbackMode() {
try {