Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.cleantutorials.jconsole.mbeans;
import java.util.LinkedList;
import java.util.Queue;
public class ToDo implements ToDoMBean {
Queue<String> taskQueue = new LinkedList<String>();
@Override
public void storeTask(String taskName) {
taskQueue.add(taskName);
}
@Override
public String dequeueTask() {
return taskQueue.remove();
}
@Override
public int getTasksLeft() {
return taskQueue.size();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment