Commit ed1d63e3 by pye52

所有设备指令执行流程修改,保证指令在执行过程中各缓存不会被更改

parent 29fde031
......@@ -51,18 +51,14 @@ public class LogCommandHandler extends CommandHandler {
private static LogCommandHandler instance;
public static LogCommandHandler getInstance(Command command, Gson gson, String deviceSN, CommandProgressCallback callback) {
if (instance == null) {
synchronized (LogCommandHandler.class) {
public static synchronized LogCommandHandler getInstance(Command command, Gson gson, String deviceSN, CommandProgressCallback callback) {
if (instance == null) {
instance = new LogCommandHandler(command, gson, deviceSN, callback);
} else {
if (!instance.start) {
instance.init(command, gson, deviceSN, callback);
}
}
} else {
instance.init(command, gson, deviceSN, callback);
}
return instance;
}
......
......@@ -53,18 +53,14 @@ public class UpdateCommandHandler extends CommandHandler {
private static UpdateCommandHandler instance;
public static UpdateCommandHandler getInstance(Command command, Gson gson, CommandProgressCallback callback) {
if (instance == null) {
synchronized (UpdateCommandHandler.class) {
public static synchronized UpdateCommandHandler getInstance(Command command, Gson gson, CommandProgressCallback callback) {
if (instance == null) {
instance = new UpdateCommandHandler(command, gson, callback);
} else {
if (!instance.start) {
instance.init(command, gson, callback);
}
}
} else {
instance.init(command, gson, callback);
}
return instance;
}
......
......@@ -19,18 +19,14 @@ public class WifiConfigCommandHandler extends CommandHandler {
private volatile boolean start = false;
private static WifiConfigCommandHandler instance;
public static WifiConfigCommandHandler getInstance(Command command, Gson gson, CommandProgressCallback callback) {
if (instance == null) {
synchronized (WifiConfigCommandHandler.class) {
public static synchronized WifiConfigCommandHandler getInstance(Command command, Gson gson, CommandProgressCallback callback) {
if (instance == null) {
instance = new WifiConfigCommandHandler(command, gson, callback);
} else {
if (!instance.start) {
instance.init(command, gson, callback);
}
}
} else {
instance.init(command, gson, callback);
}
return instance;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment