Marcos Sousa [
https://community.jboss.org/people/marcos.sousa] created the discussion
"Re: Custom JuelScriptEngine"
To view the discussion, visit:
https://community.jboss.org/message/826763#826763
--------------------------------------------------------------
An way that looked to fit to me is:
public ScriptEngine getScriptEngine() {
if (queue.isEmpty()) {
ScriptEngine scriptEngine = new Juel4AppnameScriptEngine(this);
try {
queue.put(scriptEngine);
} catch (InterruptedException e) {
e.printStackTrace();
}
return scriptEngine;
} else {
while (!queue.isEmpty()) {
try {
Thread.sleep(1 * 100L);
} catch (Exception e) {
e.printStackTrace();
}
}
ScriptEngine scriptEngine = new Juel4AppnameScriptEngine(this);
try {
queue.put(scriptEngine);
} catch (InterruptedException e) {
e.printStackTrace();
}
return scriptEngine;
}
}
Then in Juel4AppnameScriptEngine I use
"Juel4ImpressionScriptEngineFactory.queue.poll();" before return eval method.
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/826763#826763]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]