Annotation Type PooledClient


  • @Retention(RUNTIME)
    @Inherited
    @Target(TYPE)
    public @interface PooledClient
    Tagging annotation that tells the Service Discovery framework that this API should use a pooled client pattern. This allows expensive to set up and use client-side APIs to be pooled. Pooled clients are wrapped in a proxy that obtains a client from the pool, makes the API call, and returns it after use. There is no limit on the number of clients in the pool and idle clients will be reclaimed. Currently only client-only APIs are pooled. A pooled client is guaranteed to be accessed by only a single thread at a time. A pooled client must have a no-arg constructor and during the Service Discovery loading of the client, a test instance will be created to confirm.

    If the implementing class has resources, like a JDBC connection, then the class must implement java.io.Closeable to close that resource properly once the service pool is done with this service.

    For HSQL implementations, specify a transientPredicate of TransientHsqlExceptionPredicate.

    For HBase implementations, specify a transientPredicate of HBaseTransientExceptionPredicate.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<? extends java.util.function.Predicate<java.lang.Throwable>>[] transientPredicate
      An array of predicates that will indicate whether encountered exceptions indicate the service client should be reconstructed.
    • Element Detail

      • transientPredicate

        java.lang.Class<? extends java.util.function.Predicate<java.lang.Throwable>>[] transientPredicate
        An array of predicates that will indicate whether encountered exceptions indicate the service client should be reconstructed. Implementations of these predicates should extend AbstractTransientExceptionPredicate.

        For HSQL implementations, specify a transientPredicate of TransientHsqlExceptionPredicate.

        For HBase implementations, specify a transientPredicate of HBaseTransientExceptionPredicate.

        Default:
        {}