Package jadex.bridge.component.impl
Class AbstractComponentFeature
- java.lang.Object
-
- jadex.bridge.component.impl.AbstractComponentFeature
-
- All Implemented Interfaces:
IComponentFeature
- Direct Known Subclasses:
ArgumentsResultsComponentFeature
,ComponentLifecycleFeature
,ExecutionComponentFeature
,MessageComponentFeature
,MonitoringComponentFeature
,NFPropertyComponentFeature
,PropertiesComponentFeature
,ProvidedServicesComponentFeature
,RemoteExecutionComponentFeature
,RequiredServicesComponentFeature
,SubcomponentsComponentFeature
public abstract class AbstractComponentFeature extends java.lang.Object implements IComponentFeature
Abstract feature that implements basic feature methods.
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentCreationInfo
cinfo
The creation info.protected IInternalAccess
component
The component.protected jadex.commons.IParameterGuesser
guesser
The parameter guesser.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Factory method constructor for instance level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description jadex.commons.future.IFuture<java.lang.Void>
body()
Execute the main activity of the feature.IClockService
getClockService()
Get the clock service.PlatformComponent
getComponent()
Get the component access.IExecutionService
getExecutionService()
Get the execution service.<T> T
getExternalFacade(java.lang.Object context)
Get external feature facade.<T> java.lang.Class<T>
getExternalFacadeType(java.lang.Object context)
IInternalAccess
getInternalAccess()
Get the component access.jadex.commons.IParameterGuesser
getParameterGuesser()
The feature can add objects for field or method injections by providing an optional parameter guesser.jadex.commons.IValueFetcher
getValueFetcher()
The feature can inject parameters for expression evaluation by providing an optional value fetcher.boolean
hasUserBody()
Check if the feature potentially executed user code in body.jadex.commons.future.IFuture<java.lang.Void>
init()
Initialize the feature.void
kill()
Kill is only invoked, when shutdown of some (e.g.jadex.commons.future.IFuture<java.lang.Void>
shutdown()
Shutdown the feature.
-
-
-
Field Detail
-
component
protected IInternalAccess component
The component.
-
cinfo
protected ComponentCreationInfo cinfo
The creation info.
-
guesser
protected jadex.commons.IParameterGuesser guesser
The parameter guesser.
-
-
Constructor Detail
-
AbstractComponentFeature
protected AbstractComponentFeature(IInternalAccess component, ComponentCreationInfo cinfo)
Factory method constructor for instance level.
-
-
Method Detail
-
getInternalAccess
public IInternalAccess getInternalAccess()
Get the component access.
-
getComponent
public PlatformComponent getComponent()
Get the component access.
-
init
public jadex.commons.future.IFuture<java.lang.Void> init()
Initialize the feature. Empty implementation that can be overridden.- Specified by:
init
in interfaceIComponentFeature
-
body
public jadex.commons.future.IFuture<java.lang.Void> body()
Execute the main activity of the feature.- Specified by:
body
in interfaceIComponentFeature
-
hasUserBody
public boolean hasUserBody()
Check if the feature potentially executed user code in body. Allows blocking operations in user bodies by using separate steps for each feature. Non-user-body-features are directly executed for speed. If unsure just return true. ;-)- Specified by:
hasUserBody
in interfaceIComponentFeature
-
shutdown
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
Shutdown the feature.- Specified by:
shutdown
in interfaceIComponentFeature
-
kill
public void kill()
Kill is only invoked, when shutdown of some (e.g. other) feature does not return due to timeout. The feature should do any kind of possible cleanup, but no asynchronous operations.- Specified by:
kill
in interfaceIComponentFeature
-
getExternalFacade
public <T> T getExternalFacade(java.lang.Object context)
Get external feature facade.
-
getExternalFacadeType
public <T> java.lang.Class<T> getExternalFacadeType(java.lang.Object context)
-
getValueFetcher
public jadex.commons.IValueFetcher getValueFetcher()
The feature can inject parameters for expression evaluation by providing an optional value fetcher. The fetch order is the reverse init order, i.e., later features can override values from earlier features.- Specified by:
getValueFetcher
in interfaceIComponentFeature
-
getParameterGuesser
public jadex.commons.IParameterGuesser getParameterGuesser()
The feature can add objects for field or method injections by providing an optional parameter guesser. The selection order is the reverse init order, i.e., later features can override values from earlier features.- Specified by:
getParameterGuesser
in interfaceIComponentFeature
-
getClockService
public IClockService getClockService()
Get the clock service.- Returns:
- The clock service.
-
getExecutionService
public IExecutionService getExecutionService()
Get the execution service.- Returns:
- The execution service.
-
-