-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31460 from mkouba/scheduler-new-devui
Scheduler - new Dev UI - first iteration
- Loading branch information
Showing
13 changed files
with
647 additions
and
21 deletions.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
...er/common/src/main/java/io/quarkus/scheduler/common/runtime/ImmutableScheduledMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.quarkus.scheduler.common.runtime; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
import io.quarkus.scheduler.Scheduled; | ||
|
||
public final class ImmutableScheduledMethod implements ScheduledMethod { | ||
|
||
private final String invokerClassName; | ||
private final String declaringClassName; | ||
private final String methodName; | ||
private final List<Scheduled> schedules; | ||
|
||
public ImmutableScheduledMethod(String invokerClassName, String declaringClassName, String methodName, | ||
List<Scheduled> schedules) { | ||
this.invokerClassName = Objects.requireNonNull(invokerClassName); | ||
this.declaringClassName = Objects.requireNonNull(declaringClassName); | ||
this.methodName = Objects.requireNonNull(methodName); | ||
this.schedules = List.copyOf(schedules); | ||
} | ||
|
||
public String getInvokerClassName() { | ||
return invokerClassName; | ||
} | ||
|
||
public String getDeclaringClassName() { | ||
return declaringClassName; | ||
} | ||
|
||
public String getMethodName() { | ||
return methodName; | ||
} | ||
|
||
public List<Scheduled> getSchedules() { | ||
return schedules; | ||
} | ||
|
||
} |
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
25 changes: 25 additions & 0 deletions
25
...s/scheduler/common/src/main/java/io/quarkus/scheduler/common/runtime/ScheduledMethod.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.quarkus.scheduler.common.runtime; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.scheduler.Scheduled; | ||
|
||
/** | ||
* Scheduled method metadata. | ||
* | ||
*/ | ||
public interface ScheduledMethod { | ||
|
||
String getInvokerClassName(); | ||
|
||
String getDeclaringClassName(); | ||
|
||
String getMethodName(); | ||
|
||
List<Scheduled> getSchedules(); | ||
|
||
default String getMethodDescription() { | ||
return getDeclaringClassName() + "#" + getMethodName(); | ||
} | ||
|
||
} |
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
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
33 changes: 33 additions & 0 deletions
33
...ployment/src/main/java/io/quarkus/scheduler/deployment/devui/SchedulerDevUIProcessor.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package io.quarkus.scheduler.deployment.devui; | ||
|
||
import java.util.List; | ||
|
||
import io.quarkus.deployment.IsDevelopment; | ||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.devui.spi.JsonRPCProvidersBuildItem; | ||
import io.quarkus.devui.spi.page.CardPageBuildItem; | ||
import io.quarkus.devui.spi.page.Page; | ||
import io.quarkus.scheduler.deployment.ScheduledBusinessMethodItem; | ||
import io.quarkus.scheduler.runtime.devui.SchedulerJsonRPCService; | ||
|
||
public class SchedulerDevUIProcessor { | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
CardPageBuildItem page(List<ScheduledBusinessMethodItem> scheduledMethods) { | ||
|
||
CardPageBuildItem pageBuildItem = new CardPageBuildItem("Scheduler"); | ||
|
||
pageBuildItem.addPage(Page.webComponentPageBuilder() | ||
.icon("font-awesome-solid:clock") | ||
.componentLink("qwc-scheduler-scheduled-methods.js") | ||
.staticLabel(String.valueOf(scheduledMethods.size()))); | ||
|
||
return pageBuildItem; | ||
} | ||
|
||
@BuildStep(onlyIf = IsDevelopment.class) | ||
JsonRPCProvidersBuildItem rpcProvider() { | ||
return new JsonRPCProvidersBuildItem("Scheduler", SchedulerJsonRPCService.class); | ||
} | ||
|
||
} |
Oops, something went wrong.