public final class ExceptionMessageProducer extends Object implements org.jdtaus.core.lang.ExceptionListener
ExceptionListener
resolving exceptions to corresponding application
messages.onException(ExceptionEvent)
,
SwingMessagePane
,
MessageLogger
Constructor and Description |
---|
ExceptionMessageProducer()
Creates a new
ExceptionMessageProducer instance. |
ExceptionMessageProducer(File logDirectory,
URL trackerUrl,
String reportAddress)
Creates a new
ExceptionMessageProducer instance taking the
application's logfile directory, an URL to the application's online
bugtracking system, and an email address where to send bugreports to
alternatively. |
Modifier and Type | Method and Description |
---|---|
void |
onException(org.jdtaus.core.lang.ExceptionEvent event)
This method resolves exceptions provided by an application's
ExceptionEventSource to corresponding MessageEvent s which
an application may react to by registering a listener to its
MessageEventSource . |
public ExceptionMessageProducer()
ExceptionMessageProducer
instance.public ExceptionMessageProducer(File logDirectory, URL trackerUrl, String reportAddress)
ExceptionMessageProducer
instance taking the
application's logfile directory, an URL to the application's online
bugtracking system, and an email address where to send bugreports to
alternatively.logDirectory
- the directory holding the application's logfiles.trackerUrl
- an URL to the application's online bugtracking system.reportAddress
- an email address to alternatively send bugreports
to.NullPointerException
- if either logDirectory
,
trackerUrl
or reportAddress
is null
.public void onException(org.jdtaus.core.lang.ExceptionEvent event)
This method resolves exceptions provided by an application's
ExceptionEventSource
to corresponding MessageEvent
s which
an application may react to by registering a listener to its
MessageEventSource
. Messages for checked exceptions are resolved
by using any available ExceptionMessageResolver
implementation
stopping at the first implementation not returning null
.
For exceptions which are instances of RuntimeException
an
additional message informing the user that the application's state is
undefined and that a restart is recommended is added to the produced
MessageEvent
. Optionally an additional message informing the user
on how to report a bug is added to the produced MessageEvent
if
the instance got constructed using the constructor taking that
information.
onException
in interface org.jdtaus.core.lang.ExceptionListener
event
- the event holding the exception.ExceptionMessageResolver.resolve(Exception)
Copyright © 2005-2012 jDTAUS. All Rights Reserved.