|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.error.LoggingErrorHandlingStrategy
public class LoggingErrorHandlingStrategy
This implementation of ErrorHandlingStrategy
logs the exceptions and
may also rethrow them. (That is configurable.)
Field Summary | |
---|---|
static boolean |
DEFAULT_RETHROW_EXCEPTIONS
Are Exception :s rethrown by default? (true ) |
static boolean |
DEFAULT_RETHROW_FILE_SYSTEM_EXCEPTIONS
Are FileSystemException :s rethrown by default? (true ) |
static boolean |
DEFAULT_RETHROW_RUNTIME_EXCEPTIONS
Are RuntimeException :s rethrown by default? (true ) |
Constructor Summary | |
---|---|
LoggingErrorHandlingStrategy()
Default constructor. |
|
LoggingErrorHandlingStrategy(boolean rethrowFileSystemExceptions,
boolean rethrowRuntimeExceptions,
boolean rethrowExceptions)
Constructor. |
Method Summary | |
---|---|
void |
handleException(Exception e,
LogAdapter la)
Handle an Exception . |
void |
handleFileSystemException(FileSystemException e,
LogAdapter la)
Handle a FileSystemException . |
void |
handleRuntimeException(RuntimeException e,
LogAdapter la)
Handle a RuntimeException . |
boolean |
isRethrowExceptions()
Does this error handling strategy rethrow Exception :s (wrapped in
FileSystemException :s)? |
boolean |
isRethrowFileSystemExceptions()
Does this error handling strategy rethrow FileSystemException :s? |
boolean |
isRethrowRuntimeExceptions()
Does this error handling strategy rethrow RuntimeException :s? |
void |
setRethrowExceptions(boolean rethrowExceptions)
Set to true if the error handling strategy should rethrow Exception :s (wrapped in FileSystemException :s). |
void |
setRethrowFileSystemExceptions(boolean rethrowFileSystemExceptions)
Set to true if the error handling strategy should rethrow
FileSystemException :s. |
void |
setRethrowRuntimeExceptions(boolean rethrowRuntimeExceptions)
Set to true if the error handling strategy should rethrow RuntimeException :s. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_RETHROW_FILE_SYSTEM_EXCEPTIONS
FileSystemException
:s rethrown by default? (true )
public static final boolean DEFAULT_RETHROW_RUNTIME_EXCEPTIONS
RuntimeException
:s rethrown by default? (true )
public static final boolean DEFAULT_RETHROW_EXCEPTIONS
Exception
:s rethrown by default? (true )
Constructor Detail |
---|
public LoggingErrorHandlingStrategy()
public LoggingErrorHandlingStrategy(boolean rethrowFileSystemExceptions, boolean rethrowRuntimeExceptions, boolean rethrowExceptions)
rethrowFileSystemExceptions
- Should FileSystemException
:s
be rethrown?rethrowRuntimeExceptions
- Should RuntimeException
:s be
rethrown?rethrowExceptions
- Should Exception
:s be rethrown?Method Detail |
---|
public boolean isRethrowFileSystemExceptions()
FileSystemException
:s?
true
if FileSystemException
:s are rethrown,
false
otherwise.public void setRethrowFileSystemExceptions(boolean rethrowFileSystemExceptions)
true
if the error handling strategy should rethrow
FileSystemException
:s.
rethrowFileSystemExceptions
- Set to true
to let this error
handling strategy rethrow FileSystemException
:s.public boolean isRethrowRuntimeExceptions()
RuntimeException
:s?
true
if RuntimeException
:s are rethrown, false
otherwise.public void setRethrowRuntimeExceptions(boolean rethrowRuntimeExceptions)
true
if the error handling strategy should rethrow RuntimeException
:s.
rethrowRuntimeExceptions
- Set to true
to let this error
handling strategy rethrow RuntimeException
:s.public boolean isRethrowExceptions()
Exception
:s (wrapped in
FileSystemException
:s)?
true
if Exception
:s are rethrown, false
otherwise.public void setRethrowExceptions(boolean rethrowExceptions)
true
if the error handling strategy should rethrow Exception
:s (wrapped in FileSystemException
:s).
rethrowExceptions
- Set to true
to let this error handling
strategy rethrow Exception
:s.public void handleFileSystemException(FileSystemException e, LogAdapter la) throws FileSystemException
ErrorHandlingStrategy
FileSystemException
.
handleFileSystemException
in interface ErrorHandlingStrategy
e
- The exception.la
- The file system's log adapter.
FileSystemException
- The implementation may choose to rethrow the
handled exception.public void handleRuntimeException(RuntimeException e, LogAdapter la) throws RuntimeException
ErrorHandlingStrategy
RuntimeException
.
handleRuntimeException
in interface ErrorHandlingStrategy
e
- The exception.la
- The file system's log adapter.
RuntimeException
- The implementation may choose to rethrow the
handled exception.public void handleException(Exception e, LogAdapter la) throws FileSystemException
ErrorHandlingStrategy
Exception
. If the exception should be rethrown, wrap it
in a FileSystemException
.
handleException
in interface ErrorHandlingStrategy
e
- The exception.la
- The file system's log adapter.
FileSystemException
- The implementation may choose to rethrow the
handled exception wrapped in a FileSystemException
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |