All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gh.bmd.jrt.runner.Runner Maven / Gradle / Ivy

There is a newer version: 5.9.0
Show newest version
/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.gh.bmd.jrt.runner;

import java.util.concurrent.TimeUnit;

import javax.annotation.Nonnull;

/**
 * The runner interface defines an object responsible for executing routine invocations inside
 * specifically managed threads.
 * 

* The implementation can both be synchronous or asynchronous, it can allocate specific threads or * share a pool of them between different instances.
* The only requirements is that the specified execution is called each time a run method is * invoked.
* Note also that the runner methods can be called from different threads, so, it is up to the * implementing class to ensure synchronization when needed. *

* Created by davide on 9/7/14. */ public interface Runner { /** * Runs the specified execution (that is, it calls the execution run() * method inside the runner thread). * * @param execution the execution. * @param delay the execution delay. * @param timeUnit the delay time unit. */ public void run(@Nonnull Execution execution, long delay, @Nonnull TimeUnit timeUnit); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy