Browse Source

双检锁

master
XiaXiang 7 years ago
parent
commit
8ec0890b78
  1. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java
  2. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  3. 12
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  4. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java
  5. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  6. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java

@ -28,9 +28,11 @@ public class ActionSearchManager implements AlphaFineSearchProvider {
private SearchResult moreModelList;
public static ActionSearchManager getInstance() {
synchronized (ActionSearchManager.class) {
if (instance == null) {
instance = new ActionSearchManager();
if (instance == null) {
synchronized (ActionSearchManager.class) {
if (instance == null) {
instance = new ActionSearchManager();
}
}
}
return instance;

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -25,9 +25,11 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
private SearchResult moreModelList;
public static DocumentSearchManager getInstance() {
synchronized (DocumentSearchManager.class) {
if (instance == null) {
instance = new DocumentSearchManager();
if (instance == null) {
synchronized (DocumentSearchManager.class) {
if (instance == null) {
instance = new DocumentSearchManager();
}
}
}
return instance;

12
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -35,7 +35,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
private static final String DS_NAME = "dsname=\"";
private static final String FRM_PREFIX = "k:frm ";
private static final String CPT_PREFIX = "k:cpt ";
private static FileSearchManager fileSearchManager;
private static FileSearchManager instance;
private SearchResult filterModelList;
private SearchResult lessModelList;
private SearchResult moreModelList;
@ -48,12 +48,14 @@ public class FileSearchManager implements AlphaFineSearchProvider {
private boolean isContainFrm = true;
public static FileSearchManager getInstance() {
synchronized (FileSearchManager.class) {
if (fileSearchManager == null) {
fileSearchManager = new FileSearchManager();
if (instance == null) {
synchronized (FileSearchManager.class) {
if (instance == null) {
instance = new FileSearchManager();
}
}
}
return fileSearchManager;
return instance;
}
public synchronized static void init() {

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -32,9 +32,11 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
public static PluginSearchManager getInstance() {
synchronized (PluginSearchManager.class) {
if (instance == null) {
instance = new PluginSearchManager();
if (instance == null) {
synchronized (PluginSearchManager.class) {
if (instance == null) {
instance = new PluginSearchManager();
}
}
}
return instance;

10
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -60,10 +60,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
private SearchResult modelList;
public static RecentSearchManager getInstance() {
synchronized (RecentSearchManager.class) {
if (instance == null) {
instance = new RecentSearchManager();
instance.initWriter();
if (instance == null) {
synchronized (RecentSearchManager.class) {
if (instance == null) {
instance = new RecentSearchManager();
instance.initWriter();
}
}
}
return instance;

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -31,9 +31,11 @@ public class RecommendSearchManager implements AlphaFineSearchProvider {
private SearchResult recommendModelList;
public static RecommendSearchManager getInstance() {
synchronized (RecentSearchManager.class) {
if (instance == null) {
instance = new RecommendSearchManager();
if (instance == null) {
synchronized (RecentSearchManager.class) {
if (instance == null) {
instance = new RecommendSearchManager();
}
}
}
return instance;

Loading…
Cancel
Save