public class AntCorePlugin extends Plugin
Modifier and Type | Field and Description |
---|---|
static String |
ANT_BUILDFILE_CONTENT_TYPE
Simple identifier constant (value
"org.eclipse.ant.core.antBuildFile" ) for the content type of an Ant BuildFile |
static String |
CLASS
Simple identifier constant (value
"class" ) of a tag that appears in Ant extensions. |
static String |
ECLIPSE_PROGRESS_MONITOR
Key to access the
IProgressMonitor reference. |
static String |
ECLIPSE_RUNTIME
Simple identifier constant (value
"eclipseRuntime" ) of a tag that appears in Ant extensions. |
static int |
ERROR_LIBRARY_NOT_SPECIFIED
Status code indicating an error occurred as a library was not specified
|
static int |
ERROR_MALFORMED_URL
Status code indicating an error occurred due to a malformed URL.
|
static int |
ERROR_RUNNING_BUILD
Status code indicating an error occurred running a build.
|
static String |
HEADLESS
Simple identifier constant (value
"headless" ) of a tag that appears in Ant extensions. |
static int |
INTERNAL_ERROR
Status code indicating an unexpected internal error.
|
static String |
LIBRARY
Simple identifier constant (value
"library" ) of a tag that appears in Ant extensions. |
static String |
NAME
Simple identifier constant (value
"name" ) of a tag that appears in Ant extensions. |
static String |
PI_ANTCORE
Unique identifier constant (value
"org.eclipse.ant.core" ) for the Ant Core plug-in. |
static String |
PT_EXTRA_CLASSPATH
Simple identifier constant (value
"extraClasspathEntries" ) for the extra classpath entries extension point. |
static String |
PT_PROPERTIES
Simple identifier constant (value
"antProperties" ) for the Ant properties extension point. |
static String |
PT_TASKS
Simple identifier constant (value
"antTasks" ) for the Ant tasks extension point. |
static String |
PT_TYPES
Simple identifier constant (value
"antTypes" ) for the Ant types extension point. |
static String |
URI
Simple identifier constant (value
"uri" ) of a tag that appears in Ant extensions. |
static String |
VALUE
Simple identifier constant (value
"value" ) of a tag that appears in Ant extensions. |
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
Constructor and Description |
---|
AntCorePlugin()
Constructs an instance of this plug-in runtime class.
|
Modifier and Type | Method and Description |
---|---|
ClassLoader |
getNewClassLoader()
Returns a new class loader to use when executing Ant builds.
|
ClassLoader |
getNewClassLoader(boolean allowLoading)
Returns a new class loader to use when executing Ant builds or other applications such as parsing or code proposal determination.
|
URLClassLoader |
getNewClassLoader(boolean allowLoading,
URL[] urls)
Returns a new class loader to use when executing Ant builds or other applications such as parsing or code proposal determination.
|
URLClassLoader |
getNewClassLoader(URL[] urls)
Returns a new class loader to use when executing Ant builds.
|
static AntCorePlugin |
getPlugin()
Returns this plug-in instance.
|
AntCorePreferences |
getPreferences()
Returns an object representing this plug-in's preferences.
|
static void |
log(Throwable t)
Logs the specified throwable with this plug-in's log.
|
void |
setRunningHeadless(boolean headless)
Set this plug-in's preferences for running headless based on the headless parameter.
|
void |
start(BundleContext context)
Starts up this plug-in.
|
void |
stop(BundleContext context)
Stops this plug-in.
|
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
public static final int INTERNAL_ERROR
public static final String PI_ANTCORE
"org.eclipse.ant.core"
) for the Ant Core plug-in.public static final String PT_TASKS
"antTasks"
) for the Ant tasks extension point.public static final String PT_EXTRA_CLASSPATH
"extraClasspathEntries"
) for the extra classpath entries extension point.public static final String PT_TYPES
"antTypes"
) for the Ant types extension point.public static final String PT_PROPERTIES
"antProperties"
) for the Ant properties extension point.public static final String ANT_BUILDFILE_CONTENT_TYPE
"org.eclipse.ant.core.antBuildFile"
) for the content type of an Ant BuildFilepublic static final String CLASS
"class"
) of a tag that appears in Ant extensions.public static final String NAME
"name"
) of a tag that appears in Ant extensions.public static final String LIBRARY
"library"
) of a tag that appears in Ant extensions.public static final String HEADLESS
"headless"
) of a tag that appears in Ant extensions.public static final String ECLIPSE_RUNTIME
"eclipseRuntime"
) of a tag that appears in Ant extensions.public static final String URI
"uri"
) of a tag that appears in Ant extensions.public static final String VALUE
"value"
) of a tag that appears in Ant extensions.public static final String ECLIPSE_PROGRESS_MONITOR
IProgressMonitor
reference. When a progress monitor is passed to the
AntRunner.run(IProgressMonitor)
method, the object is available as a reference for the current Ant project.public static final int ERROR_RUNNING_BUILD
public static final int ERROR_MALFORMED_URL
public static final int ERROR_LIBRARY_NOT_SPECIFIED
public AntCorePlugin()
An instance of this plug-in runtime class is automatically created when the facilities provided by the Ant Core plug-in are required. Clients must never explicitly instantiate a plug-in runtime class.
public void stop(BundleContext context) throws Exception
Plugin
This method should be re-implemented in subclasses that need to do something when the plug-in is shut down. Implementors should call the inherited method as late as possible to ensure that any system requirements can be met.
Plug-in shutdown code should be robust. In particular, this method should always make an effort to shut down the plug-in. Furthermore, the code should not assume that the plug-in was started successfully.
Note 1: If a plug-in has been automatically started, this method will be automatically invoked by the platform when the platform is shut down.
Note 2: This method is intended to perform simple termination of the plug-in environment. The platform may terminate invocations that do not complete in a timely fashion.
Note 3: The supplied bundle context represents the plug-in to the OSGi framework. For security reasons, it is strongly recommended that this object should not be divulged.
Note 4: This method and the Plugin.start(BundleContext)
may be called from separate threads,
but the OSGi framework ensures that both methods will not be called simultaneously.
stop
in interface BundleActivator
stop
in class Plugin
context
- the bundle context for this plug-inException
- if this method fails to shut down this plug-inpublic void start(BundleContext context) throws Exception
Plugin
This method should be overridden in subclasses that need to do something when this plug-in is started. Implementors should call the inherited method at the first possible point to ensure that any system requirements can be met.
If this method throws an exception, it is taken as an indication that plug-in initialization has failed; as a result, the plug-in will not be activated; moreover, the plug-in will be marked as disabled and ineligible for activation for the duration.
Note 1: This method is automatically invoked by the platform the first time any code in the plug-in is executed.
Note 2: This method is intended to perform simple initialization of the plug-in environment. The platform may terminate initializers that do not complete in a timely fashion.
Note 3: The class loader typically has monitors acquired during invocation of this method. It is strongly recommended that this method avoid synchronized blocks or other thread locking mechanisms, as this would lead to deadlock vulnerability.
Note 4: The supplied bundle context represents the plug-in to the OSGi framework. For security reasons, it is strongly recommended that this object should not be divulged.
Note 5: This method and the Plugin.stop(BundleContext)
may be called from separate threads,
but the OSGi framework ensures that both methods will not be called simultaneously.
start
in interface BundleActivator
start
in class Plugin
context
- the bundle context for this plug-inException
- if this plug-in did not start up properlypublic AntCorePreferences getPreferences()
public void setRunningHeadless(boolean headless)
headless
- Whether or not to mark that the plug-in is running headless or notpublic static AntCorePlugin getPlugin()
public ClassLoader getNewClassLoader()
public URLClassLoader getNewClassLoader(URL[] urls)
urls
- the URLs that define the classpath of the new classloaderpublic ClassLoader getNewClassLoader(boolean allowLoading)
allowLoading
- whether to allow plug-in classloaders associated with the new classloader to load Apache Ant classes or resources.public URLClassLoader getNewClassLoader(boolean allowLoading, URL[] urls)
allowLoading
- whether to allow plug-in classloaders associated with the new classloader to load Apache Ant classes or resources.urls
- the URLs that define the classpath of the new classloaderpublic static void log(Throwable t)
t
- throwable to log
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.