Spatial DataBlade
JAVA API v8.21

com.ibm.spatial.util
Class HandlerImpl

java.lang.Object
  extended by com.ibm.spatial.util.HandlerImpl
All Implemented Interfaces:
ErrorHandler, LogHandler

public class HandlerImpl
extends java.lang.Object
implements ErrorHandler, LogHandler

Default implementations of the ErrorHandler and LogHandler interfaces.

The ErrorHandler has the following behavior:

See Also:
ErrorHandler

Constructor Summary
HandlerImpl()
           
 
Method Summary
 void close()
          Close the LogHandler and free all associated resources.
 void fatalError(java.lang.Exception exception)
          Receive notification of a non-recoverable error.
 void flush()
          Flush any buffered output.
 java.io.Writer getWriter()
          Sets the log writer where the log records are written.
 java.lang.Exception recoverableError(java.lang.Exception exception)
          Receives notification of a recoverable error and returns the argument.
 void setWriter(java.io.Writer writer)
          Sets the log writer where the log records are written.
 java.lang.Exception warning(java.lang.Exception exception)
          Receive notification of a warning.
 void write(com.ibm.spatial.util.LogRecord record)
          Write a LogRecord.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerImpl

public HandlerImpl()
Method Detail

recoverableError

public java.lang.Exception recoverableError(java.lang.Exception exception)
Receives notification of a recoverable error and returns the argument.

Specified by:
recoverableError in interface ErrorHandler
Parameters:
exception - The recoverable error information encapsulated in a SpatialException.
Returns:
The original exception
See Also:
SpatialException

fatalError

public void fatalError(java.lang.Exception exception)
Receive notification of a non-recoverable error.

Specified by:
fatalError in interface ErrorHandler
Parameters:
exception - The fatal error information encapsulated in a SpatialException or RuntimeException.
See Also:
SpatialException

warning

public java.lang.Exception warning(java.lang.Exception exception)
Receive notification of a warning.

Specified by:
warning in interface ErrorHandler
Parameters:
exception - The warning information encapsulated in a SpatialException.
Returns:
The original exception
See Also:
SpatialException

write

public void write(com.ibm.spatial.util.LogRecord record)
Write a LogRecord.

The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.

The LogHandler is responsible for formatting the message.

Specified by:
write in interface LogHandler
Parameters:
record - description of the log event

flush

public void flush()
Flush any buffered output.

Specified by:
flush in interface LogHandler

close

public void close()
Close the LogHandler and free all associated resources.

The close method will perform a flush and then close the LogHandler. After close has been called this LogHandler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.

Specified by:
close in interface LogHandler

setWriter

public void setWriter(java.io.Writer writer)
Sets the log writer where the log records are written. If the argument is null, then the handler will write to the standard error stream with the default character encoding.

Parameters:
writer - the log writer object

getWriter

public java.io.Writer getWriter()
Sets the log writer where the log records are written.

Parameters:
writer - the log writer object

Spatial DataBlade
JAVA API v8.21


Licensed Materials - Property of IBM
Copyright IBM Corp. 2002, 2012 All Rights Reserved.