|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.util.DebugProperties
This utility class provides access to all the properties that are used
to configure information capture to aid in debugging. It gets initialized
from the debug.properties file.
Supported API: true
Extendable: false
Nested Class Summary | |
private static class |
DebugProperties.ElementSetFlag
|
private static class |
DebugProperties.GroupMember
|
private static class |
DebugProperties.TargetDefinition
|
Field Summary | |
private static String |
CLASSNAME
|
private static String |
DEBUG_KEY
|
private static DebugWriter |
defaultWriter
|
private static Vector |
elementSets
|
private static String |
FLAG_DELIMITER
|
private static Hashtable |
flagSets
|
private static String |
GROUP_KEY
|
private static Hashtable |
groups
|
private static String |
LOAD_DELIMITER
|
private static String |
LOG_KEY
|
private static String |
RESOURCE
|
private static int |
SYSTEM_DEBUG
|
private static boolean |
VERBOSE
|
private static Hashtable |
writer
|
private static WTProperties |
wtProperties
|
Constructor Summary | |
DebugProperties()
|
Method Summary | |
private static DebugWriter |
createWriter(String name,
String file_name,
boolean append,
boolean tee,
int iterations,
String date_format,
boolean add_thread,
boolean verbose)
|
private static int |
getConstantValue(String constant_name)
|
static boolean |
getFlag(int flag,
Object target)
Determines if a particular flag is set, for a particular object. |
static boolean |
getFlag(int flag,
Object target,
String qualifier)
Determines if a particular flag is set, for a particular object, qualified by the qualifier. |
private static Vector |
getGroupMembership(String target)
|
private static Properties |
getProperties()
|
static DebugWriter |
getWriter(String classname)
Gets the object for the association that plays role: writer. |
private static BitSet |
initializeFlagSet(String target)
|
static boolean |
isData(Object target)
Determines if the DATA flag is set, for a particular object. |
static boolean |
isData(Object target,
String qualifier)
Determines if the DATA flag is set, for a particular object, qualified by the qualifier. |
private static boolean |
isDebug(String classname)
|
private static boolean |
isDebugKey(String key)
|
static boolean |
isDebugOn(String target)
Flag that specifies if any debug capture can take place for a specific target. |
private static boolean |
isDescendent(String descendent,
String ancestor)
|
private static boolean |
isEmpty(String string)
|
static boolean |
isException(Object target)
Determines if the EXCEPTION flag is set, for a particular object. |
static boolean |
isException(Object target,
String qualifier)
Determines if the EXCEPTION flag is set, for a particular object, qualified by the qualifier. |
private static boolean |
isGroupKey(String key)
|
private static boolean |
isGroupMember(String classname,
String group_name,
boolean recurse)
|
private static boolean |
isLogKey(String key)
|
private static boolean |
isMember(String classname,
DebugProperties.TargetDefinition target_def,
boolean recurse)
|
private static boolean |
isPackageMember(String classname,
String packageName,
boolean recurse)
|
private static boolean |
isPrimaryLogKey(String key)
|
static boolean |
isReport(Object target)
Determines if the REPORT flag is set, for a particular object. |
static boolean |
isReport(Object target,
String qualifier)
Determines if the REPORT flag is set, for a particular object, qualified by the qualifier. |
static boolean |
isStackTrace(Object target)
Determines if the STACK_TRACE flag is set, for a particular object. |
static boolean |
isStackTrace(Object target,
String qualifier)
Determines if the STACK_TRACE flag is set, for a particular object, qualified by the qualifier. |
static boolean |
isTrace(Object target)
Determines if the TRACE flag is set, for a particular object. |
static boolean |
isTrace(Object target,
String qualifier)
Determines if the TRACE flag is set, for a particular object, qualified by the qualifier. |
private static void |
loadFlags(Properties properties)
|
private static void |
loadGroups(Properties properties)
|
private static void |
loadWriters(Properties properties)
|
private static BitSet |
makeFlagSet(int flag,
boolean value)
|
private static void |
processGroup(int flag,
String target,
String qualifier,
boolean value)
|
private static void |
processMembers(DebugProperties.ElementSetFlag elementSetFlag)
|
private static void |
setAllFlags(String target,
DebugType target_type,
String qualifier,
boolean value)
|
private static void |
setFlag(BitSet flagSet,
int flag,
boolean value)
|
static void |
setFlag(int flag,
String target,
DebugType target_type,
String qualifier,
boolean value)
Sets the flag, for a particular target, which may be qualified by the qualifier. |
private static void |
storeGroup(String group_name,
String group_list)
|
private static BitSet |
updateFlag(int flag,
String target,
boolean value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String RESOURCE
private static final String CLASSNAME
private static Hashtable writer
private static WTProperties wtProperties
private static DebugWriter defaultWriter
private static Hashtable flagSets
private static Hashtable groups
private static Vector elementSets
private static final int SYSTEM_DEBUG
private static final String FLAG_DELIMITER
private static final String LOAD_DELIMITER
private static final String DEBUG_KEY
private static final String GROUP_KEY
private static final String LOG_KEY
private static final boolean VERBOSE
Constructor Detail |
public DebugProperties()
Method Detail |
public static DebugWriter getWriter(String classname)
classname
-
public static boolean isDebugOn(String target)
target
-
public static boolean isData(Object target)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
getFlag(int,Object)
public static boolean isData(Object target, String qualifier)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
getFlag(int,Object,String)
public static boolean isException(Object target)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
getFlag(int,Object)
public static boolean isException(Object target, String qualifier)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
getFlag(int,Object,String)
public static boolean isReport(Object target)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
getFlag(int,Object)
public static boolean isReport(Object target, String qualifier)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
getFlag(int,Object,String)
public static boolean isStackTrace(Object target)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
getFlag(int,Object)
public static boolean isStackTrace(Object target, String qualifier)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
getFlag(int,Object,String)
public static boolean isTrace(Object target)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
getFlag(int,Object)
public static boolean isTrace(Object target, String qualifier)
target
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
getFlag(int,Object,String)
public static boolean getFlag(int flag, Object target)
Determination is made based on the following algorithm for finding a flag configuration that best matches the target:1) classname/target.toString()/current thread 2) classname/target.toString() 3) classname/current thread 4) classname
flag
- the flag to be checkedtarget
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methods
DebugFlag
public static boolean getFlag(int flag, Object target, String qualifier)
Determination is made based on the following algorithm for finding a flag configuration that best matches the target:1) classname/target.toString()/current thread 2) classname/target.toString() 3) classname/qualifier 4) classname/current thread 5) classname
flag
- the flag to be checkedtarget
- an object that is the target of the flag; the object
can be an instance of a Class, or a Class, so that it can be used
from instance methods or static methodsqualifier
- a string that provides an open end qualification
for the target
DebugFlag
public static void setFlag(int flag, String target, DebugType target_type, String qualifier, boolean value)
flag
- the flag to be checkedtarget
- a String that is the key for a target. If target
is a Class, it is the classname. If target is an instance of a Class,
it is the classname +"/"+ instance.toString(). If target is a package,
it is the package name. If target is a defined group, it is the name
of the group.target_type
- one of the predefined DebugTypesqualifier
- a string that provides an open end qualification
for the targetvalue
- true, if the flag is to be be set; false if the flag
is to be clearedDebugFlag
private static void storeGroup(String group_name, String group_list)
private static void processGroup(int flag, String target, String qualifier, boolean value)
private static Vector getGroupMembership(String target)
private static void processMembers(DebugProperties.ElementSetFlag elementSetFlag)
private static BitSet initializeFlagSet(String target)
private static boolean isGroupMember(String classname, String group_name, boolean recurse)
private static boolean isMember(String classname, DebugProperties.TargetDefinition target_def, boolean recurse)
private static boolean isPackageMember(String classname, String packageName, boolean recurse)
private static boolean isDescendent(String descendent, String ancestor)
private static BitSet updateFlag(int flag, String target, boolean value)
private static BitSet makeFlagSet(int flag, boolean value)
private static void setFlag(BitSet flagSet, int flag, boolean value)
private static boolean isEmpty(String string)
private static Properties getProperties() throws WTException
WTException
private static void loadGroups(Properties properties) throws WTException
WTException
private static boolean isGroupKey(String key)
private static void loadWriters(Properties properties) throws WTException
WTException
private static boolean isLogKey(String key)
private static boolean isPrimaryLogKey(String key)
private static boolean isDebugKey(String key)
private static void loadFlags(Properties properties) throws WTException
WTException
private static int getConstantValue(String constant_name) throws WTException
WTException
private static DebugWriter createWriter(String name, String file_name, boolean append, boolean tee, int iterations, String date_format, boolean add_thread, boolean verbose)
private static void setAllFlags(String target, DebugType target_type, String qualifier, boolean value)
private static boolean isDebug(String classname)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |