예제 #1
0
 @Override
 public void runScript(IPathState pathState) {
   final IModuleContext ctx = pathState.createModuleContext();
   try {
     final Object[] args = new Object[] {new ModuleContextJS(ctx)};
     Context cx = Context.enter();
     Scriptable instance = module.createInstanceScope(cx);
     module.runModule(cx, instance, args, pathState.toString());
   } catch (WrappedException e) {
     logger.log(
         Level.WARNING,
         new RhinoExceptionFormatter("Wrapped exception running module script", e).toString());
   } catch (RhinoException e) {
     logger.warning(new RhinoExceptionFormatter("Exception running module script.", e).toString());
   } finally {
     Context.exit();
   }
 }