com.atomikos.diagnostics
Class CascadedConsole

java.lang.Object
  extended by com.atomikos.diagnostics.CascadedConsole
All Implemented Interfaces:
Console

public class CascadedConsole
extends Object
implements Console

A cascaded message console for system output warnings.


Field Summary
 
Fields inherited from interface com.atomikos.diagnostics.Console
DEBUG, INFO, WARN
 
Constructor Summary
CascadedConsole(Console first, Console last)
          Construct a new instance.
 
Method Summary
 void close()
          Closes the underlying consoles.
 int getLevel()
          Gets the level of the console.
 void print(String string)
          Print a message to the output of the console(s).
 void print(String string, int level)
          Print a string with a given level of granularity.
 void println(String string)
          Print a message to the output of the console(s).
 void println(String string, int level)
          Print a string with newline, at a given level of granularity.
 void setLevel(int level)
          Set the overall granularity level of the console.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CascadedConsole

public CascadedConsole(Console first,
                       Console last)
Construct a new instance.

Parameters:
first - The console where messages are displayed first.
last - The console where messages are cascaded after display on first console.
Method Detail

println

public void println(String string)
             throws IOException
Print a message to the output of the console(s). This message is cascaded internally.

Specified by:
println in interface Console
Parameters:
string - The message to output.
java.io.IOException - On failure.
Throws:
IOException - On failure.

print

public void print(String string)
           throws IOException
Print a message to the output of the console(s). This message is cascaded internally.

Specified by:
print in interface Console
Parameters:
string - The message to output.
java.io.IOException - On failure.
Throws:
IOException - On failure.

close

public void close()
           throws IOException
Closes the underlying consoles.

Specified by:
close in interface Console
Throws:
IOException - On failure.

println

public void println(String string,
                    int level)
             throws IOException
Description copied from interface: Console
Print a string with newline, at a given level of granularity.

Specified by:
println in interface Console
Parameters:
string - The string.
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

print

public void print(String string,
                  int level)
           throws IOException
Description copied from interface: Console
Print a string with a given level of granularity.

Specified by:
print in interface Console
Parameters:
string - The string
level - The level (one of the predefined constants).
Throws:
IOException - On failure.

setLevel

public void setLevel(int level)
Description copied from interface: Console
Set the overall granularity level of the console. Messages printed with a higher level will be ignored.

Specified by:
setLevel in interface Console
Parameters:
level - The level, one of the predefined constants. Default is WARN.

getLevel

public int getLevel()
Description copied from interface: Console
Gets the level of the console.

Specified by:
getLevel in interface Console
Returns:
The log level.
See Also:
Console.getLevel()


Copyright © 2011. All Rights Reserved.