Ejemplo n.º 1
0
  public void initialize(IPathState ps) {
    if (!ps.has404Fingerprints() || !hasSuitablePath(ps)) {
      ipsCheck.initialize(ps);
      return;
    }

    final IInjectionModuleContext ctx = ps.createModuleContext();
    final HttpUriRequest req = createRequest(ps.getPath());
    ctx.submitRequest(req, this, 0);
  }
Ejemplo n.º 2
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();
   }
 }