You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by rd...@apache.org on 2009/09/05 12:27:20 UTC
svn commit: r811617 -
/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
Author: rdonkin
Date: Sat Sep 5 10:27:19 2009
New Revision: 811617
URL: http://svn.apache.org/viewvc?rev=811617&view=rev
Log:
No need to throw ConfigurationExceptions
Modified:
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
Modified: james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java
URL: http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java?rev=811617&r1=811616&r2=811617&view=diff
==============================================================================
--- james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java (original)
+++ james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPHandlerChain.java Sat Sep 5 10:27:19 2009
@@ -190,59 +190,42 @@
* @throws ConfigurationException Get thrown on error
*/
private void loadClass(ClassLoader classLoader, String className,
- Configuration config) throws ConfigurationException {
- try {
- final Class<?> handlerClass = classLoader.loadClass(className);
- Object handler = loader.load(handlerClass);
-
- // enable logging
- ContainerUtil.enableLogging(handler, getLogger());
-
- // servicing the handler
- ContainerUtil.service(handler, serviceManager);
-
- // configure the handler
- ContainerUtil.configure(handler, config);
-
- // if it is a commands handler add it to the map with key as command
- // name
- if (handler instanceof HandlersPackage) {
- List<String> c = ((HandlersPackage) handler).getHandlers();
-
- for (Iterator<String> i = c.iterator(); i.hasNext(); ) {
- String cName = i.next();
-
- DefaultConfiguration cmdConf = new DefaultConfiguration(
- "handler");
- cmdConf.setAttribute("class", cName);
+ Configuration config) throws Exception {
+ final Class<?> handlerClass = classLoader.loadClass(className);
+ Object handler = loader.load(handlerClass);
- loadClass(classLoader, cName, cmdConf);
- }
+ // enable logging
+ ContainerUtil.enableLogging(handler, getLogger());
- }
+ // servicing the handler
+ ContainerUtil.service(handler, serviceManager);
- if (getLogger().isInfoEnabled()) {
- getLogger().info("Added Handler: " + className);
- }
-
- // fill the big handler table
- handlers.add(handler);
-
- } catch (ClassNotFoundException ex) {
- if (getLogger().isErrorEnabled()) {
- getLogger().error("Failed to add Commandhandler: " + className,
- ex);
- }
- throw new ConfigurationException("Failed to add Commandhandler: "
- + className, ex);
- } catch (ServiceException e) {
- if (getLogger().isErrorEnabled()) {
- getLogger().error(
- "Failed to service Commandhandler: " + className, e);
+ // configure the handler
+ ContainerUtil.configure(handler, config);
+
+ // if it is a commands handler add it to the map with key as command
+ // name
+ if (handler instanceof HandlersPackage) {
+ List<String> c = ((HandlersPackage) handler).getHandlers();
+
+ for (Iterator<String> i = c.iterator(); i.hasNext(); ) {
+ String cName = i.next();
+
+ DefaultConfiguration cmdConf = new DefaultConfiguration(
+ "handler");
+ cmdConf.setAttribute("class", cName);
+
+ loadClass(classLoader, cName, cmdConf);
}
- throw new ConfigurationException("Failed to add Commandhandler: "
- + className, e);
+
}
+
+ if (getLogger().isInfoEnabled()) {
+ getLogger().info("Added Handler: " + className);
+ }
+
+ // fill the big handler table
+ handlers.add(handler);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org