public class LaunchingPlugin extends Plugin implements IVMInstallChangedListener
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_LAUNCH_TEMP_FILES
list of temp files for the launch (separated by the path separator char).
|
static boolean |
DEBUG
Whether debug options are turned on for this plug-in.
|
static java.lang.String |
DEBUG_FLAG |
static boolean |
DEBUG_JRE_CONTAINER |
static java.lang.String |
DEBUG_JRE_CONTAINER_FLAG |
static java.lang.String |
ID_EXTENSION_POINT_RUNTIME_CLASSPATH_ENTRIES
Identifier for 'runtimeClasspathEntries' extension point
|
static java.lang.String |
ID_EXTENSION_POINT_VM_CONNECTORS
Identifier for 'vmConnectors' extension point
|
static java.lang.String |
ID_PLUGIN
The id of the JDT launching plug-in (value
"org.eclipse.jdt.launching"). |
static java.lang.String |
LAUNCH_TEMP_FILE_PREFIX
prefix for temp files
|
PROPERTY_INSTALL_LOCATION, PROPERTY_JAVADOC_LOCATION, PROPERTY_LIBRARY_LOCATIONS, PROPERTY_NAME, PROPERTY_VM_ARGUMENTS| Constructor and Description |
|---|
LaunchingPlugin()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
abort(java.lang.String message,
java.lang.Throwable exception)
Throws an exception with the given message and underlying exception.
|
void |
defaultVMInstallChanged(IVMInstall previous,
IVMInstall current)
Notification that the workspace default VM install
has changed.
|
static LaunchingPlugin |
getDefault()
Returns the singleton instance of
LaunchingPlugin |
static java.io.File |
getFileInPlugin(IPath path)
Return a
java.io.File object that corresponds to the specified
IPath in the plug-in directory. |
static LibraryInfo |
getLibraryInfo(java.lang.String javaInstallPath)
Returns the library info that corresponds to the specified JRE install
path, or
null if none. |
static javax.xml.parsers.DocumentBuilder |
getParser()
Returns a shared XML parser.
|
static java.lang.String |
getUniqueIdentifier()
Convenience method which returns the unique identifier of this plug-in.
|
IVMConnector |
getVMConnector(java.lang.String id)
Returns the VM connector with the specified id, or
null
if none. |
IVMConnector[] |
getVMConnectors()
Returns all VM connector extensions.
|
void |
handleDebugEvents(DebugEvent[] events) |
boolean |
isIgnoreVMDefPropertyChangeEvents()
Returns if VM property changed event should be ignored or not
|
static boolean |
isVMLogging() |
void |
launchesAdded(ILaunch[] launches) |
void |
launchesChanged(ILaunch[] launches) |
void |
launchesRemoved(ILaunch[] launches) |
static void |
log(IStatus status)
Logs the specified status
|
IRuntimeClasspathEntry2 |
newRuntimeClasspathEntry(java.lang.String id)
Returns a new runtime classpath entry of the specified type.
|
void |
optionsChanged(DebugOptions options) |
void |
preferenceChange(PreferenceChangeEvent event) |
protected void |
processVMPrefsChanged(java.lang.String oldValue,
java.lang.String newValue)
Check for differences between the old & new sets of installed JREs.
|
void |
resourceChanged(IResourceChangeEvent event) |
static boolean |
sameURL(java.net.URL url1,
java.net.URL url2)
Compares two URL for equality, but do not connect to do DNS resolution
|
void |
setIgnoreVMDefPropertyChangeEvents(boolean ignore)
Allows VM property change events to be ignored
|
static void |
setLibraryInfo(java.lang.String javaInstallPath,
LibraryInfo info)
Sets the library info that corresponds to the specified JRE install
path.
|
void |
start(BundleContext context) |
void |
stop(BundleContext context)
Clears zip file cache.
|
static boolean |
timeStampChanged(java.lang.String location)
Checks to see if the time stamp of the file describe by the given location string
has been modified since the last recorded time stamp.
|
static void |
trace(java.lang.String message)
Prints the given message to System.out and to the OSGi tracing (if enabled)
|
static void |
trace(java.lang.String option,
java.lang.String message,
java.lang.Throwable throwable)
Prints the given message to System.out and to the OSGi tracing (if started)
|
void |
vmAdded(IVMInstall vm)
Notification that a VM has been created.
|
void |
vmChanged(PropertyChangeEvent event)
Notification that a property of a VM install has changed.
|
void |
vmRemoved(IVMInstall vm)
Notification that a VM has been disposed.
|
public static boolean DEBUG
public static boolean DEBUG_JRE_CONTAINER
public static final java.lang.String DEBUG_JRE_CONTAINER_FLAG
public static final java.lang.String DEBUG_FLAG
public static final java.lang.String ATTR_LAUNCH_TEMP_FILES
LAUNCH_TEMP_FILE_PREFIX and will be
deleted once the process is terminatedpublic static final java.lang.String LAUNCH_TEMP_FILE_PREFIX
public static final java.lang.String ID_PLUGIN
"org.eclipse.jdt.launching").public static final java.lang.String ID_EXTENSION_POINT_VM_CONNECTORS
public static final java.lang.String ID_EXTENSION_POINT_RUNTIME_CLASSPATH_ENTRIES
public static LibraryInfo getLibraryInfo(java.lang.String javaInstallPath)
null if none.javaInstallPath - the absolute path to the java executablenull if nonepublic static void setLibraryInfo(java.lang.String javaInstallPath,
LibraryInfo info)
javaInstallPath - home location for a JREinfo - the library information, or null to removepublic static boolean isVMLogging()
public static java.io.File getFileInPlugin(IPath path)
java.io.File object that corresponds to the specified
IPath in the plug-in directory.path - the path to look for in the launching bundleFile from the bundle or nullpublic static java.lang.String getUniqueIdentifier()
LaunchingPluginpublic static LaunchingPlugin getDefault()
LaunchingPluginLaunchingPluginpublic static void log(IStatus status)
status - the status to logpublic void stop(BundleContext context)
throws java.lang.Exception
java.lang.ExceptionPlugin#stop(BundleContext)public void start(BundleContext context)
throws java.lang.Exception
java.lang.Exceptionpublic IVMConnector getVMConnector(java.lang.String id)
null
if none.id - connector identifierpublic IVMConnector[] getVMConnectors()
public IRuntimeClasspathEntry2 newRuntimeClasspathEntry(java.lang.String id) throws CoreException
id - extension type idCoreException - if unable to create an entryprotected void processVMPrefsChanged(java.lang.String oldValue,
java.lang.String newValue)
oldValue - the old preference valuenewValue - the new preference valuepublic void defaultVMInstallChanged(IVMInstall previous, IVMInstall current)
IVMInstallChangedListenerdefaultVMInstallChanged in interface IVMInstallChangedListenerprevious - the VM install that was previously assigned
to the workspace, possibly nullcurrent - the VM install that is currently assigned to the
workspace, possibly nullpublic void vmAdded(IVMInstall vm)
IVMInstallChangedListenervmAdded in interface IVMInstallChangedListenervm - the vm that has been createdpublic void vmChanged(PropertyChangeEvent event)
IVMInstallChangedListenervmChanged in interface IVMInstallChangedListenerevent - event describing the change. The VM that has changed
is the source object associated with the event.public void vmRemoved(IVMInstall vm)
IVMInstallChangedListenervmRemoved in interface IVMInstallChangedListenervm - the vm that has been disposedpublic void resourceChanged(IResourceChangeEvent event)
public void setIgnoreVMDefPropertyChangeEvents(boolean ignore)
ignore - if we should ignore VM property changed events or notpublic boolean isIgnoreVMDefPropertyChangeEvents()
public static boolean timeStampChanged(java.lang.String location)
location - the location of the SDK we want to check the time stamp fortrue if the time stamp has changed compared to the cached one or if there is
no recorded time stamp, false otherwise.public void launchesRemoved(ILaunch[] launches)
public void launchesAdded(ILaunch[] launches)
public void launchesChanged(ILaunch[] launches)
public void handleDebugEvents(DebugEvent[] events)
public static javax.xml.parsers.DocumentBuilder getParser()
throws CoreException
CoreException - if unable to create a parserprotected static void abort(java.lang.String message,
java.lang.Throwable exception)
throws CoreException
message - error messageexception - underlying exception or null if noneCoreException - if an exception occurspublic static boolean sameURL(java.net.URL url1,
java.net.URL url2)
url1 - a given URLurl2 - another given URL to compare to url1true if the URLs are equal, false otherwisepublic void preferenceChange(PreferenceChangeEvent event)
public void optionsChanged(DebugOptions options)
public static void trace(java.lang.String option,
java.lang.String message,
java.lang.Throwable throwable)
option - the option or nullmessage - the message to print or nullthrowable - the Throwable or nullpublic static void trace(java.lang.String message)
message - the message or null