public class FacilityManager extends Object
Currently the only kind of facilities managed is MsgLogger.
An example use of this class is if 2 instances of a decoder are running in different threads and the messages of the 2 instances should be separated.
The default MsgLogger is a StreamMsgLogger that uses System.out as the 'out' stream and System.err as the 'err' stream, and a line width of 78. This can be changed using the registerMsgLogger() method.
MsgLogger
,
StreamMsgLogger
Constructor and Description |
---|
FacilityManager() |
Modifier and Type | Method and Description |
---|---|
static MsgLogger |
getMsgLogger()
Returns the MsgLogger registered with the current thread (the
thread that calls this method).
|
static MsgLogger |
getMsgLogger(Thread t)
Returns the MsgLogger registered with the thread 't' (the thread
that calls this method).
|
static ProgressWatch |
getProgressWatch()
Returns the ProgressWatch instance registered with the current
thread (the thread that calls this method).
|
static void |
registerMsgLogger(Thread t,
MsgLogger ml)
Registers the MsgLogger 'ml' as the logging facility of the
thread 't'.
|
static void |
registerProgressWatch(Thread t,
ProgressWatch pw) |
public FacilityManager()
public static void registerProgressWatch(Thread t, ProgressWatch pw)
public static ProgressWatch getProgressWatch()
public static void registerMsgLogger(Thread t, MsgLogger ml)
t
- The thread to associate with 'ml'ml
- The MsgLogger to associate with therad mlpublic static MsgLogger getMsgLogger()
public static MsgLogger getMsgLogger(Thread t)
t
- The thread for which to return the MsgLoggerCopyright © 2014. All rights reserved.