public interface DebugOptions
DebugTrace
instance for
a bundle to use for dynamic tracing.Modifier and Type | Field and Description |
---|---|
static String |
LISTENER_SYMBOLICNAME
The service property (named "listener.symbolic.name") which specifies
the bundle symbolic name of a
DebugOptionsListener service. |
Modifier and Type | Method and Description |
---|---|
boolean |
getBooleanOption(String option,
boolean defaultValue)
Returns the identified option as a boolean value.
|
File |
getFile()
Returns the trace file if it is set, otherwise
null is returned. |
int |
getIntegerOption(String option,
int defaultValue)
Returns the identified option as an int value.
|
String |
getOption(String option)
Returns the identified option.
|
String |
getOption(String option,
String defaultValue)
Returns the identified option.
|
Map<String,String> |
getOptions()
Returns a snapshot of the current options.
|
boolean |
isDebugEnabled()
Returns true if debugging/tracing is currently enabled.
|
DebugTrace |
newDebugTrace(String bundleSymbolicName)
Creates a new
DebugTrace instance for the specified bundle symbolic name. |
DebugTrace |
newDebugTrace(String bundleSymbolicName,
Class<?> traceEntryClass)
Create a new
DebugTrace instance for the specified bundle symbolic name. |
void |
removeOption(String option)
Removes the identified option.
|
void |
setDebugEnabled(boolean value)
Enables or disables debugging/tracing.
|
void |
setFile(File newFile)
Sets the current file used to trace messages to.
|
void |
setOption(String option,
String value)
Sets the identified option to the identified value.
|
void |
setOptions(Map<String,String> options)
Sets the current option key/value pairs to the specified options.
|
static final String LISTENER_SYMBOLICNAME
DebugOptionsListener
service.boolean getBooleanOption(String option, boolean defaultValue)
Options are specified in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
option
- the name of the option to lookupdefaultValue
- the value to return if no such option is foundString getOption(String option)
null
value
is returned if no such option is found or if debug is not enabled.
Options are specified
in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
option
- the name of the option to lookupnull
String getOption(String option, String defaultValue)
Options are specified
in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
option
- the name of the option to lookupdefaultValue
- the value to return if no such option is foundint getIntegerOption(String option, int defaultValue)
Options are specified
in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
option
- the name of the option to lookupdefaultValue
- the value to return if no such option is foundMap<String,String> getOptions()
String
. If no
options are set then an empty map is returned.
If debug is not enabled then the snapshot of the current disabled
values is returned. See setDebugEnabled(boolean)
.
void setOption(String option, String value)
option
- the name of the option to setvalue
- the value of the option to setvoid setOptions(Map<String,String> options)
IllegalArgumentException
is thrown if any key or value
in the specified map is not of type String
.
If debug is not enabled then the specified options are saved as
the disabled values and no notifications will be sent.
See setDebugEnabled(boolean)
.
If debug is enabled then notifications will be sent to the
listeners which have options that have been changed, added or removed.
options
- the new set of optionsvoid removeOption(String option)
option
- the name of the option to removeboolean isDebugEnabled()
void setDebugEnabled(boolean value)
When debug is disabled all debug options are unset. When disabling debug the current debug option values are stored in memory as disabled values. If debug is re-enabled the disabled values will be set back and enabled. The disabled values are only stored in memory and if the framework is restarted then the disabled option values will be lost.
value
- If true
, debug is enabled, otherwise
debug is disabled.void setFile(File newFile)
newFile
- The file to be used for tracing messages.File getFile()
null
is returned.null
is returned.DebugTrace newDebugTrace(String bundleSymbolicName)
DebugTrace
instance for the specified bundle symbolic name.
If a DebugTrace
object has already been created for the specified symbolic
name then the existing DebugTrace
object will be returned.
The class name, method name, and line number of any callers to the DebugTrace
API will automatically be determined by parsing the stack trace of the executing thread.
These attributes will be set based on the first caller of this API.bundleSymbolicName
- The symbolic name of the bundle that is requesting a
new instance of a DebugTrace
.DebugTrace
object for the specified plug-in IDDebugTrace newDebugTrace(String bundleSymbolicName, Class<?> traceEntryClass)
DebugTrace
instance for the specified bundle symbolic name.
If a DebugTrace
object has already been created for the specified symbolic
name then the existing DebugTrace
object will be returned.
The class name, method name, and line number of any callers to the DebugTrace
API will automatically be determined by parsing the stack trace of the executing thread.
The values of these attributes will be based on the last invocation to the specified traceEntryClass
found in the parsed stack trace.bundleSymbolicName
- The symbolic name of the bundle that is requesting a
new instance of a DebugTrace
.traceEntryClass
- The class that is being used to abstract tracing calls for a bundle.DebugTrace
object for the specified plug-in IDCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.