You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by "Butash, Bob" <bo...@eds.com> on 2006/10/02 21:26:50 UTC
How to turn of Shale ExeptionHandling?
Hello,
I'm trying to turn off the Shale Exception handling capabilities. I
have commented out the use of the ViewActionListener but now I notice
that the LifecycleListener is also trying to leverage a Shale Exception
handler.
protected void fireSessionInit(Object bean) {
try {
if (bean instanceof AbstractSessionBean) {
((AbstractSessionBean) bean).init();
}
} catch (Exception e) {
handleException(FacesContext.getCurrentInstance(), e);
}
}
The documentation states that I can look to an ExceptionHandlerFactory,
but that class does not exist.
/**
* <p>Interface describing a "strategy pattern" implementation for
* handling exceptions thrown by an application event callback that
* is managed by Shale. A suitable instance may be acquired by calling
*
<code>ExceptionHandlerFactory.getInstance().getExceptionHandler()</code>
.</p>
*
* @since 1.0.3
*
* $Id: ExceptionHandler.java 428077 2006-08-02 18:17:11Z craigmcc $
*/
public interface ExceptionHandler
I want to leverage Shale's ViewControllerCapabilities, but I do not want
to leverage the Shale exception handling mechanism as it is incomplete.
I have a means to capture exceptions at a higher level, however they are
being eaten by Shale.
Any assistance would be greatly appreciated.
Thanks,
Bob Butash
Re: How to turn of Shale ExeptionHandling?
Posted by Wendy Smoak <ws...@gmail.com>.
On 10/2/06, Craig McClanahan <cr...@apache.org> wrote:
> The exception handler is locked together with the view controller
> functionality for two reasons:
...
I added Craig's answer to the wiki:
http://wiki.apache.org/shale/ExceptionHandling
--
Wendy
Re: How to turn of Shale ExeptionHandling?
Posted by Craig McClanahan <cr...@apache.org>.
On 10/2/06, Butash, Bob <bo...@eds.com> wrote:
>
> Hello,
>
> I'm trying to turn off the Shale Exception handling capabilities. I
> have commented out the use of the ViewActionListener but now I notice
> that the LifecycleListener is also trying to leverage a Shale Exception
> handler.
>
> protected void fireSessionInit(Object bean) {
>
> try {
> if (bean instanceof AbstractSessionBean) {
> ((AbstractSessionBean) bean).init();
> }
> } catch (Exception e) {
> handleException(FacesContext.getCurrentInstance(), e);
> }
>
> }
>
> The documentation states that I can look to an ExceptionHandlerFactory,
> but that class does not exist.
>
> /**
> * <p>Interface describing a "strategy pattern" implementation for
> * handling exceptions thrown by an application event callback that
> * is managed by Shale. A suitable instance may be acquired by calling
> *
> <code>ExceptionHandlerFactory.getInstance().getExceptionHandler()</code>
> .</p>
> *
> * @since 1.0.3
> *
> * $Id: ExceptionHandler.java 428077 2006-08-02 18:17:11Z craigmcc $
> */
> public interface ExceptionHandler
>
>
> I want to leverage Shale's ViewControllerCapabilities, but I do not want
> to leverage the Shale exception handling mechanism as it is incomplete.
> I have a means to capture exceptions at a higher level, however they are
> being eaten by Shale.
The exception handler is locked together with the view controller
functionality for two reasons:
* Otherwise, Shale could not fulfill its contract to call destroy()
if init() was ever called, when the application throws an exception.
* Even if Shale weren't doing this, you'll find that the JSF implementations
tend to eat exceptions anyway (for a similar sort of reason --
to guarantee that they can call the afterPhase() listeners if
beforePhase() was called).
Your best bet would be to use the relatively new capability to plug in your
own exception handling strategy to replace the default one. This involves
replacing the application scope bean (implements ExceptionHandler) at key
"org$apache$shale$view$EXCEPTION_HANDLER").
Craig
Craig
Any assistance would be greatly appreciated.
>
> Thanks,
>
> Bob Butash
>
>
>
>
>