Created
May 26, 2020 06:52
-
-
Save cleantutorials/aebbf9e1f1eab3ef6cedac4a5bfa2b5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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