public class RuntimePlatformRegistry extends Object
RuntimePlatforms.| Constructor and Description |
|---|
RuntimePlatformRegistry()
Constructs a new instance of the registry and initializes its
platformToRuntime. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRuntimePlatforms()
Unregisters all the
RuntimePlatforms from this registry. |
Collection<com.xatkit.platform.PlatformDefinition> |
getLoadedPlatformDefinitions()
Returns a
Collection containing all the loaded PlatformDefinitions. |
com.xatkit.platform.PlatformDefinition |
getPlatformDefinition(String platformName) |
RuntimePlatform |
getRuntimePlatform(com.xatkit.platform.PlatformDefinition platformDefinition)
Returns the
RuntimePlatform associated to the provided platformDefinition. |
RuntimePlatform |
getRuntimePlatform(String platformName)
Returns the
RuntimePlatform associated to the provided platformName. |
Collection<RuntimePlatform> |
getRuntimePlatforms()
Returns all the
RuntimePlatforms stored in this registry. |
void |
registerLoadedPlatformDefinition(com.xatkit.platform.PlatformDefinition platformDefinition)
Registeres the provided
platformDefinition using its name. |
void |
registerRuntimePlatform(RuntimePlatform platform)
Registers the provided
platform using its name. |
void |
registerRuntimePlatform(String platformName,
RuntimePlatform platform)
Registers the provided
platform with the provided name. |
void |
unregisterRuntimePlatform(RuntimePlatform platform)
Unregisters the provided
platform. |
public RuntimePlatformRegistry()
platformToRuntime.public void registerLoadedPlatformDefinition(com.xatkit.platform.PlatformDefinition platformDefinition)
platformDefinition using its name.
Registered PlatformDefinitions can be accessed using getLoadedPlatformDefinitions(). Note that a
registered PlatformDefinition does not imply that the corresponding RuntimePlatform has been
loaded.
platformDefinition - the PlatformDefinition to registergetLoadedPlatformDefinitions()public Collection<com.xatkit.platform.PlatformDefinition> getLoadedPlatformDefinitions()
Collection containing all the loaded PlatformDefinitions.Collection containing all the loaded PlatformDefinitionspublic void registerRuntimePlatform(RuntimePlatform platform)
platform using its name.platform - the RuntimePlatform to registerregisterRuntimePlatform(String, RuntimePlatform)public void registerRuntimePlatform(String platformName, RuntimePlatform platform)
platform with the provided name.
This method is used to bind abstract platforms to their concrete implementation. In this case the provided
platformName is typically the name of the abstract platform, and the concrete RuntimePlatform
is the implementation loaded from the Xatkit configuration.
platformName - the name to use to register the RuntimePlatformplatform - the RuntimePlatform to registerpublic void unregisterRuntimePlatform(RuntimePlatform platform)
platform.platform - the RuntimePlatform to unregisterpublic void clearRuntimePlatforms()
RuntimePlatforms from this registry.public com.xatkit.platform.PlatformDefinition getPlatformDefinition(String platformName)
public RuntimePlatform getRuntimePlatform(String platformName)
RuntimePlatform associated to the provided platformName.
RuntimePlatform are registered using the RuntimePlatform.getName() method.
platformName - the name of the RuntimePlatform to retrieveRuntimePlatform associated to the provided platformNamepublic RuntimePlatform getRuntimePlatform(com.xatkit.platform.PlatformDefinition platformDefinition)
RuntimePlatform associated to the provided platformDefinition.
The provided PlatformDefinition should follow xatkit's naming conventions, and provide a
PlatformDefinition.getName()
method that returns the name of the concrete RuntimePlatform class to retrieve.
platformDefinition - the PlatformDefinition representing the RuntimePlatform to retrieveRuntimePlatform associated to the provided platformDefinitionpublic Collection<RuntimePlatform> getRuntimePlatforms()
RuntimePlatforms stored in this registry.RuntimePlatforms stored in this registryCopyright © 2020 SOM Research Lab. All rights reserved.