Method that gets invoked periodically by the container
196268
public void run(CallURL args) {

        logger = LoggerUtil.getStandardLogger();

        logger.info("methodEntry-->ProcessCleanup.run()");
        int processExpirationDays = 0;
        int maxProcesses = 0;
        int eventExpirationDays = 0;
        int commitInterval = 10000;
        String cleanupScript = null;

        if (PropertyManager.isYaml()) {
            try {
                Properties cleanupTaskProperties = PropertyManager.getInstance().getProperties(PropertyNames.MDW_TIMER_TASK);
                processExpirationDays = Integer.parseInt(cleanupTaskProperties.getProperty(PropertyNames.MDW_TIMER_TASK + ".ProcessCleanup.ProcessExpirationAgeInDays", "0"));
                maxProcesses = Integer.parseInt(cleanupTaskProperties.getProperty(PropertyNames.MDW_TIMER_TASK + ".ProcessCleanup.MaximumProcessExpiration", "0"));
                eventExpirationDays = Integer.parseInt(cleanupTaskProperties.getProperty(PropertyNames.MDW_TIMER_TASK + ".ProcessCleanup.ExternalEventExpirationAgeInDays", "0"));
                commitInterval = Integer.parseInt(cleanupTaskProperties.getProperty(PropertyNames.MDW_TIMER_TASK + ".ProcessCleanup.CommitInterval", "10000"));
                cleanupScript = cleanupTaskProperties.getProperty(PropertyNames.MDW_TIMER_TASK + ".ProcessCleanup.RuntimeCleanupScript", "Cleanup-Runtime.sql");
            }
            catch (PropertyException e) {
                logger.info("ProcessCleanup.run() : Properties not found" + e.getMessage());
            }
        } else {
            processExpirationDays = PropertyManager.getIntegerProperty(
                    PropertyNames.PROCESS_CLEANUP + "/ProcessExpirationAgeInDays", 0);
            maxProcesses = PropertyManager.getIntegerProperty(
                    PropertyNames.PROCESS_CLEANUP + "/MaximumProcessExpiration", 0);
            eventExpirationDays = PropertyManager.getIntegerProperty(
                    PropertyNames.PROCESS_CLEANUP + "/ExternalEventExpirationAgeInDays", 0);
            commitInterval = PropertyManager
                    .getIntegerProperty(PropertyNames.PROCESS_CLEANUP + "/CommitInterval", 10000);
            cleanupScript = PropertyManager
                    .getProperty(PropertyNames.PROCESS_CLEANUP + "/RuntimeCleanupScript");
        }
        if (cleanupScript == null) {
            cleanupScript = "Cleanup-Runtime.sql";
        }

        DatabaseAccess db = new DatabaseAccess(null);
        cleanup(db, cleanupScript, maxProcesses, processExpirationDays, eventExpirationDays,
                commitInterval, null);

        logger.info("methodExit-->ProcessCleanup.run()");
    }
827636
function (name, method) {
        // TODO: deal with registerPriority in 3.0
        this.map.events.registerPriority(name, this, method);
        this.map.events.registerPriority(name, this, this.setEvent);
    }
243109
def pause(self, container):
        
        url = self._url('/containers/{0}/pause', container)
        res = self._post(url)
        self._raise_for_status(res)
1067281
private void scheduleKeepAlive() {
    if (keepAlive != null)
      keepAlive.cancel();
    keepAlive = context.schedule(interval, () -> {
      keepAlive = null;
      if (state.getState().active()) {
        keepAlive();
      }
    });
  }
359824
public S pollInterval(long poll, TemporalUnit pollUnit) {
        Preconditions.checkArgument(0 <= poll);
        this.poll = Duration.of(poll, pollUnit);
        return self();
    }
1352145
def invoke(self, method, *args):
        
        def inv(value, *ar):
            if (
                _(method).isFunction() or
                _(method).isLambda() or
                _(method).isMethod()
            ):
                return method(value, *args)
            else:
                return getattr(value, method)(*args)
        return self._wrap(self._clean.map(inv))
