Examples of ExecutionContext


Examples of dan.util.process.ExecutionContext

    ScriptExecutor executor = createScriptExecutor(inputs);
   
    if (logger.isDebugEnabled())
      logger.debug("Script executing...");
   
    ExecutionContext ctx = executor.start();
    ctx.waitForExit();

    if (logger.isDebugEnabled())
      logger.debug("Script execution complete: populating outputs");

    Map outputs = getOutputs(executor, ctx);
View Full Code Here

Examples of edu.stanford.bmir.protege.web.server.dispatch.ExecutionContext

    public DispatchServiceResultContainer executeAction(Action action) throws ActionExecutionException, PermissionDeniedException {
        UserId userId = getUserInSession();
        HttpServletRequest request = getThreadLocalRequest();
        HttpSession session = request.getSession();
        final RequestContext requestContext = new RequestContext(userId, session);
        final ExecutionContext executionContext = new ExecutionContext(userId);
        return executor.execute(action, requestContext, executionContext);
    }
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

   public void basicTest() throws Exception
   {
      XATerminator xt = adapter.ctx.getXATerminator();
      WorkManager wm = adapter.ctx.getWorkManager();
      TestWork work = new TestWork();
      ExecutionContext ec = new ExecutionContext();
      Xid xid = new MyXid(1);
      ec.setXid(xid);

      wm.doWork(work, 0l, ec, null);
      if (work.complete == false)
         throw new Exception("Work was not done");
      if (work.e != null)
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

         long started = System.currentTimeMillis();

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch startedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, startedLatch, null);
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

         if (startTimeout < 0)
            throw new WorkRejectedException("StartTimeout is negative: " + startTimeout);

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, null);

         if (workListener != null)
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

      if (trace)
      {
         log.trace("Starting work " + this)
      }

      ExecutionContext ctx = getExecutionContext();
     
      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            //JBAS-4002 base value is in seconds as per the API, here we convert to millis
            long timeout = (ctx.getTransactionTimeout() * 1000);
            workManager.getXATerminator().registerWork(work, xid, timeout);
         }
      }
     
      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().startWork(work, xid);
         }
      }
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

      if (trace)
      {
         log.trace("Ending work " + this)
      }

      ExecutionContext ctx = getExecutionContext();

      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().endWork(work, xid);
         }
      }
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

   protected void cancel()
   {
      if (trace)
         log.trace("Cancel work " + this)

      ExecutionContext ctx = getExecutionContext();

      if (ctx != null)
      {
         Xid xid = ctx.getXid();
         if (xid != null)
         {
            workManager.getXATerminator().cancelWork(work, xid);
         }
      }
View Full Code Here

Examples of javax.resource.spi.work.ExecutionContext

         if (startTimeout < 0)
            throw new WorkRejectedException("StartTimeout is negative: " + startTimeout);

         if (execContext == null)
         {
            execContext = new ExecutionContext()
         }

         final CountDownLatch completedLatch = new CountDownLatch(1);

         wrapper = new WorkWrapper(this, work, execContext, workListener, null, completedLatch);
View Full Code Here

Examples of net.sourceforge.stripes.controller.ExecutionContext

            final Configuration config = StripesFilter.getConfiguration();
            final ActionResolver resolver = StripesFilter.getConfiguration().getActionResolver();
            final HttpServletRequest request = (HttpServletRequest) getPageContext().getRequest();
            final HttpServletResponse response = (HttpServletResponse) getPageContext().getResponse();
            Resolution resolution = null;
            ExecutionContext ctx = new ExecutionContext();

            // Lookup the ActionBean if we don't already have it
            if (beanNotPresent) {
                ActionBeanContext tempContext =
                        config.getActionBeanContextFactory().getContextInstance(request, response);
                tempContext.setServletContext(getPageContext().getServletContext());
                ctx.setLifecycleStage(LifecycleStage.ActionBeanResolution);
                ctx.setActionBeanContext(tempContext);

                // Run action bean resolution
                ctx.setInterceptors(config.getInterceptors(LifecycleStage.ActionBeanResolution));
                resolution = ctx.wrap( new Interceptor() {
                    public Resolution intercept(ExecutionContext ec) throws Exception {
                        ActionBean bean = resolver.getActionBean(ec.getActionBeanContext(), binding);
                        ec.setActionBean(bean);
                        return null;
                    }
                });
            }
            else {
                ctx.setActionBean(actionBean);
                ctx.setActionBeanContext(actionBean.getContext());
            }

            // Then, if and only if an event was specified, run handler resolution
            if (resolution == null && event != null && (beanNotPresent || this.alwaysExecuteEvent)) {
                ctx.setLifecycleStage(LifecycleStage.HandlerResolution);
                ctx.setInterceptors(config.getInterceptors(LifecycleStage.HandlerResolution));
                resolution = ctx.wrap( new Interceptor() {
                    public Resolution intercept(ExecutionContext ec) throws Exception {
                        ec.setHandler(resolver.getHandler(ec.getActionBean().getClass(), event));
                        ec.getActionBeanContext().setEventName(event);
                        return null;
                    }
                });
            }

            // Make the PageContext available during the validation stage so that we
            // can execute EL based expression validation
            try {
                DispatcherHelper.setPageContext(getPageContext());

                // Bind applicable request parameters to the ActionBean
                if (resolution == null && (beanNotPresent || this.validate == true)) {
                    resolution = DispatcherHelper.doBindingAndValidation(ctx, this.validate);
                }

                // Run custom validations if we're validating
                if (resolution == null && this.validate == true) {
                    String temp =  config.getBootstrapPropertyResolver().getProperty(
                                        DispatcherServlet.RUN_CUSTOM_VALIDATION_WHEN_ERRORS);
                    boolean validateWhenErrors = temp != null && Boolean.valueOf(temp);

                    resolution = DispatcherHelper.doCustomValidation(ctx, validateWhenErrors);
                }
            }
            finally {
                DispatcherHelper.setPageContext(null);
            }

            // Fill in any validation errors if they exist
            if (resolution == null && this.validate == true) {
                resolution = DispatcherHelper.handleValidationErrors(ctx);
            }

            // And (again) if an event was supplied, then run the handler
            if (resolution == null && event != null && (beanNotPresent || this.alwaysExecuteEvent)) {
                resolution = DispatcherHelper.invokeEventHandler(ctx);
            }

            DispatcherHelper.fillInValidationErrors(ctx)// just in case!

            if (resolution != null && this.executeResolution) {
                DispatcherHelper.executeResolution(ctx, resolution);
            }

            // If a name was specified, bind the ActionBean into page context
            if (getVar() != null) {
                pageContext.setAttribute(getVar(), ctx.getActionBean());
            }

            return SKIP_BODY;
        }
        catch(Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.