/** * @see javax.management.timer.Timer#start() */ public void start() { this.reset(); super.start(); }
public void enablePolicyExecution(boolean aEnable) { if(!isTimerRunning && aEnable) { isTimerRunning = true; mTimer.start(); } if(isTimerRunning && !aEnable) { isTimerRunning = false; mTimer.stop(); } }
public synchronized void startUpdates() { if (!timerStarted) { timer.addNotification("tickTimer", null, null, new Date(System.currentTimeMillis()), timerPeriod); this.timerStarted = true; timer.start(); } }
private void registerTargetCheckTimer() { try { mTargetCheckTimer = new Timer(); mTargetCheckTimerObjectName = new ObjectName(EventManagementConstants.EVENT_MANAGEMENT_TARGET_CHECK_TIMER_MBEAN_NAME); ((MBeanServer) mMBeanServer).registerMBean(mTargetCheckTimer, mTargetCheckTimerObjectName); hookUpToTimerService(mTargetCheckInterval); mTargetCheckTimer.start(); } catch (Exception e) { String bundleKey = "caps.management.server.alert.instance.check.timer.setup.error.log.msg"; String message = AlertUtil.constructLogMessage(bundleKey); mLogger.log(Level.WARNING, message, e); } }
private synchronized void manageTimer() { if (!timer.isActive()) { if ((perfTimerStarted && perfTimerListeners > 0) || (structuralTimerStarted && structuralTimerListeners > 0)) timer.start(); } else { if ((!perfTimerStarted || perfTimerListeners == 0) && (!structuralTimerStarted || structuralTimerListeners == 0)) timer.stop(); } }
private synchronized void manageTimer() { if (!timer.isActive()) { if ((perfTimerStarted && perfTimerListeners > 0) || (structuralTimerStarted && structuralTimerListeners > 0)) timer.start(); } else { if ((!perfTimerStarted || perfTimerListeners == 0) && (!structuralTimerStarted || structuralTimerListeners == 0)) timer.stop(); } }
private void registerPolicyExecutionTimer() { try { mTimer = new Timer(); mTimerObjectName = new ObjectName(EventManagementConstants.EVENT_MANAGEMENT_REMOVAL_POLICY_TIMER_MBEAN_NAME); if(mPlatformContext.isAdminServer() && ((MBeanServer) mMBeanServer).isRegistered(mTimerObjectName)) { return; // registered by the controller mbean } ((MBeanServer) mMBeanServer).registerMBean(mTimer, mTimerObjectName); hookUpToTimerService(mAlertPersistenceConfiguration.getPersistenceAlertPolicyExecInterval()); if(mAlertPersistenceConfiguration.getPersistedAlertRemovalPolicyExecEnabled()) { // add notification interval prior to starting isTimerRunning = true; mTimer.start(); } } catch (Exception e) { String bundleKey = "caps.management.server.alert.persistence.removal.policy.setup.error.log.msg"; String message = AlertUtil.constructLogMessage(bundleKey); mLogger.log(Level.WARNING, message, e); } }
unHookFromTimerService(); hookUpToTimerService(mTargetCheckInterval); mTargetCheckTimer.start();
public void UpdatePolicyExecutionInterval(Long aNewInterval) { if(isTimerRunning) { mTimer.stop(); unHookFromTimerService(); hookUpToTimerService(aNewInterval); mTimer.start(); } else { unHookFromTimerService(); hookUpToTimerService(aNewInterval); } }
this.mTargetCheckTimer.stop(); updateTargetsIfNeeded(); this.mTargetCheckTimer.start();