You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ma...@apache.org on 2002/03/20 00:12:12 UTC
cvs commit: jakarta-commons-sandbox/services/src/java/org/apache/commons/services EventModule.java
martinc 02/03/19 15:12:12
Modified: services/src/java/org/apache/commons/services
EventModule.java
Log:
Add try/catch around calls to Pool methods which may now throw exceptions.
This is really a "get it to build" change - the caught exceptions are not
dealt with in any particularly meaningful way.
Revision Changes Path
1.8 +25 -5 jakarta-commons-sandbox/services/src/java/org/apache/commons/services/EventModule.java
Index: EventModule.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/services/src/java/org/apache/commons/services/EventModule.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- EventModule.java 1 Feb 2002 16:32:38 -0000 1.7
+++ EventModule.java 19 Mar 2002 23:12:12 -0000 1.8
@@ -16,7 +16,7 @@
/** Event module. Generate events.
*
- * @version $Id: EventModule.java,v 1.7 2002/02/01 16:32:38 oalexeev Exp $
+ * @version $Id: EventModule.java,v 1.8 2002/03/19 23:12:12 martinc Exp $
* @author Oleg V Alexeev
*/
public class EventModule extends Module {
@@ -28,7 +28,11 @@
protected GenericKeyedObjectPool pool = null;
public void releaseEvent( Event event ) {
- pool.returnObject( event.getEventRegistration().getName(), event );
+ try {
+ pool.returnObject( event.getEventRegistration().getName(), event );
+ } catch (Exception e) {
+ // FIXME: Do something with this
+ }
}
public EventModule() {
@@ -60,7 +64,11 @@
public void destroy() {
eventRegistrations.clear();
pool.clear();
- pool.close();
+ try {
+ pool.close();
+ } catch (Exception e) {
+ // FIXME: Do something with this
+ }
}
public EventRegistration getDefaultEventRegistration() {
@@ -76,11 +84,23 @@
}
public Event getEvent( String name ) {
- return (Event)pool.borrowObject( name );
+ Event event = null;
+ try {
+ event = (Event)pool.borrowObject( name );
+ } catch (Exception e) {
+ // FIXME: Do something with this
+ }
+ return event;
}
public Event getDefaultEvent() {
- return (Event)pool.borrowObject( defaultEventRegistration.getName() );
+ Event event = null;
+ try {
+ event = (Event)pool.borrowObject( defaultEventRegistration.getName() );
+ } catch (Exception e) {
+ // FIXME: Do something with this
+ }
+ return event;
}
public Digester initDigester( Digester digester, String path ) {
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>