Package com.adito.tasks.timer

Examples of com.adito.tasks.timer.StoppableTimer


        ShutdownForm shutdownForm = (ShutdownForm) form;
        PolicyUtil.checkPermission(PolicyConstants.SERVICE_CONTROL_RESOURCE_TYPE, shutdownForm.getShutdownOperation()
            .equals(ShutdownForm.SHUTDOWN) ? PolicyConstants.PERM_SHUTDOWN : PolicyConstants.PERM_RESTART, request);
        if (shutdownForm.getAlreadyPerforming()) {
            shutdownForm.setReferer(CoreUtil.getReferer(request));
            StoppableTimer timer = (StoppableTimer) CoreServlet.getServlet().getServletContext().getAttribute(StoppableTimer.NAME);
            timer.cancelTimerTask(ShutdownTimerTask.NAME);
            GlobalWarningManager.getInstance().removeGlobalWarning((HttpSession) null, "shutdown.global.warning.message");
            shutdownForm.setAlreadyPerforming(false);
            return mapping.findForward("refresh");
        } else {
            if (shutdownForm.isImmediate()) {
View Full Code Here


            doShutdown(request, shutdownForm, restart);
        }
    }

    private void doShutdown(HttpServletRequest request, ShutdownForm shutdownForm, final boolean restart) {
        StoppableTimer timer = (StoppableTimer) CoreServlet.getServlet().getServletContext().getAttribute(StoppableTimer.NAME);
        ShutdownTimerTask stt = new ShutdownTimerTask(restart, Integer.parseInt(shutdownForm.getShutdownDelay()));
        timer.schedule(ShutdownTimerTask.NAME, stt, stt.getDelay());
        GlobalWarningManager.getInstance().addMultipleGlobalWarning(new GlobalWarning(GlobalWarning.ALL_USERS, new BundleActionMessage("setup",
            "shutdown.global.warning.message",
            stt.getShutDownTimeString()), DismissType.NO_DISMISS));
        request.getSession().setAttribute(Constants.RESTARTING, Boolean.valueOf(restart));
    }
View Full Code Here

    public String getShutdownTime() {
        return shutdownTime;
    }

  public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {
      StoppableTimer timer = (StoppableTimer) CoreServlet.getServlet().getServletContext().getAttribute(StoppableTimer.NAME);
      if (timer.containsTimerTask(ShutdownTimerTask.NAME)){
            shutdownTime = ((ShutdownTimerTask)timer.getTimerTask(ShutdownTimerTask.NAME)).getShutDownTimeString();
        alreadyPerforming = true;
      }
      else {
            shutdownTime = null;
        alreadyPerforming = false;
View Full Code Here

        applicationStoreResources = (CoreMessageResources) messageResourcesFactory
                        .createResources("com.adito.applications.store.ApplicationResources");
        applicationStoreResources.setReturnNull(false);

        // finally setup the scheduler
        this.getServletContext().setAttribute(StoppableTimer.NAME, new StoppableTimer());
    }
View Full Code Here

TOP

Related Classes of com.adito.tasks.timer.StoppableTimer

Copyright © 2018 www.massapicom. 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.