Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.adfnmc.java.util.logging
Class Handler

java.lang.Object
  extended by oracle.adfnmc.java.util.logging.Handler
Direct Known Subclasses:
DevNullHandler, StreamHandler, StringWriterHandler

public abstract class Handler
extends java.lang.Object

A Handler object accepts a logging request and exports the desired messages to a target, for example, a file, the console, etc. It can be disabled by setting its logging level to Level.OFF.


Field Summary
protected  java.lang.String prefix
           
 
Constructor Summary
protected Handler()
          Constructs a Handler object with a default error manager, the default encoding, and the default logging level Level.ALL.
 
Method Summary
abstract  void close()
          Closes this handler.
abstract  void flush()
          Flushes any buffered output.
 java.lang.String getEncoding()
          Gets the character encoding used by this handler.
 ErrorManager getErrorManager()
          Gets the error manager used by this handler to report errors during logging.
 Filter getFilter()
          Gets the filter used by this handler.
 Formatter getFormatter()
          Gets the formatter used by this handler to format the logging messages.
 Level getLevel()
          Gets the logging level of this handler.
 boolean isLoggable(LogRecord record)
          Determines whether the supplied log record need to be logged.
abstract  void publish(LogRecord record)
          Accepts an actual logging request.
protected  void reportError(java.lang.String msg, java.lang.Exception ex, int code)
          Report an error to the error manager associated with this handler.
 void setEncoding(java.lang.String encoding)
          Sets the character encoding used by this handler.
 void setErrorManager(ErrorManager em)
          Sets the error manager for this handler.
 void setFilter(Filter newFilter)
          Sets the filter to be used by this handler.
 void setFormatter(Formatter newFormatter)
          Sets the formatter to be used by this handler.
 void setLevel(Level newLevel)
          Sets the logging level of this handler.
protected  void setPrefix(java.lang.String prefix)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prefix

protected java.lang.String prefix
Constructor Detail

Handler

protected Handler()
Constructs a Handler object with a default error manager, the default encoding, and the default logging level Level.ALL. It has no filter and no formatter.

Method Detail

setPrefix

protected void setPrefix(java.lang.String prefix)

close

public abstract void close()
Closes this handler. A flush operation will usually be performed and all the associated resources will be freed. Client applications should not use a handler after closing it.

Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

flush

public abstract void flush()
Flushes any buffered output.


publish

public abstract void publish(LogRecord record)
Accepts an actual logging request.

Parameters:
record - the log record to be logged

getEncoding

public java.lang.String getEncoding()
Gets the character encoding used by this handler.

Returns:
the character encoding used by this handler

getErrorManager

public ErrorManager getErrorManager()
Gets the error manager used by this handler to report errors during logging.

Returns:
the error manager used by this handler
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

getFilter

public Filter getFilter()
Gets the filter used by this handler.

Returns:
the filter used by this handler

getFormatter

public Formatter getFormatter()
Gets the formatter used by this handler to format the logging messages.

Returns:
the formatter used by this handler

getLevel

public Level getLevel()
Gets the logging level of this handler.

Returns:
the logging level of this handler

isLoggable

public boolean isLoggable(LogRecord record)
Determines whether the supplied log record need to be logged. The logging levels will be checked as well as the filter.

Parameters:
record - the log record to be checked
Returns:
true if the supplied log record need to be logged, otherwise false

reportError

protected void reportError(java.lang.String msg,
                           java.lang.Exception ex,
                           int code)
Report an error to the error manager associated with this handler.

Parameters:
msg - the error message
ex - the associated exception
code - the error code

setEncoding

public void setEncoding(java.lang.String encoding)
                 throws java.lang.SecurityException,
                        java.io.UnsupportedEncodingException
Sets the character encoding used by this handler. A null value indicates the using of the default encoding.

Parameters:
encoding - the character encoding to set
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.
java.io.UnsupportedEncodingException - If the specified encoding is not supported by the runtime.

setErrorManager

public void setErrorManager(ErrorManager em)
Sets the error manager for this handler.

Parameters:
em - the error manager to set
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

setFilter

public void setFilter(Filter newFilter)
Sets the filter to be used by this handler.

Parameters:
newFilter - the filter to set
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

setFormatter

public void setFormatter(Formatter newFormatter)
Sets the formatter to be used by this handler.

Parameters:
newFormatter - the formatter to set
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

setLevel

public void setLevel(Level newLevel)
Sets the logging level of this handler.

Parameters:
newLevel - the logging level to set
Throws:
java.lang.SecurityException - If a security manager determines that the caller does not have the required permission.

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.