Annotation Type OnService


  • @Target({FIELD,METHOD})
    @Retention(RUNTIME)
    public @interface OnService
    Annotate fields and methods that will be called when the corresponding services are available.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      long active
      How long shall the query be active?
      Boolean3 lazy
      todo: remove and replace by query.
      java.lang.String name
      The required service name that is used for searching the service.
      Boolean3 query
      Should be used as service query.
      Boolean3 required
      Fail at startup if no service is found for a field? If required is false, a proxy will be injected.
      RequiredService requiredservice
      Define a required service inline.
    • Element Detail

      • query

        Boolean3 query
        Should be used as service query.
        Default:
        jadex.commons.Boolean3.NULL
      • required

        Boolean3 required
        Fail at startup if no service is found for a field? If required is false, a proxy will be injected. The proxy will be resolved on first method invocation and performs a time limited query for the service (i.e. a time span search). If true on a field, init will only proceed when the service has been found and injected. If no service is found the startup of the component startup will fail.
        Default:
        jadex.commons.Boolean3.NULL
      • lazy

        Boolean3 lazy
        todo: remove and replace by query. If is lazy the service search will happen on first call. This can go wrong if first call is a synchronous message. If lazy is false, the agent might block when search takes time on agent init.
        Default:
        jadex.commons.Boolean3.NULL
      • active

        long active
        How long shall the query be active?
        Default:
        -1L
      • name

        java.lang.String name
        The required service name that is used for searching the service.
        Default:
        ""
      • requiredservice

        RequiredService requiredservice
        Define a required service inline. If given no name it will receive the field name as name.
        Default:
        @jadex.micro.annotation.RequiredService(name="", type=java.lang.Object.class)