String projectName = config.getAttribute(CONFIG_ATTR_PROJECT_NAME, "");
String serialNum = config.getAttribute(CONFIG_ATTR_DEVICE_SERIAL_NO, "");
-
if (getContext(projectName, serialNum) != null) {
+ logger.debug("launch already - project: {}, device serial: {}", projectName, serialNum);
launch.setAttribute(LAUNCH_ATTR_KEY_IS_LAUNCHING, LAUNCH_ATTR_VALUE_LAUNCHING_ALREADY);
continue;
} else {
+ logger.debug("Added - project: {}, device serial: {}", projectName, serialNum);
addContext(projectName, serialNum);
}
} catch (CoreException e) {
@Override
public void launchesRemoved(ILaunch[] launches) {
- for (ILaunch launch : launches) {
- try {
- String projectName = launch.getLaunchConfiguration().getAttribute(CONFIG_ATTR_PROJECT_NAME, "");
- String deviceSerialNum = launch.getLaunchConfiguration().getAttribute(CONFIG_ATTR_DEVICE_SERIAL_NO, "");
-
- LaunchContext context = getContext(projectName, deviceSerialNum);
- contexts.remove(context);
- } catch (CoreException e) {
- //TODO: need to consider handle exception.
- logger.error(e.getMessage(),e);
- }
- }
+ removeLaunches(launches);
}
@Override
public void launchesTerminated(ILaunch[] launches) {
- //TODO: need to consider this.
+ removeLaunches(launches);
+ }
+
+ public void removeLaunches(ILaunch[] launches) {
for (ILaunch launch : launches) {
try {
String projectName = launch.getLaunchConfiguration().getAttribute(CONFIG_ATTR_PROJECT_NAME, "");
LaunchContext context = getContext(projectName, deviceSerialNum);
contexts.remove(context);
+ logger.debug("removed - project: {}, device serial: {}", projectName, deviceSerialNum);
} catch (CoreException e) {
//TODO: need to consider handle exception.
logger.error(e.getMessage(),e);