[jboss-cvs] jboss-seam/src/main/org/jboss/seam/exceptions ...
Gavin King
gavin.king at jboss.com
Mon Jun 25 17:16:29 EDT 2007
User: gavin
Date: 07/06/25 17:16:29
Modified: src/main/org/jboss/seam/exceptions Exceptions.java
Log:
jbseam-1550
Revision Changes Path
1.5 +16 -9 jboss-seam/src/main/org/jboss/seam/exceptions/Exceptions.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Exceptions.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/exceptions/Exceptions.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- Exceptions.java 21 Jun 2007 04:07:15 -0000 1.4
+++ Exceptions.java 25 Jun 2007 21:16:29 -0000 1.5
@@ -91,23 +91,29 @@
deferredHandlers.add(parse("/WEB-INF/exceptions.xml")); // deprecated
- for (String pageFile: Pages.instance().getResources()) {
+ for (String pageFile: Pages.instance().getResources())
+ {
deferredHandlers.add(parse(pageFile));
}
addHandler(new AnnotationRedirectHandler());
addHandler(new AnnotationErrorHandler());
- if (Init.instance().isDebug()) {
+ if (Init.instance().isDebug())
+ {
addHandler(new DebugPageHandler());
}
- for (ExceptionHandler handler: deferredHandlers) {
+ for (ExceptionHandler handler: deferredHandlers)
+ {
addHandler(handler);
}
}
-
+ private void addHandler(ExceptionHandler handler)
+ {
+ if (handler!=null) exceptionHandlers.add(handler);
+ }
private ExceptionHandler parse(String fileName) throws DocumentException, ClassNotFoundException
{
@@ -165,11 +171,13 @@
return null;
}
- public void addHandler(ExceptionHandler handler)
+ /**
+ * @return the exception handler list, which supports addition and removal
+ * of handlers
+ */
+ public List<ExceptionHandler> getHandlers()
{
- if (handler != null) {
- exceptionHandlers.add(handler);
- }
+ return exceptionHandlers;
}
public static Exceptions instance()
@@ -181,5 +189,4 @@
return (Exceptions) Component.getInstance(Exceptions.class, ScopeType.APPLICATION);
}
-
}
More information about the jboss-cvs-commits
mailing list