• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use ScriptEngineManager in EJB?  RSS feed

Bupjae Lee
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is javadoc for javax.script.ScriptEngineManager consturctor:

public ScriptEngineManager()

If the thread context ClassLoader can be accessed by the caller, then the effect of calling this constructor is the same as calling ScriptEngineManager(Thread.currentThread().getContextClassLoader()). Otherwise, the effect is the same as calling ScriptEngineManager(null).

public ScriptEngineManager(ClassLoader loader)

This constructor loads the implementations of ScriptEngineFactory visible to the given ClassLoader using the service provider mechanism.

If loader is null, the script engine factories that are bundled with the platform and that are in the usual extension directories (installed extensions) are loaded.

However, I know that using ClassLoader is prohibited in the EJB.

Then, the only choice - new ScriptEngineManager(null) - would be work?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!