Class AntCorePlugin
- java.lang.Object
-
- org.eclipse.core.runtime.Plugin
-
- org.eclipse.ant.core.AntCorePlugin
-
- All Implemented Interfaces:
BundleActivator
public class AntCorePlugin extends Plugin
The plug-in runtime class for the Ant Core plug-in. Clients may not instantiate or subclass this class.- Restriction:
- This class is not intended to be subclassed by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static StringANT_BUILDFILE_CONTENT_TYPESimple identifier constant (value"org.eclipse.ant.core.antBuildFile") for the content type of an Ant BuildFilestatic StringCLASSSimple identifier constant (value"class") of a tag that appears in Ant extensions.static StringECLIPSE_PROGRESS_MONITORKey to access theIProgressMonitorreference.static StringECLIPSE_RUNTIMESimple identifier constant (value"eclipseRuntime") of a tag that appears in Ant extensions.static intERROR_LIBRARY_NOT_SPECIFIEDStatus code indicating an error occurred as a library was not specifiedstatic intERROR_MALFORMED_URLStatus code indicating an error occurred due to a malformed URL.static intERROR_RUNNING_BUILDStatus code indicating an error occurred running a build.static StringHEADLESSSimple identifier constant (value"headless") of a tag that appears in Ant extensions.static intINTERNAL_ERRORStatus code indicating an unexpected internal error.static StringLIBRARYSimple identifier constant (value"library") of a tag that appears in Ant extensions.static StringNAMESimple identifier constant (value"name") of a tag that appears in Ant extensions.static StringPI_ANTCOREUnique identifier constant (value"org.eclipse.ant.core") for the Ant Core plug-in.static StringPT_EXTRA_CLASSPATHSimple identifier constant (value"extraClasspathEntries") for the extra classpath entries extension point.static StringPT_PROPERTIESSimple identifier constant (value"antProperties") for the Ant properties extension point.static StringPT_TASKSSimple identifier constant (value"antTasks") for the Ant tasks extension point.static StringPT_TYPESSimple identifier constant (value"antTypes") for the Ant types extension point.static StringURISimple identifier constant (value"uri") of a tag that appears in Ant extensions.static StringVALUESimple identifier constant (value"value") of a tag that appears in Ant extensions.-
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
-
-
Constructor Summary
Constructors Constructor Description AntCorePlugin()Constructs an instance of this plug-in runtime class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassLoadergetNewClassLoader()Returns a new class loader to use when executing Ant builds.ClassLoadergetNewClassLoader(boolean allowLoading)Returns a new class loader to use when executing Ant builds or other applications such as parsing or code proposal determination.URLClassLoadergetNewClassLoader(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.URLClassLoadergetNewClassLoader(URL[] urls)Returns a new class loader to use when executing Ant builds.static AntCorePlugingetPlugin()Returns this plug-in instance.AntCorePreferencesgetPreferences()Returns an object representing this plug-in's preferences.static voidlog(Throwable t)Logs the specified throwable with this plug-in's log.voidsetRunningHeadless(boolean headless)Set this plug-in's preferences for running headless based on the headless parameter.voidstart(BundleContext context)Starts up this plug-in.voidstop(BundleContext context)Stops this plug-in.-
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
-
-
-
-
Field Detail
-
INTERNAL_ERROR
public static final int INTERNAL_ERROR
Status code indicating an unexpected internal error.- Since:
- 2.1
- See Also:
- Constant Field Values
-
PI_ANTCORE
public static final String PI_ANTCORE
Unique identifier constant (value"org.eclipse.ant.core") for the Ant Core plug-in.- See Also:
- Constant Field Values
-
PT_TASKS
public static final String PT_TASKS
Simple identifier constant (value"antTasks") for the Ant tasks extension point.- See Also:
- Constant Field Values
-
PT_EXTRA_CLASSPATH
public static final String PT_EXTRA_CLASSPATH
Simple identifier constant (value"extraClasspathEntries") for the extra classpath entries extension point.- See Also:
- Constant Field Values
-
PT_TYPES
public static final String PT_TYPES
Simple identifier constant (value"antTypes") for the Ant types extension point.- See Also:
- Constant Field Values
-
PT_PROPERTIES
public static final String PT_PROPERTIES
Simple identifier constant (value"antProperties") for the Ant properties extension point.- Since:
- 3.0
- See Also:
- Constant Field Values
-
ANT_BUILDFILE_CONTENT_TYPE
public static final String ANT_BUILDFILE_CONTENT_TYPE
Simple identifier constant (value"org.eclipse.ant.core.antBuildFile") for the content type of an Ant BuildFile- Since:
- 3.0
- See Also:
- Constant Field Values
-
CLASS
public static final String CLASS
Simple identifier constant (value"class") of a tag that appears in Ant extensions.- See Also:
- Constant Field Values
-
NAME
public static final String NAME
Simple identifier constant (value"name") of a tag that appears in Ant extensions.- See Also:
- Constant Field Values
-
LIBRARY
public static final String LIBRARY
Simple identifier constant (value"library") of a tag that appears in Ant extensions.- See Also:
- Constant Field Values
-
HEADLESS
public static final String HEADLESS
Simple identifier constant (value"headless") of a tag that appears in Ant extensions.- Since:
- 2.1
- See Also:
- Constant Field Values
-
ECLIPSE_RUNTIME
public static final String ECLIPSE_RUNTIME
Simple identifier constant (value"eclipseRuntime") of a tag that appears in Ant extensions.- Since:
- 3.0
- See Also:
- Constant Field Values
-
URI
public static final String URI
Simple identifier constant (value"uri") of a tag that appears in Ant extensions.- Since:
- 3.2
- See Also:
- Constant Field Values
-
VALUE
public static final String VALUE
Simple identifier constant (value"value") of a tag that appears in Ant extensions.- Since:
- 3.0
- See Also:
- Constant Field Values
-
ECLIPSE_PROGRESS_MONITOR
public static final String ECLIPSE_PROGRESS_MONITOR
Key to access theIProgressMonitorreference. When a progress monitor is passed to theAntRunner.run(IProgressMonitor)method, the object is available as a reference for the current Ant project.- See Also:
- Constant Field Values
-
ERROR_RUNNING_BUILD
public static final int ERROR_RUNNING_BUILD
Status code indicating an error occurred running a build.- Since:
- 2.1
- See Also:
- Constant Field Values
-
ERROR_MALFORMED_URL
public static final int ERROR_MALFORMED_URL
Status code indicating an error occurred due to a malformed URL.- Since:
- 2.1
- See Also:
- Constant Field Values
-
ERROR_LIBRARY_NOT_SPECIFIED
public static final int ERROR_LIBRARY_NOT_SPECIFIED
Status code indicating an error occurred as a library was not specified- Since:
- 2.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AntCorePlugin
public AntCorePlugin()
Constructs an instance of this plug-in runtime class.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.
- Since:
- 3.1
-
-
Method Detail
-
stop
public void stop(BundleContext context) throws Exception
Description copied from class:PluginStops this plug-in.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
Clients must never explicitly call this method.Plugin.start(BundleContext)may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.- Specified by:
stopin interfaceBundleActivator- Overrides:
stopin classPlugin- Parameters:
context- the bundle context for this plug-in- Throws:
Exception- if this method fails to shut down this plug-in- Since:
- 3.1
-
start
public void start(BundleContext context) throws Exception
Description copied from class:PluginStarts up this plug-in.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
Clients must never explicitly call this method.Plugin.stop(BundleContext)may be called from separate threads, but the OSGi framework ensures that both methods will not be called simultaneously.- Specified by:
startin interfaceBundleActivator- Overrides:
startin classPlugin- Parameters:
context- the bundle context for this plug-in- Throws:
Exception- if this plug-in did not start up properly- Since:
- 3.1
-
getPreferences
public AntCorePreferences getPreferences()
Returns an object representing this plug-in's preferences.- Returns:
- the Ant core object representing the preferences for this plug-in.
-
setRunningHeadless
public void setRunningHeadless(boolean headless)
Set this plug-in's preferences for running headless based on the headless parameter. This method is public for testing purposes only. It should not be called outside of the Ant integration framework.- Parameters:
headless- Whether or not to mark that the plug-in is running headless or not
-
getPlugin
public static AntCorePlugin getPlugin()
Returns this plug-in instance.- Returns:
- the single instance of this plug-in runtime class
-
getNewClassLoader
public ClassLoader getNewClassLoader()
Returns a new class loader to use when executing Ant builds.- Returns:
- the new class loader
-
getNewClassLoader
public URLClassLoader getNewClassLoader(URL[] urls)
Returns a new class loader to use when executing Ant builds.- Parameters:
urls- the URLs that define the classpath of the new classloader- Returns:
- the new class loader
- Since:
- 3.1
-
getNewClassLoader
public 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.- Parameters:
allowLoading- whether to allow plug-in classloaders associated with the new classloader to load Apache Ant classes or resources.- Returns:
- the new class loader
-
getNewClassLoader
public 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.- Parameters:
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 classloader- Returns:
- the new class loader
- Since:
- 3.1
-
log
public static void log(Throwable t)
Logs the specified throwable with this plug-in's log.- Parameters:
t- throwable to log- Since:
- 2.1
-
-