Annotation Type Property


  • @Retention(RUNTIME)
    @Target({METHOD,FIELD})
    public @interface Property
    Represents a Protocol property assigned from corresponding field in JGroups properties file.

    Since all protocol properties are read as String instances from properties file properties need to be converted to an appropriate field type of a matching Protocol instance. JGroups supplies set of converters in PropertyConverters class.

    Third parties can provide their own converters if such need arises by implementing PropertyConverter interface and by specifying that converter as converter on a specific Property annotation of a field or a method instance.

    Property annotation can decorate either a field or a method of a Property class. If a method is decorated with Property annotation it is assumed that such a method is a setter with only one parameter type that a specified converter can convert from a String to an actual type.

    Author:
    Vladimir Blagojevic
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends PropertyConverter> converter  
      java.lang.String defaultValueIPv4
      Global.NON_LOOPBACK_ADDRESS means pick any valid non-loopback IPv4 address
      java.lang.String defaultValueIPv6
      Global.NON_LOOPBACK_ADDRESS means pick any valid non-loopback IPv6 address
      java.lang.String dependsUpon  
      java.lang.String deprecatedMessage  
      java.lang.String description  
      boolean exposeAsManagedAttribute
      Configures whether to expose this property as a managed attribute.
      java.lang.String name  
      java.lang.String[] systemProperty
      If the value is not explicitly specified, attempt to fetch the value first from the System property using System.getProperty(java.lang.String), secondly from the environment variable System.getenv(java.lang.String) of the given names.
      AttributeType type
      Defines the type, used for pretty printing
      java.util.concurrent.TimeUnit unit
      Only used if type is TIME
      boolean writable
      Configures whether this managed attribute is writeable at runtime.
    • Element Detail

      • name

        java.lang.String name
        Default:
        ""
      • description

        java.lang.String description
        Default:
        ""
      • deprecatedMessage

        java.lang.String deprecatedMessage
        Default:
        ""
      • converter

        java.lang.Class<? extends PropertyConverter> converter
        Default:
        org.jgroups.conf.PropertyConverters.Default.class
      • dependsUpon

        java.lang.String dependsUpon
        Default:
        ""
      • systemProperty

        java.lang.String[] systemProperty
        If the value is not explicitly specified, attempt to fetch the value first from the System property using System.getProperty(java.lang.String), secondly from the environment variable System.getenv(java.lang.String) of the given names. If all lookups fail, the field will be null.
        Default:
        {}
      • defaultValueIPv4

        java.lang.String defaultValueIPv4
        Global.NON_LOOPBACK_ADDRESS means pick any valid non-loopback IPv4 address
        Default:
        ""
      • defaultValueIPv6

        java.lang.String defaultValueIPv6
        Global.NON_LOOPBACK_ADDRESS means pick any valid non-loopback IPv6 address
        Default:
        ""
      • exposeAsManagedAttribute

        boolean exposeAsManagedAttribute
        Configures whether to expose this property as a managed attribute. This is typically used to disable exposing objects that are not well represented as Strings or other primitives and security-sensitive configuration. Write-only managed attributes are not supported.
        Default:
        true
      • writable

        boolean writable
        Configures whether this managed attribute is writeable at runtime. Protocols exposing writeable attributes must ensure that the implementation uses the updated value. If set to true, automatically sets exposeAsManagedAttribute to true.
        Default:
        true
      • type

        AttributeType type
        Defines the type, used for pretty printing
        Default:
        org.jgroups.conf.AttributeType.UNDEFINED
      • unit

        java.util.concurrent.TimeUnit unit
        Only used if type is TIME
        Default:
        java.util.concurrent.TimeUnit.MILLISECONDS