Class FeatureProvider<T>

java.lang.Object
jadex.core.impl.FeatureProvider<T>

public abstract class FeatureProvider<T> extends Object
A feature providers is loaded from the classpath and adds a specific feature to components.
  • Constructor Details

    • FeatureProvider

      public FeatureProvider()
  • Method Details

    • getFeatureType

      public abstract Class<T> getFeatureType()
      Get the type of the feature used for accessing.
    • createFeatureInstance

      public abstract T createFeatureInstance(Component self)
      Create an instance of the feature. Can be a subclass or interface implementation of the feature type.
      Parameters:
      self - The component to which the feature belongs.
      Returns:
      The feature instance.
    • getRequiredComponentType

      public Class<? extends Component> getRequiredComponentType()
      If the feature does not apply to all kinds of components, you can provide a specific subtype and then this feature is only added to components of this type (e.g. BDI features only for BDI agents).
      Returns:
      A subtype of Component.
    • replacesFeatureProvider

      public boolean replacesFeatureProvider(FeatureProvider<T> provider)
      Allow a feature implementation to replace another implementation. This method is called for any feature provider, where two or more different providers are in the classpath, which apply to the same component type getRequiredComponentType() and have the same getFeatureType().
      Returns:
      True, if this implementation should be used and the other one ignored.
    • isLazyFeature

      public boolean isLazyFeature()
      Determines if the feature is created immediately on component startup (false) or later on first access (true).
      Returns:
      Defaults to false.
    • getPredecessors

      public Set<Class<?>> getPredecessors(Set<Class<?>> all)
      Get the predecessors, i.e. features that should be inited first.
      Returns:
      The predecessors.