Annotation Type ServiceComponent

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] configurationPid
      The configuration PIDs for the configuration of this Component.
      boolean eager
      During initialization, all eager top level managers are requested to provide a component instance.
      String name
      The name of this Component.
      String[] property
      Properties for this Component.
      Class<?>[] service
      The types under which to register this Component as a service.
      boolean singleton
      A bean manager has a recipe for the construction and injection of an object value.
    • Element Detail

      • name

        String name
        The name of this Component.

        If not specified, the name of this Component is the fully qualified type name of the class being annotated.

        See Also:
        "The name attribute of the component element of a Component Description."
        Default:
        ""
      • service

        Class<?>[] service
        The types under which to register this Component as a service.

        If no service should be registered, the empty value {} must be specified.

        If not specified, the service types for this Component are all the directly implemented interfaces of the class being annotated.

        See Also:
        "The service element of a Component Description."
        Default:
        {}
      • eager

        boolean eager
        During initialization, all eager top level managers are requested to provide a component instance. Applications can use this request as an indication to start providing their intended functionality.

        Managers that are lazy, that is, not singleton scope, activation is lazy, or inlined, are activated when they are first asked to provide a component instance. Therefore, even lazy managers can activate during initialization when they happen to be a dependency of another manager that activates its dependencies.

        Services and service references can also have lazy or eager activation. The eager activation will ensure that all listeners are properly actuated during the corresponding activation. For services, the service object is then also requested at startup.

        https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.blueprint.html#i2707929

        Default:
        false
      • singleton

        boolean singleton
        A bean manager has a recipe for the construction and injection of an object value. However, there can be different strategies in constructing its component instance, this strategy is reflected in the scope. The following scopes are architected for this specification:

        singleton - The bean manager only holds a single component instance. This object is created and set when the bean is activated. Subsequent requests must provide the same instance. Singleton is the default scope. It is usually used for core component instances as well as stateless services.

        prototype - The object is created and configured anew each time the bean is requested to provide a component instance, that is, every call to getComponentInstance must result in a new component instance. This is usually the only possible scope for stateful objects. All inlined beans are always prototype scope.

        Implementations can provide additional scope types. However, these types must only be allowed when a defining namespace is included in the definitions and is actually used in the definitions to specify the dependency on this feature.

        https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.blueprint.html#i3015704

        Default:
        false
      • property

        String[] property
        Properties for this Component.

        Each property string is specified as "name=value". The type of the property value can be specified in the name as name:type=value. The type must be one of the property types supported by the type attribute of the property element of a Component Description.

        To specify a property with multiple values, use multiple name, value pairs. For example, "foo=bar", "foo=baz".

        See Also:
        "The property element of a Component Description."
        Default:
        {}
      • configurationPid

        String[] configurationPid
        The configuration PIDs for the configuration of this Component.

        Each value specifies a configuration PID for this Component.

        If no value is specified, the name of this Component is used as the configuration PID of this Component.

        A empty string can be used to specify the name of the component as a configuration PID.

        Tools creating a Component Description from this annotation must replace the special string with the actual name of this Component.

        Since:
        1.2
        See Also:
        "The configuration-pid attribute of the component element of a Component Description."
        Default:
        {""}