-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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("A scheduler") | ||
public class ScheduledExecutorScheduler extends AbstractLifeCycle implements Scheduler, Dumpable | ||
{ | ||
private final String name; | ||
|
@@ -154,4 +157,22 @@ public boolean cancel() | |
return scheduledFuture.cancel(false); | ||
} | ||
} | ||
|
||
@ManagedAttribute("name of scheduler") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use "The name of the scheduler". |
||
public String getName() | ||
{ | ||
return name; | ||
} | ||
|
||
@ManagedAttribute("is scheduler daemon") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use "Whether the scheduler uses daemon threads". |
||
public boolean isDaemon() | ||
{ | ||
return daemon; | ||
} | ||
|
||
@ManagedAttribute("number of scheduler threads") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use "The number of scheduler threads". |
||
public int getThreads() | ||
{ | ||
return threads; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description does not add any value, so just remove it.