Enum ExtensionScope

java.lang.Object
java.lang.Enum<ExtensionScope>
org.apache.dubbo.common.extension.ExtensionScope
All Implemented Interfaces:
Serializable, Comparable<ExtensionScope>, java.lang.constant.Constable

public enum ExtensionScope extends Enum<ExtensionScope>
Extension SPI Scope
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The extension instance is used within one application, shared with all modules of the application, and different applications create different extension instances.
    The extension instance is used within framework, shared with all applications and modules.
    The extension instance is used within one module, and different modules create different extension instances.
    self-sufficient, creates an instance for per scope, for special SPI extension, like ExtensionInjector
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FRAMEWORK

      public static final ExtensionScope FRAMEWORK
      The extension instance is used within framework, shared with all applications and modules.

      Framework scope SPI extension can only obtain FrameworkModel, cannot get the ApplicationModel and ModuleModel.

      Consideration:
      1. Some SPI need share data between applications inside framework
      2. Stateless SPI is safe shared inside framework
    • APPLICATION

      public static final ExtensionScope APPLICATION
      The extension instance is used within one application, shared with all modules of the application, and different applications create different extension instances.

      Application scope SPI extension can obtain FrameworkModel and ApplicationModel, cannot get the ModuleModel.

      Consideration:
      1. Isolate extension data in different applications inside framework
      2. Share extension data between all modules inside application
    • MODULE

      public static final ExtensionScope MODULE
      The extension instance is used within one module, and different modules create different extension instances.

      Module scope SPI extension can obtain FrameworkModel, ApplicationModel and ModuleModel.

      Consideration:
      1. Isolate extension data in different modules inside application
    • SELF

      public static final ExtensionScope SELF
      self-sufficient, creates an instance for per scope, for special SPI extension, like ExtensionInjector
  • Method Details

    • values

      public static ExtensionScope[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ExtensionScope valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null