Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5816 : JMX-ify Scheduler implementations #5821

Merged
merged 2 commits into from
Dec 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import java.util.concurrent.atomic.AtomicInteger;

import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.Name;
import org.eclipse.jetty.util.component.AbstractLifeCycle;
import org.eclipse.jetty.util.component.Dumpable;
Expand All @@ -37,6 +39,7 @@
* queue even if the task did not fire, which provides a huge benefit in the performance
* of garbage collection in young generation.
*/
@ManagedObject
public class ScheduledExecutorScheduler extends AbstractLifeCycle implements Scheduler, Dumpable
{
private final String name;
Expand Down Expand Up @@ -154,4 +157,22 @@ public boolean cancel()
return scheduledFuture.cancel(false);
}
}

@ManagedAttribute("The name of the scheduler")
public String getName()
{
return name;
}

@ManagedAttribute("Whether the scheduler uses daemon threads")
public boolean isDaemon()
{
return daemon;
}

@ManagedAttribute("The number of scheduler threads")
public int getThreads()
{
return threads;
}
}