EmulatorManager.setVMKeeper(new ManagedVMKeeper());
// initializing profiles
- ProfileList.initialize();
+ //ProfileList.initialize();
// print system and emulator manager information to log file
// initialize about contents
private String platformName;
// base image information
+ private String imageName;
private String imagePath;
private String imagePathName;
// default, add-on, custom
return platformName;
}
+ public String getImageName() {
+ return imageName;
+ }
+
+ public void setImageName(String imageName) {
+ this.imageName = imageName;
+ }
+
protected void setImagePath(String path) {
imagePath = path;
if (!imagePath.isEmpty()) {
this.data = data;
}
+ public boolean isItemExist(String name) {
+ for (VMItem item : getVmItemList()) {
+ if (item.getName().equals(name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public abstract Architecture getImageArch();
public abstract SKIN_SHAPE getImageSkinShape();
public abstract String getImageBinaryVersion();
public abstract String getExtension();
public abstract String getEmulatorDirPath();
// TODO
- public abstract String getPluginPackageVersion();
+ public abstract EMPlugin getPlugin();
public abstract List<Skin> getSkinList();
public abstract Skin findSkinUsePath(String path);
public class StandardPlatform extends Platform {
// standard base image information
- private String imageName;
private Architecture cpu;
private SKIN_SHAPE skinShape;
private String binaryVersion;
}
private void setValue(StandardPlatformImageValue value) {
- imageName = value.getName();
+ setImageName(value.getName());
// set path, path name, file state
setImagePath(value.getPath());
return binaryVersion;
}
- // TODO
@Override
- public String getPluginPackageVersion() {
- return plugin.getPackageVersion();
+ public EMPlugin getPlugin() {
+ return plugin;
}
@Override
@Override
public VMProperty getDefaultProperty() {
if (defaultProperty == null) {
- defaultProperty = TemplateLoader.loadProperty(imageName, this);
+ defaultProperty = TemplateLoader.loadProperty(getImageName(), this);
if (defaultProperty == null) {
// TODO
}
@Override
public VMTemplate getUITemplate() {
if (vmTemplate == null) {
- vmTemplate = TemplateLoader.loadTemplate(imageName, this);
+ vmTemplate = TemplateLoader.loadTemplate(getImageName(), this);
if (vmTemplate == null) {
// TODO
}
private void makeItemList() {
VMTemplate template = getUITemplate();
if (template == null) {
- EMLogger.getLogger().warning("Fail to find template. Image : " + imageName);
+ EMLogger.getLogger().warning("Fail to find template. Image : " + getImageName());
EMLogger.getLogger().info("Use temp template.");
}
if (f == null) {
f = new CommonItemListFactory();
- EMLogger.getLogger().warning("Fail to load ItemListFactory. Image : " + imageName);
+ EMLogger.getLogger().warning("Fail to load ItemListFactory. Image : " + getImageName());
EMLogger.getLogger().info("Use CommonItemListFactory.");
}
import org.tizen.emulator.manager.platform.Profile;
import org.tizen.emulator.manager.platform.Skin;
import org.tizen.emulator.manager.platform.Version;
+import org.tizen.emulator.manager.plugin.EMPlugin;
import org.tizen.emulator.manager.template.renewal.VMItem;
import org.tizen.emulator.manager.template.renewal.VMTemplate;
import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem;
// set base platform name
setName(value.getName());
setImagePath(value.getImageFilePath());
+ setImageName(getImagePathName());
setImageType(value.getType());
setImageDescription(value.getDescription());
}
return basePlatform.getImageSkinShape();
}
- // TODO
@Override
- public String getPluginPackageVersion() {
- return basePlatform.getPluginPackageVersion();
+ public EMPlugin getPlugin() {
+ return basePlatform.getPlugin();
}
@Override
import java.util.List;
import org.eclipse.swt.SWT;
-import org.tizen.emulator.manager.platform.backup.BaseImage;
+import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.template.renewal.TemplateLoader;
import org.tizen.emulator.manager.template.renewal.VMTemplate;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
}
private static List<ModifyDialogItem> getItemList(VMProperty property) {
- BaseImage baseImage = property.getPropertyValue().getBaseImage();
- if (baseImage == null) {
+ Platform platform = property.getPropertyValue().getPlatform();
+ if (platform == null) {
return getTmpItemList();
}
List<ModifyDialogItem> itemList = new ArrayList<ModifyDialogItem>();
- if (baseImage.getDefaultItemList() != null) {
- itemList.addAll(baseImage.getDefaultItemList());
+ if (platform.getDefaultItemList() != null) {
+ itemList.addAll(platform.getDefaultItemList());
}
- if (baseImage.getAdvancedItemList() != null) {
- itemList.addAll(baseImage.getAdvancedItemList());
+ if (platform.getAdvancedItemList() != null) {
+ itemList.addAll(platform.getAdvancedItemList());
}
return itemList;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.tizen.emulator.manager.platform.Platform;
-import org.tizen.emulator.manager.platform.backup.BaseImage;
-import org.tizen.emulator.manager.platform.backup.Profile;
-import org.tizen.emulator.manager.platform.backup.ProfileList;
+import org.tizen.emulator.manager.platform.StandardPlatform;
import org.tizen.emulator.manager.renewal.resources.ColorKind;
import org.tizen.emulator.manager.renewal.resources.Colors;
import org.tizen.emulator.manager.ui.renewal.MainDialog;
private List<ModifyDialogItem> makeProfileItems(String profileName) {
List<ModifyDialogItem> profileItems = new ArrayList<ModifyDialogItem>();
- Profile profile = ProfileList.getProfile(profileName);
- if (profile == null) {
- return profileItems;
- }
+ for (Platform platform : Platform.getPlatformList()) {
+ if (!platform.getProfile().getName().equals(profileName)) {
+ continue;
+ }
+ if (!(platform instanceof StandardPlatform)) {
+ continue;
+ }
- // Added each baseimage's item-list
- for (BaseImage image : profile.getImageList()) {
- addItems(profileItems, image.getAdvancedItemList());
+ addItems(profileItems, platform.getAdvancedItemList());
}
// add skin item
List<String> cmd = getCommand(property);
- String emulatorPath = property.getPropertyValue().getBaseImage().getPlatform().getEmulatorPath();
+ String emulatorPath = property.getPropertyValue().getPlatform().getEmulatorDirPath();
Process process = launchInternal(property.getPropertyValue().vmsName, emulatorPath, cmd, path);
if (process == null) {
private static List<String> getCommand(VMProperty property)
throws VMLauncherException {
- String emulatorPath = property.getPropertyValue().getBaseImage().getPlatform().getEmulatorPath();
+ String emulatorPath = property.getPropertyValue().getPlatform().getEmulatorDirPath();
String binaryPath = FilePathResources.getEmulatorBinPath(emulatorPath)
+ File.separator + getBinary();
String configPath = LaunchConfig
import org.tizen.emulator.manager.EmulatorManager;
import org.tizen.emulator.manager.EmulatorManager.ManagerModeType;
import org.tizen.emulator.manager.platform.backup.BaseImage;
-import org.tizen.emulator.manager.plugin.BackupEMPlugin;
+import org.tizen.emulator.manager.plugin.EMPlugin;
import org.tizen.emulator.manager.plugin.PluginStringResources;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
private VMProperty(Path propertyFile) {
this.propertyFile = propertyFile;
refresh();
+ initVMWorker();
}
private VMProperty(Path propertyFile, VMPropertyValue value) {
this.propertyFile = propertyFile;
setPropertyValue(value);
+ initVMWorker();
}
public VMProperty modify(VMPropertyValue value) {
// FIXME: called from Profile class
public void initVMWorker() {
- if (getPropertyValue().getBaseImage() == null) {
+ if (getPropertyValue().getPlatform() == null) {
return;
}
- BackupEMPlugin plugin = getPropertyValue().getBaseImage().getPlatform().getPlugin();
+ EMPlugin plugin = getPropertyValue().getPlatform().getPlugin();
if (plugin != null) {
worker = (VMWorkerCommon)plugin.newInstance(PluginStringResources.VMWorker);
* This is used for creating new emulator.
* @param image base image of emulator
*/
+ @Deprecated
public static VMPropertyValue createValueForNewVM(BaseImage image) {
return createValueForNewVM(image, image.getDefaultProperty());
}
* @param image base image of emulator
* @param template default property of emulator
*/
+ @Deprecated
public static VMPropertyValue createValueForNewVM(BaseImage image, VMProperty property) {
VMPropertyValue newValue = property.getPropertyValue().clone();
newValue.template = property;
settingSkin();
}
+ @Deprecated
public BaseImage getBaseImage() {
return baseImage;
}
+ @Deprecated
public void setBaseImage(BaseImage image) {
this.baseImage = image;
}
public String getImageName() {
if (platform != null) {
- return platform.getName();
+ return platform.getImageName();
} else {
return baseImage.getName();
}
// find device-template sub item.
List<VMItem> deviceTemplateItems = null;
- for (VMItem vmItem : baseImage.getVmItemList()) {
+ for (VMItem vmItem : platform.getVmItemList()) {
if (vmItem.getName().equals(ItemName.DEVICE_TEMPLATE)) {
deviceTemplateItems = vmItem.getSubItems();
}
}
if (deviceTemplateItems == null) {
// if device-template sub items not exist..?
- deviceTemplateItems = baseImage.getVmItemList();
+ deviceTemplateItems = platform.getVmItemList();
}
// Set addtional VMOptions
import org.tizen.emulator.manager.devices.DeviceTemplateList;
import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.platform.StandardPlatform;
-import org.tizen.emulator.manager.platform.backup.BaseImage;
-import org.tizen.emulator.manager.platform.backup.Profile;
-import org.tizen.emulator.manager.platform.backup.ProfileList;
import org.tizen.emulator.manager.platform.custom.CustomPlatformImageValue;
import org.tizen.emulator.manager.resources.StringResources;
-import org.tizen.emulator.manager.vms.VMProperty.FSImageType;
import org.tizen.emulator.manager.vms.xml.EmulatorConfiguration;
import org.tizen.emulator.manager.vms.xml.OptionType;
import org.tizen.emulator.manager.vms.xml.SubOptionType;
VMPropertyValueCreator creator = new VMPropertyValueCreator(configuration);
VMPropertyValue value = new VMPropertyValue(property);
creator.settingConfigure(value);
- //creator.settingBaseImage(value);
creator.settingPlatform(value);
return value;
}
value.advancedVMOptionList = getAdvancedOptionList();
}
- private void settingBaseImage(VMPropertyValue value) {
- if (configuration == null) {
- return;
- }
-
- // XXX Remove null check. Image should not be null..
- // But now, image is null when creating default property.
- BaseImage image = findBaseImage();
- if (image != null) {
- value.settingBaseImage(image);
- }
- }
-
private void settingPlatform(VMPropertyValue value) {
if (configuration == null) {
return;
return configuration.getBaseInformation().getPlatform();
}
- private String getBaseImageName() {
- if(configuration == null
- || configuration.getBaseInformation() == null || configuration.getBaseInformation().getDiskImage() == null) {
- return ""; //$NON-NLS-1$
- }
-
- return configuration.getBaseInformation().getDiskImage().getBase();
- }
-
private String getDeviceTemplatePath() {
if (configuration == null
|| configuration.getBaseInformation() == null
return configuration.getBaseInformation().getDeviceTemplate().getVersion();
}
- private FSImageType getBaseImageType() {
- if(isDiskImageNone()) {
- return null;
- }
-
- return FSImageType.standard.toString().equals(configuration.getBaseInformation().getDiskImage().getType()) ?
- FSImageType.standard : FSImageType.custom;
- }
-
- private String getBaseImageVersion() {
- if(isDiskImageNone()) {
- return ""; //$NON-NLS-1$
- }
-
- return configuration.getBaseInformation().getDiskImage().getVersion();
- }
-
- private String getBaseImageProfile() {
- if(isDiskImageNone()) {
- return ""; //$NON-NLS-1$
- }
-
- return configuration.getBaseInformation().getDiskImage().getProfile();
- }
-
- private String getBaseImagePlatform() {
- if (configuration != null && configuration.getBaseInformation() != null
- && configuration.getBaseInformation().getPlatform() != null) {
- return configuration.getBaseInformation().getPlatform();
- } else {
- String version = getBaseImageVersion();
- String profile = getBaseImageProfile();
- if (version == null || profile == null) {
- return ""; //$NON-NLS-1$
- }
- return profile + "-" + version; //$NON-NLS-1$
- }
- }
-
-
-
private String getBaseImagePath() {
if (isBaseDiskImageNone()) {
return ""; //$NON-NLS-1$
return configuration.getBaseInformation().getDiskImage().getSwapDiskImage().getValue();
}
-
-
private String getFileSharingPath() {
if (configuration == null
|| configuration.getUsability() == null
|| configuration.getBaseInformation() == null
|| configuration.getBaseInformation().getDeviceTemplate() == null);
}
-
-
- private BaseImage findBaseImage() {
- Profile profile = ProfileList.getProfile(getBaseImageProfile());
- if (profile == null) {
- return null;
- }
- return profile.findBaseImage(getBaseImageType(),
- getBaseImagePath(),
- getBaseImageName(),
- getBaseImagePlatform());
- }
}
}
// Do argument validation.
- List<IOption> optList = property.getPropertyValue().getBaseImage().getOptionList();
+ List<IOption> optList = property.getPropertyValue().getPlatform().getOptionList();
if (optList == null) {
throw new VMLauncherException(Messages.getString("VMWorkerCommon.LaunchError.1")); //$NON-NLS-1$
}
import java.util.List;
import java.util.Map;
-import org.tizen.emulator.manager.platform.backup.ProfileList;
+import org.tizen.emulator.manager.platform.Preparer;
import org.tizen.emulator.manager.resources.FilePathResources;
public final class FileWatcher implements Runnable {
@Override
public void run() {
try {
- Object obj = ProfileList.getProfileList();
+ Object obj = Preparer.getObject();
synchronized (obj) {
// Wait until all profiles are ready
- if (!ProfileList.initialized) {
+ if (!Preparer.initialized) {
obj.wait();
}
}
@Override
public void getLaunchArgument(LaunchConfig config, VMProperty property) {
- if (property.getPropertyValue().getBaseImage() != null) {
+ if (property.getPropertyValue().getPlatform() != null) {
config.addVariable(OPTION_KEY.VAR_IMAGE_VER, property.getPropertyValue().getImageBinaryVersion());
}
config.addVariableWithSpace(OPTION_KEY.VAR_DRIVE, "file=${vms_path}" + File.separator + "${vm_name}" //$NON-NLS-1$ //$NON-NLS-2$
config.addQemuOption("#-device virtconsole,chardev=virtcon1"); //$NON-NLS-1$
}
- String emulatorPath = property.getPropertyValue().getBaseImage().getPlatform().getEmulatorPath();
+ String emulatorPath = property.getPropertyValue().getPlatform().getEmulatorDirPath();
// bios
config.addVariableWithSpace(OPTION_KEY.VAR_BIOS_PATH, FilePathResources.getEmulatorBiosPath(emulatorPath));
config.addQemuOption("-L", varForm(OPTION_KEY.VAR_BIOS_PATH)); //$NON-NLS-1$
}
boolean useDirectRendering;
- if (property.getPropertyValue().getBaseImage().isItemExist("displayMode")) {
+ if (property.getPropertyValue().getPlatform().isItemExist("displayMode")) {
if (checkOnOrEmpty(property.getPropertyValue().getAdvancedOptionSubValue(
"displayMode", "qtEnable"))) { //$NON-NLS-1$ //$NON-NLS-2$
useDirectRendering = true;
public static void createLaunchConfig(VMProperty property)
throws VMWorkerException {
// 1. Get option list which is matched with base-image.
- List<IOption> optList = property.getPropertyValue().getBaseImage().getOptionList();
+ List<IOption> optList = property.getPropertyValue().getPlatform().getOptionList();
if (optList == null) {
throw new VMWorkerException("Failed to get option list."); //$NON-NLS-1$
}