Package jadex.core.impl
Class FeatureProvider<T>
java.lang.Object
jadex.core.impl.FeatureProvider<T>
A feature providers is loaded from the classpath and adds a specific feature to components.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract T
Create an instance of the feature.Get the type of the feature used for accessing.getPredecessors
(Set<Class<?>> all) Get the predecessors, i.e.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.boolean
Determines if the feature is created immediately on component startup (false) or later on first access (true).boolean
replacesFeatureProvider
(FeatureProvider<T> provider) Allow a feature implementation to replace another implementation.
-
Constructor Details
-
FeatureProvider
public FeatureProvider()
-
-
Method Details
-
getFeatureType
Get the type of the feature used for accessing. -
createFeatureInstance
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
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
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 typegetRequiredComponentType()
and have the samegetFeatureType()
.- 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
Get the predecessors, i.e. features that should be inited first.- Returns:
- The predecessors.
-