You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Leif Mortenson <le...@tanukisoftware.com> on 2002/11/22 06:03:42 UTC

Any history before I patch the ECM?

A user over on avalon-users has pointed out that the ECM as it is currently
implemented makes it impossible to detect whether or not there were any
exceptions thrown in the initialize() method of the container. All
exceptions
are currently caught and logged. But the method always returns.

The configure method on the other hand both logs and rethrows the
exceptions.
I agree with the user that exceptions encountered within initialize
should really be
rethrown as well.

Before making this change, I wanted to make sure that no one was aware
of any
reason why this should not be done.

Exceptions will arise in this method if there are any exceptions thrown
while initializing
any threads-safe components or pooled components which are created at pool
initialization. These can be caused by anything, like a misconfigured
username for a
database connection, to the DB being down. etc...

When things are setup correctly, this should never happen. But this will
make it possible
for applications using the ECM to respond to configuration problems.

Cheers,
Leif

Here is my proposed diff:

cvs diff -u ExcaliburComponentManager.java
Index: ExcaliburComponentManager.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/component/src/java/org/apache/avalon/excalibur/component/ExcaliburComponentManager.java,v
retrieving revision 1.20
diff -u -r1.20 ExcaliburComponentManager.java
--- ExcaliburComponentManager.java 7 Nov 2002 18:26:23 -0000 1.20
+++ ExcaliburComponentManager.java 22 Nov 2002 04:59:55 -0000
@@ -528,6 +528,9 @@
getLogger().error( "Caught an exception trying to initialize "
+ "the component handler.", e );
}
+
+ // Rethrow the exception
+ throw e;
}
}

@@ -562,6 +565,9 @@
{
getLogger().error( "Caught an exception trying to initialize "
+ "the component handler.", e );
+
+ // Rethrow the exception
+ throw e;
}
}
}






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>