|
|
|
@ -2,7 +2,6 @@ package com.fr.nx.app.designer.transform;
|
|
|
|
|
|
|
|
|
|
import com.fr.design.utils.concurrent.ThreadFactoryBuilder; |
|
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
|
import com.fr.plugin.context.PluginContexts; |
|
|
|
|
import com.fr.nx.app.designer.toolbar.TransformResultInfo; |
|
|
|
|
import com.fr.nx.app.designer.utils.CompileTransformUtil; |
|
|
|
|
|
|
|
|
@ -10,6 +9,7 @@ import java.util.List;
|
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Created by kerry on 2019-12-10 |
|
|
|
@ -21,7 +21,7 @@ public class BatchTransformer {
|
|
|
|
|
private static final int MAXPOOLSIZE = 5; |
|
|
|
|
private static final String THREAD_NAME_TEMPLATE = "batchtransform-thread-%s"; |
|
|
|
|
private ExecutorService threadPoolExecutor = |
|
|
|
|
PluginContexts.currentContext().newFixedThreadPool(MAXPOOLSIZE, |
|
|
|
|
Executors.newFixedThreadPool(MAXPOOLSIZE, |
|
|
|
|
new ThreadFactoryBuilder().setNameFormat(THREAD_NAME_TEMPLATE).build()); |
|
|
|
|
|
|
|
|
|
public BatchTransformer(UpdateCallBack updateCallBack) { |
|
|
|
@ -59,7 +59,7 @@ public class BatchTransformer {
|
|
|
|
|
if (threadPoolExecutor != null) { |
|
|
|
|
threadPoolExecutor.shutdownNow(); |
|
|
|
|
} |
|
|
|
|
threadPoolExecutor = PluginContexts.currentContext().newFixedThreadPool(MAXPOOLSIZE, |
|
|
|
|
threadPoolExecutor = Executors.newFixedThreadPool(MAXPOOLSIZE, |
|
|
|
|
new ThreadFactoryBuilder().setNameFormat(THREAD_NAME_TEMPLATE).build()); |
|
|
|
|
updateCallBack.shutDown(); |
|
|
|
|
} |
|
|
|
|