363995
@Override
    public void dispatch(final KeyedMessage message, final boolean block) throws IllegalArgumentException, ContainerException {
        if(!isRunningLazy) {
            LOGGER.debug("Dispacth called on stopped container");
            statCollector.messageFailed(false);
        }

        if(message == null)
            return; // No. We didn't process the null message

        if(!inbound.doesMessageKeyBelongToNode(message.key)) {
            if(LOGGER.isDebugEnabled())
                LOGGER.debug("Message with key " + SafeString.objectDescription(message.key) + " sent to wrong container. ");
            statCollector.messageFailed(false);
            return;
        }

        boolean evictedAndBlocking;

        if(message == null || message.message == null)
            throw new IllegalArgumentException("the container for " + clusterId + " attempted to dispatch null message.");

        if(message.key == null)
            throw new ContainerException("Message " + objectDescription(message.message) + " contains no key.");

        try {
            numBeingWorked.incrementAndGet();

            do {
                evictedAndBlocking = false;

                final InstanceWrapper wrapper = getInstanceForKey(message.key);

                // wrapper will be null if the activate returns 'false'
                if(wrapper != null) {
                    final Object instance = wrapper.getExclusive(block);
                    if(instance != null) { // null indicates we didn't get the lock
                        final List<KeyedMessageWithType> response;
                        try {
                            if(wrapper.isEvicted()) {
                                response = null;
                                // if we're not blocking then we need to just return a failure. Otherwise we want to try again
                                // because eventually the current Mp will be passivated and removed from the container and
                                // a subsequent call to getInstanceForDispatch will create a new one.
                                if(block) {
                                    Thread.yield();
                                    evictedAndBlocking = true; // we're going to try again.
                                } else { // otherwise it's just like we couldn't get the lock. The Mp is busy being killed off.
                                    if(LOGGER.isTraceEnabled())
                                        LOGGER.trace("the container for " + clusterId + " failed handle message due to evicted Mp "
                                            + SafeString.valueOf(prototype));

                                    statCollector.messageCollision(message);
                                }
                            } else {
                                response = invokeOperation(wrapper.getInstance(), Operation.handle, message);
                            }
                        } finally {
                            wrapper.releaseLock();
                        }
                        if(response != null) {
                            try {
                                dispatcher.dispatch(response);
                            } catch(final Exception de) {
                                if(isRunning.get())
                                    LOGGER.warn("Failed on subsequent dispatch of " + response + ": " + de.getLocalizedMessage());
                            }
                        }
                    } else { // ... we didn't get the lock
                        if(LOGGER.isTraceEnabled())
                            LOGGER.trace("the container for " + clusterId + " failed to obtain lock on " + SafeString.valueOf(prototype));
                        statCollector.messageCollision(message);
                    }
                } else {
                    // if we got here then the activate on the Mp explicitly returned 'false'
                    if(LOGGER.isDebugEnabled())
                        LOGGER.debug("the container for " + clusterId + " failed to activate the Mp for " + SafeString.valueOf(prototype));
                    // we consider this "processed"
                    break; // leave the do/while loop
                }
            } while(evictedAndBlocking);

        } finally {
            numBeingWorked.decrementAndGet();
        }
    }
2719
function onProcCall(method, path /* devid , propname*/, args) {
    switch (method) {
    case 'GET':
        return onProcCallGet(method, path /* devid , propname*/, args);
    /* case 'POST' :
        if(devid!='settings' || args == undefined)
            return {error:'The format is wrong for settings.'};
        if( args.schedule instanceof Array && logger.updateschedule(args.schedule) )
            return {success:true,message:'New schedule settings are successfully saved'};
        else
            return {error:'Error in saving scheduled logging'};*/
    }
    const msg = `The specified method ${method}`
          + ' is not implemented in admin plugin.';
    return {error: msg};
}
532488
public void invokestatic(ExecutableElement method) throws IOException
    {
        int index = subClass.resolveMethodIndex(method);
        invokestatic(index);
    }
358319
@Override
    public void run() {
        final ScheduledFuture<?> future = this.executor.scheduleWithFixedDelay(this.scheduled, 0, this.delayMillis,
                TimeUnit.MILLISECONDS);
        try {
            this.runTrigger.await();
        } catch (final InterruptedException e) {
            this.listener.handle(e);
        } finally {
            future.cancel(true); // stop the periodic reading
            this.scheduled.cleanup();
            this.executor.shutdownNow();
            this.listener.destroy();
        }
    }
23033
private void onBegin()
   {
      Queue<Long> q = currentTime.get();
      q.add(System.currentTimeMillis());
   }
