You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2008/12/04 03:26:35 UTC

svn commit: r723191 - in /myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context: ExceptionHandler.java ExceptionHandlerFactory.java ExceptionHandlerWrapper.java

Author: lu4242
Date: Wed Dec  3 18:26:34 2008
New Revision: 723191

URL: http://svn.apache.org/viewvc?rev=723191&view=rev
Log:
MYFACES-2088 Add ExceptionHandler class

Added:
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java   (with props)
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java   (with props)
    myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java   (with props)

Added: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java?rev=723191&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java (added)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java Wed Dec  3 18:26:34 2008
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.context;
+
+import javax.faces.FacesException;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ExceptionEvent;
+import javax.faces.event.SystemEvent;
+import javax.faces.event.SystemEventListener;
+
+/**
+*
+* @since 2.0
+* @author Leonardo Uribe (latest modification by $Author$)
+* @version $Revision$ $Date$
+*/
+public abstract class ExceptionHandler implements SystemEventListener
+{
+
+    public ExceptionHandler()
+    {
+
+    }
+
+    public abstract void handle() throws FacesException;
+    
+    public abstract ExceptionEvent getHandledExceptionEvent();
+    
+    public abstract Iterable<ExceptionEvent> getUnhandledExceptionEvents();
+    
+    public abstract Iterable<ExceptionEvent> getHandledExceptionEvents();
+    
+    public abstract void processEvent(SystemEvent exceptionEvent)
+    throws AbortProcessingException;
+    
+    public abstract boolean isListenerForSource(Object source);
+    
+    public abstract Throwable getRootCause(Throwable t);
+}

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java?rev=723191&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java (added)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java Wed Dec  3 18:26:34 2008
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.context;
+
+import javax.faces.FacesWrapper;
+
+/**
+ *
+ * @since 2.0
+ * @author Leonardo Uribe (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class ExceptionHandlerFactory implements
+        FacesWrapper<ExceptionHandlerFactory>
+{
+
+    public abstract ExceptionHandler getExceptionHandler();
+
+    /**
+     * If this factory has been decorated, the implementation doing the decorating may override this method to 
+     * provide access to the implementation being wrapped. A default implementation is provided that returns 
+     * <code>null</code>.
+     * 
+     * @return the decorated <code>DiscoveryHandlerFactory</code> if this factory decorates another, 
+     *         or <code>null</code> otherwise
+     * 
+     * @since 2.0
+     */
+    public ExceptionHandlerFactory getWrapped()
+    {
+        return null;
+    }
+
+}

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java?rev=723191&view=auto
==============================================================================
--- myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java (added)
+++ myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java Wed Dec  3 18:26:34 2008
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package javax.faces.context;
+
+import javax.faces.FacesException;
+import javax.faces.FacesWrapper;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ExceptionEvent;
+import javax.faces.event.SystemEvent;
+
+/**
+*
+* @since 2.0
+* @author Leonardo Uribe (latest modification by $Author$)
+* @version $Revision$ $Date$
+*/
+public abstract class ExceptionHandlerWrapper extends ExceptionHandler
+        implements FacesWrapper<ExceptionHandler>
+{
+
+    public ExceptionEvent getHandledExceptionEvent()
+    {
+        return getWrapped().getHandledExceptionEvent();
+    }
+
+
+    public Iterable<ExceptionEvent> getHandledExceptionEvents()
+    {
+        return getWrapped().getHandledExceptionEvents();
+    }
+
+
+    public Throwable getRootCause(Throwable t)
+    {
+        return getWrapped().getRootCause(t);
+    }
+
+
+    public Iterable<ExceptionEvent> getUnhandledExceptionEvents()
+    {
+        return getWrapped().getUnhandledExceptionEvents();
+    }
+
+
+    public void handle() throws FacesException
+    {
+        getWrapped().handle();
+    }
+
+
+    public boolean isListenerForSource(Object source)
+    {
+        return getWrapped().isListenerForSource(source);
+    }
+
+
+    public void processEvent(SystemEvent exceptionEvent)
+            throws AbortProcessingException
+    {
+        getWrapped().processEvent(exceptionEvent);
+    }
+
+    public abstract ExceptionHandler getWrapped();
+}

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/core/branches/2_0_0/api/src/main/java/javax/faces/context/ExceptionHandlerWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL