Class ExtensionList<T>

java.lang.Object
org.adempiere.base.equinox.ExtensionList<T>
Type Parameters:
T - The service this list holds implementations of.
All Implemented Interfaces:
Iterable<T>

public class ExtensionList<T> extends Object implements Iterable<T>
This List looks up services as extensions in equinox.
The extension point must be the class name of the service interface.
The query attributes are checked against the attributes of the extension configuration element.

In order to minimize equinox lookups, a filtering iterator is used.

Author:
viola
  • Constructor Details

    • ExtensionList

      public ExtensionList(Class<T> clazz, String extensionPointId)
      Parameters:
      clazz -
      extensionPointId -
    • ExtensionList

      public ExtensionList(Class<T> type, String extensionPointId, String extensionId, ServiceQuery query)
      Parameters:
      type -
      extensionPointId -
      extensionId -
      query -
  • Method Details

    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
      Returns:
      Iterator
    • addFilter

      public void addFilter(String attribute, String value)
      add filter for discovery of extensions
      Parameters:
      attribute -
      value -
    • first

      public T first()
      Returns:
      first matching extension
    • asList

      public List<T> asList()
      Returns:
      list of matching extension