Annotation Type DefaultServiceFactory


  • @Documented
    @Target(TYPE)
    @Retention(RUNTIME)
    public @interface DefaultServiceFactory
    Specifies the default factory for a Service interface.

    This annotation can be placed on a Service interface in order to specify which factory should be used to construct a new service instance by default.

    Default instantiation takes place when some service A depends on some other service B and there is no factory for service B being registered. In such case the presence of this annotation will be checked on the service B's interface and if it exists then service will be constructed via the annotated factory.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      Class<? extends ServiceFactory<?>> value
      Service factory class.
    • Element Detail

      • value

        Class<? extends ServiceFactory<?>> value
        Service factory class. Must be instantiable via reflections (i.e. must have a default no-arg public constructor).
        Returns:
        Service factory class.