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

org.infinispan.distexec.RunnableAdapter Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.distexec;

import java.io.Serializable;
import java.util.concurrent.Callable;

/**
 * Runnable adapter for distributed executor service
 * Any RunnableAdapter refactoring might break CDI
 */
public final class RunnableAdapter implements Callable, Serializable {

   /**
    * The serialVersionUID
    */
   private static final long serialVersionUID = 6629286923873531028L;

   protected Runnable task;
   protected T result;

   protected RunnableAdapter() {
   }

   protected RunnableAdapter(Runnable task, T result) {
      this.task = task;
      this.result = result;
   }

   public Runnable getTask() {
      return task;
   }

   @Override
   public T call() {
      task.run();
      return result;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy