Browse Source

双检锁

master
XiaXiang 6 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; private SearchResult moreModelList;
public static ActionSearchManager getInstance() { public static ActionSearchManager getInstance() {
synchronized (ActionSearchManager.class) { if (instance == null) {
if (instance == null) { synchronized (ActionSearchManager.class) {
instance = new ActionSearchManager(); if (instance == null) {
instance = new ActionSearchManager();
}
} }
} }
return instance; 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; private SearchResult moreModelList;
public static DocumentSearchManager getInstance() { public static DocumentSearchManager getInstance() {
synchronized (DocumentSearchManager.class) { if (instance == null) {
if (instance == null) { synchronized (DocumentSearchManager.class) {
instance = new DocumentSearchManager(); if (instance == null) {
instance = new DocumentSearchManager();
}
} }
} }
return instance; 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 DS_NAME = "dsname=\"";
private static final String FRM_PREFIX = "k:frm "; private static final String FRM_PREFIX = "k:frm ";
private static final String CPT_PREFIX = "k:cpt "; private static final String CPT_PREFIX = "k:cpt ";
private static FileSearchManager fileSearchManager; private static FileSearchManager instance;
private SearchResult filterModelList; private SearchResult filterModelList;
private SearchResult lessModelList; private SearchResult lessModelList;
private SearchResult moreModelList; private SearchResult moreModelList;
@ -48,12 +48,14 @@ public class FileSearchManager implements AlphaFineSearchProvider {
private boolean isContainFrm = true; private boolean isContainFrm = true;
public static FileSearchManager getInstance() { public static FileSearchManager getInstance() {
synchronized (FileSearchManager.class) { if (instance == null) {
if (fileSearchManager == null) { synchronized (FileSearchManager.class) {
fileSearchManager = new FileSearchManager(); if (instance == null) {
instance = new FileSearchManager();
}
} }
} }
return fileSearchManager; return instance;
} }
public synchronized static void init() { 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() { public static PluginSearchManager getInstance() {
synchronized (PluginSearchManager.class) { if (instance == null) {
if (instance == null) { synchronized (PluginSearchManager.class) {
instance = new PluginSearchManager(); if (instance == null) {
instance = new PluginSearchManager();
}
} }
} }
return instance; 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; private SearchResult modelList;
public static RecentSearchManager getInstance() { public static RecentSearchManager getInstance() {
synchronized (RecentSearchManager.class) { if (instance == null) {
if (instance == null) { synchronized (RecentSearchManager.class) {
instance = new RecentSearchManager(); if (instance == null) {
instance.initWriter(); instance = new RecentSearchManager();
instance.initWriter();
}
} }
} }
return instance; 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; private SearchResult recommendModelList;
public static RecommendSearchManager getInstance() { public static RecommendSearchManager getInstance() {
synchronized (RecentSearchManager.class) { if (instance == null) {
if (instance == null) { synchronized (RecentSearchManager.class) {
instance = new RecommendSearchManager(); if (instance == null) {
instance = new RecommendSearchManager();
}
} }
} }
return instance; return instance;

Loading…
Cancel
Save