fipaos.util
Class DIAGNOSTICS


public class DIAGNOSTICS

Object which can be used to handles all status and error messages.
All methods are static - this class does not need to be instantiated


Field Summary
 final static intLEVEL_2
          diagnostic level
 final static intLEVEL_3
          diagnostic level
 final static intLEVEL_4
          diagnostic level
 final static intLEVEL_MAX
          maximum diagnostic level: produces the minimum of information
 final static intLEVEL_MIN
          minimum diagnostic level: produces the maximum of information

Method Summary
 static voidassert(boolean condition)
          This does nothing except provide a breakpoint location for debugging Creation date: (9/27/99 10:37:10 AM)
 static voidassert(boolean condition, String msg)
          It outputs message if condition is true This provides a breakpoint location for debugging Creation date: (9/27/99 10:37:10 AM)
 static voidclose()
          Flush the buffers and close current output file
 static voidclose(String name)
          Flush the buffers and close current output file - when a new output file is created use the given name
 static voidflush()
          Flush the contents of the buffers
 static intget_file_level()
          get the level which filters whether messages are saved to disk Creation date: (3/3/00 3:01:08 AM)
 static intget_memory_level()
          Insert the method's description here.
 synchronized voidmonitorUpdateFile(Object o)
          Print the given information to a file
 synchronized voidmonitorUpdateMemory(Object o)
          Print the given information to the screen
 synchronized voidopenFile(String afile)
          Set a file (only if it's not already been set) to dump the diagnostic output into N.B.
 static voidprintln()
           
 static voidprintln(Object data, Throwable exception)
          Receive data including exception & pass it out
 static voidprintln(Object data)
           
 static voidprintln(Object data, Throwable exception, int level)
          Receive data including exception & pass it out
 static voidprintln(Object data, int alevel)
           
 static voidprintln(Object data, Throwable exception, Object source)
          Receive data including exception & pass it out
 static voidprintln(Object data, Object source)
           
 static voidprintln(Object data, Throwable exception, Object source, int level)
          Receive data including exception & pass it out
 static voidprintln(Object data, Object source, int newLevel)
          Receive data and output it to any file set and to any process [data sink] that is attached
 static voidprintStackTrace(String name, String msg)
          output all diagnostic messages for name
 voidset_current_level(int NewLevel)
          set the levelfor following messages Creation date: (3/3/00 4:08:27 AM)
 static voidsetDelimiter(String delim)
          set a delimiter character for seperating fields in output messages
 static voidsetEnabled(boolean on)
          Turn DIAGNOSTICS on or off
 static voidsetFileLevel(int alevel)
          set a new level to filter which messages are stored on disk Creation date: (3/3/00 3:01:08 AM)
 static voidsetMemoryLevel(int alevel)
          set a new level to filter which messages are sent to any attached sinks level must be in the range LEVEL_MIN to LEVEL_MAX otherwise it is ignored Creation date: (3/3/00 3:00:47 AM)
 static voidTBD(String msg)
          Notify user of method call which is not yet implemented - it's To Be Done Deprecate this method?

Field Detail

LEVEL_2

public final static int LEVEL_2
diagnostic level

LEVEL_3

public final static int LEVEL_3
diagnostic level

LEVEL_4

public final static int LEVEL_4
diagnostic level

LEVEL_MAX

public final static int LEVEL_MAX
maximum diagnostic level: produces the minimum of information

LEVEL_MIN

public final static int LEVEL_MIN
minimum diagnostic level: produces the maximum of information
Method Detail

assert

public static void assert(boolean condition)
This does nothing except provide a breakpoint location for debugging Creation date: (9/27/99 10:37:10 AM)
Parameters:
condition - boolean

assert

public static void assert(boolean condition, String msg)
It outputs message if condition is true This provides a breakpoint location for debugging Creation date: (9/27/99 10:37:10 AM)
Parameters:
condition - boolean

close

public static void close()
Flush the buffers and close current output file

close

public static void close(String name)
Flush the buffers and close current output file - when a new output file is created use the given name

flush

public static void flush()
Flush the contents of the buffers

get_file_level

public static int get_file_level()
get the level which filters whether messages are saved to disk Creation date: (3/3/00 3:01:08 AM)
Returns: int

get_memory_level

public static int get_memory_level()
Insert the method's description here. Creation date: (3/3/00 3:00:47 AM)
Returns: int

monitorUpdateFile

public synchronized void monitorUpdateFile(Object o)
Print the given information to a file

monitorUpdateMemory

public synchronized void monitorUpdateMemory(Object o)
Print the given information to the screen

openFile

public synchronized void openFile(String afile)
Set a file (only if it's not already been set) to dump the diagnostic output into N.B. File must be closed at the end by called DIAGNOSTICS.closeFile();
Parameters:
file - java.lang.String file name

println

public static void println()

println

public static void println(Object data, Throwable exception)
Receive data including exception & pass it out

println

public static void println(Object data)

println

public static void println(Object data, Throwable exception, int level)
Receive data including exception & pass it out

println

public static void println(Object data, int alevel)

println

public static void println(Object data, Throwable exception, Object source)
Receive data including exception & pass it out

println

public static void println(Object data, Object source)

println

public static void println(Object data, Throwable exception, Object source, int level)
Receive data including exception & pass it out

println

public static void println(Object data, Object source, int newLevel)
Receive data and output it to any file set and to any process [data sink] that is attached
Parameters:
data - Object the data received
source - Object the sender of the data
level - int the diagnostics level for this data

printStackTrace

public static void printStackTrace(String name, String msg)
output all diagnostic messages for name
Parameters:
name - String the instance or class name
msg - String the message to be output

set_current_level

public void set_current_level(int NewLevel)
set the levelfor following messages Creation date: (3/3/00 4:08:27 AM)
Parameters:
NewLevel - int

setDelimiter

public static void setDelimiter(String delim)
set a delimiter character for seperating fields in output messages
Parameters:
delim - String

setEnabled

public static void setEnabled(boolean on)
Turn DIAGNOSTICS on or off

setFileLevel

public static void setFileLevel(int alevel)
set a new level to filter which messages are stored on disk Creation date: (3/3/00 3:01:08 AM)
Parameters:
aLevel - int

setMemoryLevel

public static void setMemoryLevel(int alevel)
set a new level to filter which messages are sent to any attached sinks level must be in the range LEVEL_MIN to LEVEL_MAX otherwise it is ignored Creation date: (3/3/00 3:00:47 AM)
Parameters:
alevel - int

TBD

public static void TBD(String msg)
Notify user of method call which is not yet implemented - it's To Be Done Deprecate this method?
Parameters:
msg - String the message to ouput
level - int

Association Links

to Class java.lang.String

is used to 'Tokenize' error messages stored in file

to Class fipaos.util.DIAGNOSTICS

Reference to a single DIAGNOSTICS object

to Class java.lang.String

Name for the DIAGNOSITCS file this produces

to Class java.io.BufferedWriter

Output file

to Class fipaos.util.Queue

Queue of DIAGNOSTICS messages to write to memory

to Class fipaos.util.Queue

Queue of DIAGNOSTICS messages to write to file

to Class fipaos.util.Monitor

Monitor of the memory message queue

to Class fipaos.util.Monitor

Monitor of the file message queue

to Class java.lang.Object

Lock to prevent multiple threads accessing the buffers