Skip to content

io microsphere alibaba sentinel common util SentinelUtils

github-actions[bot] edited this page Jul 5, 2026 · 2 revisions

SentinelUtils

Type: Class | Module: microsphere-alibaba-sentinel-commons | Package: io.microsphere.alibaba.sentinel.common.util | Since: 1.0.0

Source: microsphere-alibaba-sentinel-commons/src/main/java/io/microsphere/alibaba/sentinel/common/util/SentinelUtils.java

Overview

Alibaba Sentinel Utilities Class

Declaration

public abstract class SentinelUtils

Author: Mercy

Version Information

  • Introduced in: 1.0.0
  • Current Project Version: 0.2.0-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-alibaba-sentinel-commons</artifactId>
    <version>${microsphere-alibaba-sentinel.version}</version>
</dependency>

Tip: Use the BOM (microsphere-alibaba-sentinel-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.alibaba.sentinel.common.util.SentinelUtils;

API Reference

Public Methods

Method Description
buildResourceName The MethodHandle of ContextUtil#resetContextMap()
getFlowDataId Get the Flow Data ID
getPluginEnabledPropertyName Get the Property Name of plugin enabled property : "microsphere.sentinel.${pluginName}.enabled"
isPluginEnabled Is the plugin enabled ?
getDefaultContextName Get the default Context name
getResourceTypeAsString Get the label string for resource type
findSentinelMetricsTaskExecutor Find the Sentinel Metrics Task ScheduledExecutorService Executor from FlowRuleManager
getSentinelMetricsTaskExecutor Get the Sentinel Metrics Task ScheduledExecutorService Executor
resetContextMap Reset the ContextUtil#resetContextMap() context map of Sentinel

Method Details

buildResourceName

public static String buildResourceName(Method method)

The MethodHandle of ContextUtil#resetContextMap()

getPluginEnabledPropertyName

public static final String getPluginEnabledPropertyName(String pluginName)

Get the Property Name of plugin enabled property : "microsphere.sentinel.${pluginName}.enabled"

findSentinelMetricsTaskExecutor

public static ScheduledExecutorService findSentinelMetricsTaskExecutor()

Find the Sentinel Metrics Task ScheduledExecutorService Executor from FlowRuleManager

getSentinelMetricsTaskExecutor

public static ScheduledExecutorService getSentinelMetricsTaskExecutor()

Get the Sentinel Metrics Task ScheduledExecutorService Executor

resetContextMap

public static void resetContextMap()

Reset the ContextUtil#resetContextMap() context map of Sentinel


This documentation was auto-generated from the source code of microsphere-alibaba-sentinel.

Clone this wiki locally