}
private boolean invokeErrorHandler(ProcessingNode node, Exception ex, Environment env)
throws Exception {
InvokeContext errorContext = null;
try {
// Try to reset the response to avoid mixing already produced output
// and error page.
env.tryResetResponse();
// Build a new context
errorContext = new InvokeContext();
errorContext.compose(this.manager);
// Create a Notifying
NotifyingBuilder notifyingBuilder= (NotifyingBuilder)this.manager.lookup(NotifyingBuilder.ROLE);
Notifying currentNotifying = notifyingBuilder.build(this, ex);
this.manager.release(notifyingBuilder);
// Add it to the object model
env.getObjectModel().put(Constants.NOTIFYING_OBJECT, currentNotifying );
// notifying-generator is added in HandleErrorsNode
return node.invoke(env, errorContext);
} catch (Exception subEx) {
getLogger().error("error notifier barfs", subEx);
return false;
} finally {
if (errorContext != null) {
errorContext.dispose();
}
}
}