Class AdminProvider
@Rest flavors.
Holds the capability state (the name-keyed cache-flush hooks + the thread-name-prefix exclude list)
and the serve logic for the four admin endpoints (thread dump, heap statistics, cache flush, and
rate-limit-bucket inspection). The AdminMixin (mixin), AdminResource (child), and
AdminServlet (servlet) flavors are independent @Rest classes that each hold an
AdminProvider worker and delegate to it — so the three deployment forms cannot drift, and no
flavor is another flavor's worker.
See Also:
- Since:
- 10.0.0
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionDefault thread-name-prefix exclude list: filter out JVM internals, servlet container, and Spring Boot infrastructure threads. -
Constructor Summary
ConstructorsModifierConstructorDescriptionNo-arg constructor — uses the default thread filter and no cache-flush hooks.protectedAdminProvider(AdminProvider.Builder builder) Builder constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic AdminProvider.Buildercreate()Creates a new builder.Returns the registered cache-flush hooks (test/inspection helper).Returns the configured thread-name-prefix exclude list (test/inspection helper).voidserveCacheFlush(RestRequest req, RestResponse res) Runs all registered cache-flush hooks (or a subset).voidserveHeap(RestResponse res) Serves JVM heap and non-heap memory statistics.voidserveRateLimit(RestRequest req, RestResponse res) Serves the registeredRateLimitGuardbean configuration.voidserveThreads(RestResponse res) Serves the thread dump as a JSON list of currently-live threads.
-
Field Details
-
DEFAULT_THREAD_NAME_PREFIX_EXCLUDE
Default thread-name-prefix exclude list: filter out JVM internals, servlet container, and Spring Boot infrastructure threads.
-
-
Constructor Details
-
AdminProvider
public AdminProvider()No-arg constructor — uses the default thread filter and no cache-flush hooks. -
AdminProvider
Builder constructor.- Parameters:
builder- The builder. Must not benull.
-
-
Method Details
-
create
Creates a new builder.- Returns:
- A new builder.
-
serveThreads
Serves the thread dump as a JSON list of currently-live threads.- Parameters:
res- The current REST response. Must not benull.- Throws:
IOException- If an I/O error occurs while writing the response.
-
serveHeap
Serves JVM heap and non-heap memory statistics.- Parameters:
res- The current REST response. Must not benull.- Throws:
IOException- If an I/O error occurs while writing the response.
-
serveCacheFlush
Runs all registered cache-flush hooks (or a subset).When
namesis supplied, only the named hooks are invoked. Unknown names are silently ignored (404-on-unknown would leak the registered hook set). Hook execution is synchronous; long-running hooks block the request thread.- Parameters:
req- The current REST request —namesquery parameter is read off it. Must not benull.res- The current REST response. Must not benull.- Throws:
IOException- If an I/O error occurs while writing the response.
-
serveRateLimit
Serves the registeredRateLimitGuardbean configuration.Returns
404 Not Foundwhen noRateLimitGuardbean is registered.- Parameters:
req- The current REST request — supplies the bean store for guard lookup. Must not benull.res- The current REST response. Must not benull.- Throws:
IOException- If an I/O error occurs while writing the response.NotFound- If noRateLimitGuardbean is registered on the importer's bean store.
-
getCacheFlushHooks
Returns the registered cache-flush hooks (test/inspection helper).- Returns:
- The hooks, keyed by registration name. Never
null.
-
getThreadNamePrefixExclude
Returns the configured thread-name-prefix exclude list (test/inspection helper).- Returns:
- The exclude list. Never
null.
-