public class PlatformComponent
extends java.lang.Object
implements jadex.bridge.service.types.factory.IPlatformComponentAccess, jadex.bridge.IInternalAccess
Modifier and Type | Field and Description |
---|---|
protected java.lang.Exception |
exception
The failure reason (if any).
|
protected java.util.Map<java.lang.Class<?>,jadex.bridge.component.IComponentFeature> |
features
The features.
|
protected jadex.commons.IValueFetcher |
fetcher
The combined value fetcher (cached for speed).
|
protected java.util.List<jadex.bridge.component.IComponentFeature> |
ifeatures
The inited feature instances as list (for shutdown after failed init).
|
protected jadex.bridge.component.ComponentCreationInfo |
info
The creation info.
|
protected java.util.List<jadex.bridge.component.IComponentFeature> |
lfeatures
The feature instances as list (for reverse execution, cached for speed).
|
protected java.util.logging.Logger |
logger
The logger.
|
static java.lang.String |
PROPERTY_TERMINATION_TIMEOUT
Property name for timeout after which component long running cleanup is forcefully aborted.
|
Constructor and Description |
---|
PlatformComponent() |
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.Void> |
body()
Perform the main execution of the component (if any).
|
void |
create(jadex.bridge.component.ComponentCreationInfo info,
java.util.Collection<jadex.bridge.component.IComponentFeatureFactory> facs)
Create the component, i.e.
|
protected jadex.commons.future.IFuture<java.lang.Void> |
executeBodyOnFeatures(java.util.Iterator<jadex.bridge.component.IComponentFeature> features)
Execute feature bodies in parallel.
|
protected jadex.commons.future.IFuture<java.lang.Void> |
executeInitOnFeatures(java.util.Iterator<jadex.bridge.component.IComponentFeature> features)
Recursively init the features.
|
protected void |
executeKillOnFeatures(java.util.List<jadex.bridge.component.IComponentFeature> features)
Kill the features in inverse order.
|
protected jadex.commons.future.IFuture<java.lang.Void> |
executeShutdownOnFeatures(java.util.List<jadex.bridge.component.IComponentFeature> features)
Recursively shutdown the features in inverse order.
|
java.lang.Object |
getArgument(java.lang.String name)
Deprecated.
From 3.0. Use getComponentFeature(IArgumentsResultsFeature.class).getArguments()
Get an argument value per name.
|
jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier[]> |
getChildren(java.lang.String type)
Get the children (if any).
|
java.lang.ClassLoader |
getClassLoader()
Get the class loader of the component.
|
jadex.bridge.service.types.cms.IComponentDescription |
getComponentDescription()
Get the component description.
|
<T> T |
getComponentFeature(java.lang.Class<? extends T> type)
Get a feature of the component.
|
<T> T |
getComponentFeature0(java.lang.Class<? extends T> type)
Get a feature of the component.
|
java.lang.String |
getComponentFilename(java.lang.String type)
Get the file name for a logical type name of a subcomponent of this application.
|
jadex.bridge.IComponentIdentifier |
getComponentIdentifier()
Get the id of the component.
|
java.lang.String |
getConfiguration()
Get the start configuration or the default configuration if any.
|
int |
getEndstateStart()
Get the step number when endstate began.
|
java.lang.Exception |
getException()
Get the exception, if any.
|
jadex.bridge.IExternalAccess |
getExternalAccess()
Get the external access.
|
jadex.commons.IValueFetcher |
getFetcher()
Get the fetcher.
|
jadex.bridge.IInternalAccess |
getInternalAccess()
Get the user view of this platform component.
|
jadex.bridge.IInternalAccess |
getInterpreter()
Deprecated.
From 3.0. Use internal access.
|
java.util.logging.Logger |
getLogger()
Get the logger.
|
static java.lang.String |
getLoggerName(jadex.bridge.IComponentIdentifier cid)
Get the logger name.
|
jadex.bridge.modelinfo.IModelInfo |
getModel()
Get the model of the component.
|
jadex.commons.IParameterGuesser |
getParameterGuesser()
Get the parameter guesser.
|
<T> jadex.commons.future.IFuture<T> |
getRequiredService(java.lang.String name)
Deprecated.
From version 3.0 - Use getComponentFeature(IRequiredServicesFeatures.class).getRequiredService()
Get a required service of a given name.
|
jadex.bridge.IInternalAccess |
getServiceContainer()
Deprecated.
From version 3.0 - replaced with internal access.
Get the service provider.
|
jadex.bridge.IInternalAccess |
getServiceProvider()
Deprecated.
From version 3.0 - replaced with internal access.
Get the service provider.
|
jadex.commons.future.IFuture<java.lang.Void> |
init()
Perform the initialization of the component.
|
protected void |
initLogger(java.util.logging.Logger logger)
Init the logger with capability settings.
|
jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> |
killComponent()
Kill the component.
|
jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> |
killComponent(java.lang.Exception e)
Kill the component.
|
<T> jadex.commons.future.IFuture<T> |
scheduleStep(jadex.bridge.IComponentStep<T> step)
Deprecated.
From version 3.0 - replaced with getComponentFeature(IExecutionFeature.class).scheduleStep()
Execute a component step.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdown()
Perform the shutdown of the component (if any).
|
java.lang.String |
toString()
Get a string representation.
|
<T> jadex.commons.future.IFuture<T> |
waitForDelay(long delay,
jadex.bridge.IComponentStep<T> step)
Deprecated.
From version 3.0 - replaced with getComponentFeature(IExecutionFeature.class).waitForDelay()
Wait for some time and execute a component step afterwards.
|
public static final java.lang.String PROPERTY_TERMINATION_TIMEOUT
protected jadex.bridge.component.ComponentCreationInfo info
protected java.util.Map<java.lang.Class<?>,jadex.bridge.component.IComponentFeature> features
protected java.util.List<jadex.bridge.component.IComponentFeature> lfeatures
protected java.util.List<jadex.bridge.component.IComponentFeature> ifeatures
protected java.util.logging.Logger logger
protected java.lang.Exception exception
protected jadex.commons.IValueFetcher fetcher
public void create(jadex.bridge.component.ComponentCreationInfo info, java.util.Collection<jadex.bridge.component.IComponentFeatureFactory> facs)
create
in interface jadex.bridge.service.types.factory.IPlatformComponentAccess
info
- The component creation info.platformdata
- The shared objects for all components of the same platform (registry etc.). See starter for available data.facs
- The factories for component features to be instantiated for this component.public jadex.commons.future.IFuture<java.lang.Void> init()
init
in interface jadex.bridge.service.types.factory.IPlatformComponentAccess
public jadex.commons.future.IFuture<java.lang.Void> body()
body
in interface jadex.bridge.service.types.factory.IPlatformComponentAccess
public jadex.commons.future.IFuture<java.lang.Void> shutdown()
shutdown
in interface jadex.bridge.service.types.factory.IPlatformComponentAccess
protected jadex.commons.future.IFuture<java.lang.Void> executeInitOnFeatures(java.util.Iterator<jadex.bridge.component.IComponentFeature> features)
protected jadex.commons.future.IFuture<java.lang.Void> executeBodyOnFeatures(java.util.Iterator<jadex.bridge.component.IComponentFeature> features)
protected jadex.commons.future.IFuture<java.lang.Void> executeShutdownOnFeatures(java.util.List<jadex.bridge.component.IComponentFeature> features)
protected void executeKillOnFeatures(java.util.List<jadex.bridge.component.IComponentFeature> features)
public jadex.bridge.IInternalAccess getInternalAccess()
getInternalAccess
in interface jadex.bridge.IInternalAccess
getInternalAccess
in interface jadex.bridge.service.types.factory.IPlatformComponentAccess
public java.lang.Exception getException()
getException
in interface jadex.bridge.IInternalAccess
public jadex.bridge.IInternalAccess getServiceContainer()
getServiceContainer
in interface jadex.bridge.IInternalAccess
public java.lang.Object getArgument(java.lang.String name)
getArgument
in interface jadex.bridge.IInternalAccess
name
- The argument name.public jadex.bridge.IInternalAccess getInterpreter()
getInterpreter
in interface jadex.bridge.IInternalAccess
public jadex.bridge.IInternalAccess getServiceProvider()
getServiceProvider
in interface jadex.bridge.IInternalAccess
public <T> jadex.commons.future.IFuture<T> getRequiredService(java.lang.String name)
getRequiredService
in interface jadex.bridge.IInternalAccess
name
- The service name.public <T> jadex.commons.future.IFuture<T> scheduleStep(jadex.bridge.IComponentStep<T> step)
scheduleStep
in interface jadex.bridge.IInternalAccess
public <T> jadex.commons.future.IFuture<T> waitForDelay(long delay, jadex.bridge.IComponentStep<T> step)
waitForDelay
in interface jadex.bridge.IInternalAccess
public jadex.bridge.modelinfo.IModelInfo getModel()
getModel
in interface jadex.bridge.IInternalAccess
public java.lang.String getConfiguration()
getConfiguration
in interface jadex.bridge.IInternalAccess
public jadex.bridge.IComponentIdentifier getComponentIdentifier()
getComponentIdentifier
in interface jadex.bridge.IInternalAccess
public jadex.bridge.service.types.cms.IComponentDescription getComponentDescription()
getComponentDescription
in interface jadex.bridge.IInternalAccess
public <T> T getComponentFeature(java.lang.Class<? extends T> type)
getComponentFeature
in interface jadex.bridge.IInternalAccess
feature
- The type of the feature.public <T> T getComponentFeature0(java.lang.Class<? extends T> type)
getComponentFeature0
in interface jadex.bridge.IInternalAccess
feature
- The type of the feature.public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> killComponent()
killComponent
in interface jadex.bridge.IInternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> killComponent(java.lang.Exception e)
killComponent
in interface jadex.bridge.IInternalAccess
e
- The failure reason, if any.public jadex.bridge.IExternalAccess getExternalAccess()
getExternalAccess
in interface jadex.bridge.IInternalAccess
public java.util.logging.Logger getLogger()
getLogger
in interface jadex.bridge.IInternalAccess
public static java.lang.String getLoggerName(jadex.bridge.IComponentIdentifier cid)
cid
- The component identifier.protected void initLogger(java.util.logging.Logger logger)
logger
- The logger.public jadex.commons.IValueFetcher getFetcher()
getFetcher
in interface jadex.bridge.IInternalAccess
public jadex.commons.IParameterGuesser getParameterGuesser()
getParameterGuesser
in interface jadex.bridge.IInternalAccess
public java.lang.ClassLoader getClassLoader()
getClassLoader
in interface jadex.bridge.IInternalAccess
public jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier[]> getChildren(java.lang.String type)
getChildren
in interface jadex.bridge.IInternalAccess
public java.lang.String getComponentFilename(java.lang.String type)
public int getEndstateStart()
public java.lang.String toString()
toString
in class java.lang.Object