Enum ConfigurationPolicy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ConfigurationPolicy>

    public enum ConfigurationPolicy
    extends java.lang.Enum<ConfigurationPolicy>
    Configuration Policy for the Component annotation.

    Controls whether component configurations must be satisfied depending on the presence of a corresponding Configuration object in the OSGi Configuration Admin service. A corresponding configuration is a Configuration object where the PID is the name of the component.

    Since:
    1.1
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      IGNORE
      Always allow the component configuration to be satisfied and do not use the corresponding Configuration object even if it is present.
      OPTIONAL
      Use the corresponding Configuration object if present but allow the component to be satisfied even if the corresponding Configuration object is not present.
      REQUIRE
      There must be a corresponding Configuration object for the component configuration to become satisfied.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      static ConfigurationPolicy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ConfigurationPolicy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

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

      • OPTIONAL

        public static final ConfigurationPolicy OPTIONAL
        Use the corresponding Configuration object if present but allow the component to be satisfied even if the corresponding Configuration object is not present.
      • REQUIRE

        public static final ConfigurationPolicy REQUIRE
        There must be a corresponding Configuration object for the component configuration to become satisfied.
      • IGNORE

        public static final ConfigurationPolicy IGNORE
        Always allow the component configuration to be satisfied and do not use the corresponding Configuration object even if it is present.
    • Method Detail

      • values

        public static ConfigurationPolicy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ConfigurationPolicy c : ConfigurationPolicy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ConfigurationPolicy valueOf​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<ConfigurationPolicy>