下面列出了怎么用org.springframework.boot.actuate.scheduling.ScheduledTasksEndpoint的API类实例代码及写法,或者点击链接到github查看源代码。
public ActuatorCommand(ApplicationContext applicationContext, Environment environment,
SshShellProperties properties, SshShellHelper helper,
@Lazy AuditEventsEndpoint audit, @Lazy BeansEndpoint beans,
@Lazy ConditionsReportEndpoint conditions,
@Lazy ConfigurationPropertiesReportEndpoint configprops, @Lazy EnvironmentEndpoint env,
@Lazy HealthEndpoint health,
@Lazy HttpTraceEndpoint httptrace, @Lazy InfoEndpoint info, @Lazy LoggersEndpoint loggers,
@Lazy MetricsEndpoint metrics,
@Lazy MappingsEndpoint mappings, @Lazy ScheduledTasksEndpoint scheduledtasks,
@Lazy ShutdownEndpoint shutdown,
@Lazy ThreadDumpEndpoint threaddump) {
this.applicationContext = applicationContext;
this.environment = environment;
this.properties = properties;
this.helper = helper;
this.audit = audit;
this.beans = beans;
this.conditions = conditions;
this.configprops = configprops;
this.env = env;
this.health = health;
this.httptrace = httptrace;
this.info = info;
this.loggers = loggers;
this.metrics = metrics;
this.mappings = mappings;
this.scheduledtasks = scheduledtasks;
this.shutdown = shutdown;
this.threaddump = threaddump;
}
@Test
void testScheduled() {
ScheduledTasksEndpoint.ScheduledTasksReport actual = cmd.scheduledtasks();
ScheduledTasksEndpoint.ScheduledTasksReport expected = scheduledtasks.scheduledTasks();
assertEquals(expected.getCron().size(), actual.getCron().size());
assertEquals(expected.getFixedDelay().size(), actual.getFixedDelay().size());
assertEquals(expected.getFixedRate().size(), actual.getFixedRate().size());
}
/**
* Scheduled tasks method
*
* @return scheduledtasks
*/
@ShellMethod(key = "scheduledtasks", value = "Display scheduledtasks endpoint.")
@ShellMethodAvailability("scheduledtasksAvailability")
public ScheduledTasksEndpoint.ScheduledTasksReport scheduledtasks() {
return scheduledtasks.scheduledTasks();
}
/**
* @return whether `scheduledtasks` command is available
*/
public Availability scheduledtasksAvailability() {
return availability("scheduledtasks", ScheduledTasksEndpoint.class);
}
ScheduledTasksCommand(@Value("${sshd.system.command.roles.scheduledTasks}") String[] systemRoles,
ScheduledTasksEndpoint scheduledTasksEndpoint) {
super(systemRoles);
this.scheduledTasksEndpoint = scheduledTasksEndpoint;
}