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

org.jdeferred.DeferredRunnable Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package org.jdeferred;

import org.jdeferred.DeferredManager.StartPolicy;
import org.jdeferred.impl.DeferredObject;

/**
 * Use this as superclass in case you need to be able to be able to notify progress.
 * If you don't need to notify progress, you can simply use {@link Runnable}
 * 
 * @see #notify(Object)
 * @author Ray Tsang
 *
 * @param 

Type used for {@link Deferred#notify(Object)} */ public abstract class DeferredRunnable

implements Runnable { private final Deferred deferred = new DeferredObject(); private final StartPolicy startPolicy; public DeferredRunnable() { this.startPolicy = StartPolicy.DEFAULT; } public DeferredRunnable(StartPolicy startPolicy) { this.startPolicy = startPolicy; } /** * @see Deferred#notify(Object) * @param progress */ protected void notify(P progress) { deferred.notify(progress); } protected Deferred getDeferred() { return deferred; } public StartPolicy getStartPolicy() { return startPolicy; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy