Package org.eclipse.m2m.atl.core.service

# Class CoreService

java.lang.Object
org.eclipse.m2m.atl.core.service.CoreService

public final class CoreService extends Object
The CoreService utility class provides a way to use extension points in order to retrieve the needed extensions:

- `ILauncher`
- `IInjector`
- `IExtractor`
- `ModelFactory`

For each extension class type, a method returns the list of all detected extensions names.

## Method Summary

Modifier and Type
Method
Description
`static ModelFactory`
`createModelFactory(String name)`
Deprecated.
Use `getModelFactory(String)` instead.
`static String`
`getCompatibleLauncherName(String name)`
Converts the old Regular-VM name.
`static IExtractor`
`getExtractor(String name)`
Returns the extractors matching the given name.
`static String[]`
`getExtractorsNames()`
Returns the available extractors names.
`static IInjector`
`getInjector(String name)`
Returns the injector matching the given name.
`static String[]`
`getInjectorsNames()`
Returns the available injectors names.
`static ILauncher`
`getLauncher(String name)`
Returns the launcher matching the given name.
`static Map<String,String>`
`getLauncherOptions(String launcherName)`
Returns the options Map (id, description) for the given launcher.
`static Map<String,String>`
`getLauncherOptions(String launcherName, String mode)`
Returns the options Map (id, description) for the given launcher, in the given mode.
`static String[]`
`getLaunchersNames()`
Returns the available launchers names.
`static String[]`
`getLaunchersNames(String mode)`
Returns the available launchers names.
`static String[]`
`getModelFactoriesNames()`
Returns the available model factories names.
`static ModelFactory`
`getModelFactory(String name)`
Creates a new `ModelFactory` with the given name.
`static boolean`
`isEclipseRunning()`
Tests if eclipse is running.
`static void`
`registerExtractor(String extractorName, Class<? extends IExtractor> extractorClass)`
Registers an extractor in the extractorRegistry.
`static void`
`registerExtractor(String name, IExtractor extractor)`
Deprecated.
Use `registerExtractor(String, Class)` instead.
`static void`
`registerFactory(String name, Class<? extends ModelFactory> factoryClass)`
Registers a factory in the factoryRegistry.
`static void`
`registerInjector(String injectorName, Class<? extends IInjector> injectorClass)`
Registers an injector in the injectorRegistry.
`static void`
`registerInjector(String name, IInjector injector)`
Deprecated.
Use `registerInjector(String, Class)` instead.
`static void`
`registerLauncher(String launcherName, Class<? extends ILauncher> launcherClass)`
Registers a launcher in the launcherRegistry.
`static void`
`registerLauncher(ILauncher launcher)`
Deprecated.
Use `registerLauncher(String, Class)` instead.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### registerLauncher

public static void registerLauncher(ILauncher launcher)
Deprecated.
Use `registerLauncher(String, Class)` instead.
Registers a launcher in the launcherRegistry.

Parameters:
  `launcher` - the launcher

### registerLauncher

public static void registerLauncher(String launcherName, Class<? extends ILauncher> launcherClass)
Registers a launcher in the launcherRegistry.

Parameters:
  `launcherName` - the launcher name
  `launcherClass` - the launcher class

### registerInjector

public static void registerInjector(String name, IInjector injector)
Deprecated.
Use `registerInjector(String, Class)` instead.
Registers an injector in the injectorRegistry.

Parameters:
  `name` - the injector name
  `injector` - the injector

### registerInjector

public static void registerInjector(String injectorName, Class<? extends IInjector> injectorClass)
Registers an injector in the injectorRegistry.

Parameters:
  `injectorName` - the injector name
  `injectorClass` - the injector class

### registerExtractor

public static void registerExtractor(String name, IExtractor extractor)
Deprecated.
Use `registerExtractor(String, Class)` instead.
Registers an extractor in the extractorRegistry.

Parameters:
  `name` - the extractor name
  `extractor` - the extractor

### registerExtractor

public static void registerExtractor(String extractorName, Class<? extends IExtractor> extractorClass)
Registers an extractor in the extractorRegistry.

Parameters:
  `extractorName` - the extractor name
  `extractorClass` - the extractor class

### registerFactory

public static void registerFactory(String name, Class<? extends ModelFactory> factoryClass)
Registers a factory in the factoryRegistry.

Parameters:
  `name` - the factory name
  `factoryClass` - the factory class

### createModelFactory

public static ModelFactory createModelFactory(String name) throws ATLCoreException
Deprecated.
Use `getModelFactory(String)` instead.
Creates a new `ModelFactory` with the given name.

Parameters:
  `name` - the factory name
Returns:
  the new ModelFactory
Throws:
  `ATLCoreException`

### getModelFactory

public static ModelFactory getModelFactory(String name) throws ATLCoreException
Creates a new `ModelFactory` with the given name.

Parameters:
  `name` - the factory name
Returns:
  the new ModelFactory
Throws:
  `ATLCoreException`

### getLauncher

public static ILauncher getLauncher(String name) throws ATLCoreException
Returns the launcher matching the given name.

Parameters:
  `name` - the launcher name
Returns:
  the launcher matching the given name
Throws:
  `ATLCoreException`

### getInjector

public static IInjector getInjector(String name) throws ATLCoreException
Returns the injector matching the given name.

Parameters:
  `name` - the injector name
Returns:
  the injector matching the given name
Throws:
  `ATLCoreException`

### getExtractor

public static IExtractor getExtractor(String name) throws ATLCoreException
Returns the extractors matching the given name.

Parameters:
  `name` - the extractors name
Returns:
  the extractors matching the given name
Throws:
  `ATLCoreException`

### getLaunchersNames

public static String[] getLaunchersNames()
Returns the available launchers names.

Returns:
  the available launchers names

### getLaunchersNames

public static String[] getLaunchersNames(String mode)
Returns the available launchers names.

Parameters:
  `mode` - the launch mode restriction
Returns:
  the available launchers names

### getInjectorsNames

public static String[] getInjectorsNames()
Returns the available injectors names.

Returns:
  the available injectors names

### getExtractorsNames

public static String[] getExtractorsNames()
Returns the available extractors names.

Returns:
  the available extractors names

### getModelFactoriesNames

public static String[] getModelFactoriesNames()
Returns the available model factories names.

Returns:
  the available model factories names

### getLauncherOptions

public static Map<String,String> getLauncherOptions(String launcherName)
Returns the options Map (id, description) for the given launcher.

Parameters:
  `launcherName` - the launcher name
Returns:
  the options Map

### getLauncherOptions

public static Map<String,String> getLauncherOptions(String launcherName, String mode)
Returns the options Map (id, description) for the given launcher, in the given mode.

Parameters:
  `launcherName` - the launcher name
  `mode` - the launch mode
Returns:
  the options Map

### getCompatibleLauncherName

public static String getCompatibleLauncherName(String name)
Converts the old Regular-VM name.

Parameters:
  `name` - the launcher name
Returns:
  the converted name

### isEclipseRunning

public static boolean isEclipseRunning()
Tests if eclipse is running.

Returns:
  `true` if eclipse is running