|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.osgi.framework.debug.FrameworkDebugOptions
public class FrameworkDebugOptions
The DebugOptions implementation class that allows accessing the list of debug options specified
for the application as well as creating DebugTrace objects for the purpose of having
dynamic enablement of debug tracing.
| Field Summary | |
|---|---|
protected static java.util.Map |
debugTraceCache
A cache of all of the bundles DebugTrace in the format |
protected java.io.File |
outFile
The File object to store messages. |
static java.lang.String |
PROP_TRACEFILE
|
protected boolean |
verboseDebug
Is verbose debugging enabled? Changing this value causes a new tracing session to start. |
| Fields inherited from interface org.eclipse.osgi.service.debug.DebugOptions |
|---|
LISTENER_SYMBOLICNAME |
| Method Summary | |
|---|---|
java.lang.Object |
addingService(ServiceReference reference)
A service is being added to the ServiceTracker. |
boolean |
getBooleanOption(java.lang.String option,
boolean defaultValue)
Returns the identified option as a boolean value. |
static FrameworkDebugOptions |
getDefault()
Returns the singleton instance of FrameworkDebugOptions. |
java.io.File |
getFile()
Returns the trace file if it is set, otherwise null is returned. |
int |
getIntegerOption(java.lang.String option,
int defaultValue)
Returns the identified option as an int value. |
java.lang.String |
getOption(java.lang.String option)
Returns the identified option. |
java.lang.String |
getOption(java.lang.String option,
java.lang.String defaultValue)
Returns the identified option. |
java.util.Map |
getOptions()
Returns a snapshot of the current options. |
boolean |
isDebugEnabled()
Returns true if debugging/tracing is currently enabled. |
void |
modifiedService(ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker has been modified. |
DebugTrace |
newDebugTrace(java.lang.String bundleSymbolicName)
Creates a new DebugTrace instance for the specified bundle symbolic name. |
DebugTrace |
newDebugTrace(java.lang.String bundleSymbolicName,
java.lang.Class traceEntryClass)
Create a new DebugTrace instance for the specified bundle symbolic name. |
void |
removedService(ServiceReference reference,
java.lang.Object service)
A service tracked by the ServiceTracker has been removed. |
void |
removeOption(java.lang.String option)
Removes the identified option. |
void |
setDebugEnabled(boolean enabled)
Enables or disables debugging/tracing. |
void |
setFile(java.io.File traceFile)
Sets the current file used to trace messages to. |
void |
setOption(java.lang.String option,
java.lang.String value)
Sets the identified option to the identified value. |
void |
setOptions(java.util.Map ops)
Sets the current option key/value pairs to the specified options. |
void |
setVerbose(boolean verbose)
|
void |
start(BundleContext bc)
|
void |
stop(BundleContext bc)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_TRACEFILE
protected static final java.util.Map debugTraceCache
DebugTrace in the format
protected java.io.File outFile
protected boolean verboseDebug
| Method Detail |
|---|
public void start(BundleContext bc)
public void stop(BundleContext bc)
public static FrameworkDebugOptions getDefault()
FrameworkDebugOptions.
FrameworkDebugOptions
public boolean getBooleanOption(java.lang.String option,
boolean defaultValue)
DebugOptions
Options are specified in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
getBooleanOption in interface DebugOptionsoption - the name of the option to lookupdefaultValue - the value to return if no such option is found
DebugOptions.getBooleanOption(String, boolean)public java.lang.String getOption(java.lang.String option)
DebugOptionsnull 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
getOption in interface DebugOptionsoption - the name of the option to lookup
nullDebugOptions.getOption(String)
public java.lang.String getOption(java.lang.String option,
java.lang.String defaultValue)
DebugOptions
Options are specified
in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
getOption in interface DebugOptionsoption - the name of the option to lookupdefaultValue - the value to return if no such option is found
DebugOptions.getOption(String, String)
public int getIntegerOption(java.lang.String option,
int defaultValue)
DebugOptions
Options are specified
in the general form <Bundle-SymbolicName>/<option-path>.
For example, org.eclipse.core.runtime/debug
getIntegerOption in interface DebugOptionsoption - the name of the option to lookupdefaultValue - the value to return if no such option is found
DebugOptions.getIntegerOption(String, int)public java.util.Map getOptions()
DebugOptionsString. 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 DebugOptions.setDebugEnabled(boolean).
getOptions in interface DebugOptionspublic void removeOption(java.lang.String option)
DebugOptions
removeOption in interface DebugOptionsoption - the name of the option to remove
public void setOption(java.lang.String option,
java.lang.String value)
DebugOptions
setOption in interface DebugOptionsoption - the name of the option to setvalue - the value of the option to setpublic void setOptions(java.util.Map ops)
DebugOptionsIllegalArgumentException 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 DebugOptions.setDebugEnabled(boolean).
If debug is enabled then notifications will be sent to the
listeners which have options that have been changed, added or removed.
setOptions in interface DebugOptionsops - the new set of optionspublic boolean isDebugEnabled()
DebugOptions
isDebugEnabled in interface DebugOptionspublic void setDebugEnabled(boolean enabled)
DebugOptionsWhen 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.
setDebugEnabled in interface DebugOptionsenabled - If true, debug is enabled, otherwise
debug is disabled.public final DebugTrace newDebugTrace(java.lang.String bundleSymbolicName)
DebugOptionsDebugTrace 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.
newDebugTrace in interface DebugOptionsbundleSymbolicName - The symbolic name of the bundle that is requesting a
new instance of a DebugTrace.
DebugTrace object for the specified plug-in ID
public final DebugTrace newDebugTrace(java.lang.String bundleSymbolicName,
java.lang.Class traceEntryClass)
DebugOptionsDebugTrace 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.
newDebugTrace in interface DebugOptionsbundleSymbolicName - 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 IDpublic final java.io.File getFile()
DebugOptionsnull is returned.
getFile in interface DebugOptionsnull is returned.public void setFile(java.io.File traceFile)
DebugOptions
setFile in interface DebugOptionstraceFile - The file to be used for tracing messages.public void setVerbose(boolean verbose)
public java.lang.Object addingService(ServiceReference reference)
ServiceTrackerCustomizerServiceTracker.
This method is called before a service which matched the search
parameters of the ServiceTracker is added to the
ServiceTracker. This method should return the service object
to be tracked for the specified ServiceReference. The
returned service object is stored in the ServiceTracker and
is available from the getService and
getServices methods.
addingService in interface ServiceTrackerCustomizerreference - The reference to the service being added to the
ServiceTracker.
null if the specified referenced service
should not be tracked.
public void modifiedService(ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker has been modified.
This method is called when a service being tracked by the
ServiceTracker has had it properties modified.
modifiedService in interface ServiceTrackerCustomizerreference - The reference to the service that has been modified.service - The service object for the specified referenced service.
public void removedService(ServiceReference reference,
java.lang.Object service)
ServiceTrackerCustomizerServiceTracker has been removed.
This method is called after a service is no longer being tracked by the
ServiceTracker.
removedService in interface ServiceTrackerCustomizerreference - The reference to the service that has been removed.service - The service object for the specified referenced service.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||