Annotation Interface 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
    How long shall the query be active?
    jadex.common.Boolean3
    todo: remove and replace by query.
    The required service name that is used for searching the service.
    jadex.common.Boolean3
    Should be used as service query.
    jadex.common.Boolean3
    Fail at startup if no service is found for a field? If required is false, a proxy will be injected.
    Define a required service inline.
  • Element Details

    • query

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

      jadex.common.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:
      NULL
    • lazy

      jadex.common.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:
      NULL
    • active

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

      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.requiredservice.annotation.RequiredService(name="", type=java.lang.Object.class)