Thanks Daniel.
Initializing JLanguageTool one by one will make the process fast.
Because JLanguageTool is not thread safe, it need to initialize a new JLanguageTool object in each thread. And thread will not wait for another thread. So the process will cause large latency.
For example:
If I build a action which will be used by multiple users.
class RunLanguageToolAction() {
public Result run(String language, String text) {
JLanguageTool t = new JLanguageTool(**);
......
}
}
Then this action may be called by multiple thread. Then the threads block each other.
Am I right?
How should I use JLanguageTool in this case?
Thanks.