801471
private void schedulePeriodicWorks() {
        // JMX stats broadcast
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                // A null here was causing a steady stream of annoying but apparently inconsequential
                // NPEs during a debug session of an unrelated unit test.
                if (m_statsManager != null) {
                    m_statsManager.sendNotification();
                }
            }
        }, 0, StatsManager.POLL_INTERVAL, TimeUnit.MILLISECONDS));

        // clear login count
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                ScheduledExecutorService es = VoltDB.instance().getSES(false);
                if (es != null && !es.isShutdown()) {
                    es.submit(new Runnable() {
                        @Override
                        public void run()
                        {
                            long timestamp = System.currentTimeMillis();
                            m_flc.checkCounter(timestamp);
                        }
                    });
                }
            }
        }, 0, 10, TimeUnit.SECONDS));

        // small stats samples
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                SystemStatsCollector.asyncSampleSystemNow(false, false);
            }
        }, 0, 5, TimeUnit.SECONDS));

        // medium stats samples
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                SystemStatsCollector.asyncSampleSystemNow(true, false);
            }
        }, 0, 1, TimeUnit.MINUTES));

        // large stats samples
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                SystemStatsCollector.asyncSampleSystemNow(true, true);
            }
        }, 0, 6, TimeUnit.MINUTES));

        // export stream master check
        m_periodicWorks.add(scheduleWork(new Runnable() {
            @Override
            public void run() {
                checkExportStreamMastership();
            }
        }, 0, 1, TimeUnit.MINUTES));

        // other enterprise setup
        EnterpriseMaintenance em = EnterpriseMaintenance.get();
        if (em != null) { em.setupMaintenaceTasks(); }

        GCInspector.instance.start(m_periodicPriorityWorkThread, m_gcStats);
    }
768794
async def lock(self, container = None):
        ""
        if container is None:
            container = RoutineContainer.get_container(self.scheduler)
        if self.locked:
            pass
        elif self.lockroutine:
            await LockedEvent.createMatcher(self)
        else:
            await container.wait_for_send(LockEvent(self.context, self.key, self))
            self.locked = True
114400
function(rpc_method, fn) {
        rpc.on(rpc_method, _.partial(moduleEventWrap, rpc_method, fn));
    }
39591
function containerRefreshStart(index) {
    previousOrParentNode = loadElement(index);
    ngDevMode && assertNodeType(previousOrParentNode, 0 /* Container */);
    isParent = true;
    previousOrParentNode.data[ACTIVE_INDEX] = 0;
    if (!checkNoChangesMode) {
        // We need to execute init hooks here so ngOnInit hooks are called in top level views
        // before they are called in embedded views (for backwards compatibility).
        executeInitHooks(viewData, tView, creationMode);
    }
}
562488
private void whenInt(MockedVoidMethod method) {
        if (onMethodCallDuringStubbing.get() != null) {
            throw new IllegalStateException("Stubbing is already in progress on this thread.");
        }

        ArrayList<Method> stubbingsSetUp = new ArrayList<>();

        /* Set up interception of method. 'method' does not specify what class the stubbing is
         * set up on. Hence wait until the call is made and intercept it just before the code
         * is executed. At this time, start the stubbing operation.
         */
        onMethodCallDuringStubbing.set((clazz, stubbedMethod) -> {
            when(ExtendedMockito.staticMockMarker(clazz));
            stubbingsSetUp.add(stubbedMethod);
        });
        try {
            try {
                // Call the method. This will be intercepted by onMethodCallDuringStubbing
                method.run();
            } catch (Throwable t) {
                throw new RuntimeException(t);
            }

            if (stubbingsSetUp.isEmpty()) {
                // Make sure something was intercepted
                throw new IllegalArgumentException("Nothing was stubbed. Does the lambda call a"
                        + " static method on a 'static' mock/spy?");
            } else if (stubbingsSetUp.size() > 1) {
                // A lambda might call several methods. In this case it is not clear what should
                // be stubbed. Hence throw an error.
                throw new IllegalArgumentException("Multiple intercepted calls on method "
                        + stubbingsSetUp);
            }
        } finally {
            onMethodCallDuringStubbing.remove();
        }
    }
544906
def statichttp(container = None):
    ""
    def decorator(func):
        @functools.wraps(func)
        def handler(event):
            return _handler(container, event, func)
        if hasattr(func, '__self__'):
            handler.__self__ = func.__self__
        return handler
    return decorator