org.entityfs.error
Interface ErrorHandlingStrategy

All Known Implementing Classes:
LoggingErrorHandlingStrategy

public interface ErrorHandlingStrategy

This is an interface for an error handling strategy.

Classes that let clients register a strategy should call it in this way:
try {
  ...
} catch (FileSystemException e) {
  strat.handleFileSystemException(e, la);
} catch (RuntimeException e) {
  strat.handleRuntimeException(e, la);
}

Since:
1.0
Author:
Karl Gustafsson

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.
 

Method Detail

handleFileSystemException

void handleFileSystemException(FileSystemException e,
                               LogAdapter la)
                               throws FileSystemException
Handle a FileSystemException.

Parameters:
e - The exception.
la - The file system's log adapter.
Throws:
FileSystemException - The implementation may choose to rethrow the handled exception.

handleRuntimeException

void handleRuntimeException(RuntimeException e,
                            LogAdapter la)
                            throws RuntimeException
Handle a RuntimeException.

Parameters:
e - The exception.
la - The file system's log adapter.
Throws:
RuntimeException - The implementation may choose to rethrow the handled exception.

handleException

void handleException(Exception e,
                     LogAdapter la)
                     throws FileSystemException
Handle an Exception. If the exception should be rethrown, wrap it in a FileSystemException.

Parameters:
e - The exception.
la - The file system's log adapter.
Throws:
FileSystemException - The implementation may choose to rethrow the handled exception wrapped in a FileSystemException.