Browse Source

双检锁

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

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

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

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

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

10
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() {
if (instance == null) {
synchronized (FileSearchManager.class) { synchronized (FileSearchManager.class) {
if (fileSearchManager == null) { if (instance == null) {
fileSearchManager = new FileSearchManager(); instance = new FileSearchManager();
} }
} }
return fileSearchManager; }
return instance;
} }
public synchronized static void init() { public synchronized static void init() {

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

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

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

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

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

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

Loading…
Cancel
Save