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

software.nealk.concurrent.tasks.NonRetrievableTask Maven / Gradle / Ivy

Go to download

An easy-to-consume concurrency library allowing for "Tasks" to execute business logic in a thread safe manner. This library helps users achieve multi-threading in their applications without worrying about synchronization and blocking for race conditions.

The newest version!
package software.nealk.concurrent.tasks;

import software.nealk.concurrent.Task;

public abstract class NonRetrievableTask implements Task{

	@Override
	public final synchronized void run() {
		// TODO Auto-generated method stub
		System.out.println("Thread " 
				+ Thread.currentThread().getId()
				+ " is running....");
		this.execute();
	}
	
	protected abstract void execute();

	@Override
	public final  T getVal() throws InterruptedException {
		throw new UnsupportedOperationException();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy