Class ContributedBeans<T>

java.lang.Object
org.exoplatform.caldav.service.ContributedBeans<T>
Type Parameters:
T - the extension point's contract
All Implemented Interfaces:
Supplier<List<T>>

public final class ContributedBeans<T> extends Object implements Supplier<List<T>>
The beans contributed to one of this add-on's extension points, read one by one so that a contribution which cannot be created reads as absent rather than failing every question asked of the extension point.

A contribution from another web application reaches this one through the Kernel/Spring bridge as a lazy proxy: the bean the proxy stands for is only created when a method of it is first called, and sorting by order is such a call. Read as one ordered stream, a single contribution whose bean fails to be created would make the whole read throw, and with it every caller — a Stalwart-only question as much as a BlueMind one. So each contribution is asked a question of its own first (the probe, its identity on the extension point), then its order, inside its own guard; one that fails either is left out and said so, once per contribution, and the others are sorted by the orders read. A contribution of this web application that the bean factory itself fails to create while listing is left out the same way, and the listing goes on past it.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ContributedBeans(org.springframework.beans.factory.ObjectProvider<T> provider, String kind, Function<T,?> probe)
    The reader of one extension point's contributions.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    The contributions that could be created, in their declared order; never throws for a contribution that cannot be.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ContributedBeans

      public ContributedBeans(org.springframework.beans.factory.ObjectProvider<T> provider, String kind, Function<T,?> probe)
      The reader of one extension point's contributions.
      Parameters:
      provider - the contributions, from every web application; null reads as none
      kind - what the log calls one contribution, such as "share channel"
      probe - the question each contribution answers before it is kept — its identity on the extension point — which creates the bean a proxy stands for
  • Method Details

    • get

      public List<T> get()
      The contributions that could be created, in their declared order; never throws for a contribution that cannot be.
      Specified by:
      get in interface Supplier<T>
      Returns:
      the contributions, never null