public class ExternalAccess
extends java.lang.Object
implements jadex.bridge.IExternalAccess
Modifier and Type | Field and Description |
---|---|
protected jadex.bridge.IComponentIdentifier |
cid
The component identifier.
|
protected jadex.bridge.IInternalAccess |
ia
The component.
|
protected jadex.commons.future.Future<java.util.Map<java.lang.String,java.lang.Object>> |
killfut |
protected jadex.bridge.modelinfo.IModelInfo |
model
The model info (cached when persisted).
|
protected java.util.Map<java.lang.String,java.lang.Object> |
results
The results (cached after termination).
|
protected boolean |
terminated
The terminated flag.
|
protected java.lang.String |
tostring
The toString value.
|
protected boolean |
valid
The valid flag.
|
Constructor and Description |
---|
ExternalAccess(jadex.bridge.IInternalAccess ia)
Create an external access.
|
Modifier and Type | Method and Description |
---|---|
jadex.commons.future.IFuture<java.lang.Void> |
addNFProperty(jadex.bridge.nonfunctional.INFProperty<?,?> nfprop)
Add a non-functional property.
|
jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier> |
createChild(jadex.bridge.modelinfo.ComponentInstanceInfo component)
Create a subcomponent.
|
<T> jadex.commons.future.IResultListener<T> |
createResultListener(jadex.commons.future.IResultListener<T> listener)
Create a result listener that is executed on the
component thread.
|
jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> |
getArguments()
Get the arguments.
|
jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier[]> |
getChildren(java.lang.String type)
Get the children (if any).
|
jadex.bridge.IComponentIdentifier |
getComponentIdentifier()
Get the component identifier.
|
jadex.commons.future.IFuture<java.lang.String> |
getFileName(java.lang.String ctype)
Get the file name of a component type.
|
jadex.bridge.IInternalAccess |
getInternalAccess() |
java.lang.String |
getLocalType()
Get the local type name of this component as defined in the parent.
|
jadex.bridge.modelinfo.IModelInfo |
getModel()
Get the model.
|
jadex.commons.future.IFuture<java.lang.String[]> |
getNFAllPropertyNames()
Returns the names of all non-functional properties of this service.
|
jadex.commons.future.IFuture<jadex.bridge.nonfunctional.INFPropertyMetaInfo> |
getNFPropertyMetaInfo(java.lang.String name)
Returns the meta information about a non-functional property of this service.
|
jadex.commons.future.IFuture<java.util.Map<java.lang.String,jadex.bridge.nonfunctional.INFPropertyMetaInfo>> |
getNFPropertyMetaInfos()
Returns the meta information about a non-functional property of this service.
|
jadex.commons.future.IFuture<java.lang.String[]> |
getNFPropertyNames()
Returns the names of all non-functional properties of this service.
|
<T> jadex.commons.future.IFuture<T> |
getNFPropertyValue(java.lang.String name)
Returns the current value of a non-functional property of this service.
|
<T,U> jadex.commons.future.IFuture<T> |
getNFPropertyValue(java.lang.String name,
U unit)
Returns the current value of a non-functional property of this service, performs unit conversion.
|
jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> |
getResults()
Get the component results.
|
jadex.bridge.IExternalAccess |
getServiceContainer()
Deprecated.
From version 3.0 - replaced with external access.
Get the service container.
|
jadex.bridge.IExternalAccess |
getServiceProvider()
Deprecated.
From 3.0 - just use external access.
Get the application component.
|
boolean |
isExternalThread()
Test if current thread is external thread.
|
boolean |
isValid()
Check if the component is directly available.
|
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.
|
jadex.commons.future.IFuture<java.lang.Void> |
removeNFProperty(java.lang.String name)
Remove a non-functional property.
|
<T> jadex.commons.future.IFuture<T> |
scheduleStep(jadex.bridge.IComponentStep<T> step)
Schedule a step of the agent.
|
<T> jadex.commons.future.IFuture<T> |
scheduleStep(int priority,
jadex.bridge.IComponentStep<T> step)
Schedule a step of the agent.
|
jadex.commons.future.IFuture<java.lang.Void> |
shutdownNFPropertyProvider()
Shutdown the provider.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> |
subscribeToEvents(jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter,
boolean initial,
jadex.bridge.service.types.monitoring.IMonitoringService.PublishEventLevel elm)
Subscribe to component events.
|
jadex.commons.future.ISubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,java.lang.Object>> |
subscribeToResults()
Subscribe to receive results.
|
java.lang.String |
toString()
Get the string representation.
|
<T> jadex.commons.future.IFuture<T> |
waitForDelay(long delay,
jadex.bridge.IComponentStep<T> step)
Wait for some time and execute a component step afterwards.
|
<T> jadex.commons.future.IFuture<T> |
waitForDelay(long delay,
jadex.bridge.IComponentStep<T> step,
boolean realtime)
Wait for some time and execute a component step afterwards.
|
protected boolean valid
protected boolean terminated
protected jadex.bridge.IComponentIdentifier cid
protected jadex.bridge.IInternalAccess ia
protected java.lang.String tostring
protected jadex.bridge.modelinfo.IModelInfo model
protected java.util.Map<java.lang.String,java.lang.Object> results
protected volatile jadex.commons.future.Future<java.util.Map<java.lang.String,java.lang.Object>> killfut
public ExternalAccess(jadex.bridge.IInternalAccess ia)
public jadex.bridge.modelinfo.IModelInfo getModel()
getModel
in interface jadex.bridge.IExternalAccess
public jadex.bridge.IComponentIdentifier getComponentIdentifier()
getComponentIdentifier
in interface jadex.bridge.IExternalAccess
public jadex.bridge.IExternalAccess getServiceProvider()
getServiceProvider
in interface jadex.bridge.IExternalAccess
public jadex.bridge.IExternalAccess getServiceContainer()
getServiceContainer
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> killComponent()
killComponent
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> killComponent(java.lang.Exception e)
killComponent
in interface jadex.bridge.IExternalAccess
e
- The failure reason, if any.public jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier[]> getChildren(java.lang.String type)
getChildren
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<jadex.bridge.IComponentIdentifier> createChild(jadex.bridge.modelinfo.ComponentInstanceInfo component)
createChild
in interface jadex.bridge.IExternalAccess
component
- The instance info.public jadex.commons.future.IFuture<java.lang.String> getFileName(java.lang.String ctype)
getFileName
in interface jadex.bridge.IExternalAccess
ctype
- The component type.public java.lang.String getLocalType()
getLocalType
in interface jadex.bridge.IExternalAccess
public <T> jadex.commons.future.IFuture<T> scheduleStep(jadex.bridge.IComponentStep<T> step)
scheduleStep
in interface jadex.bridge.IExternalAccess
step
- Code to be executed as a step of the agent.public <T> jadex.commons.future.IFuture<T> scheduleStep(int priority, jadex.bridge.IComponentStep<T> step)
scheduleStep
in interface jadex.bridge.IExternalAccess
step
- Code to be executed as a step of the agent.public <T> jadex.commons.future.IFuture<T> waitForDelay(long delay, jadex.bridge.IComponentStep<T> step, boolean realtime)
waitForDelay
in interface jadex.bridge.IExternalAccess
public <T> jadex.commons.future.IFuture<T> waitForDelay(long delay, jadex.bridge.IComponentStep<T> step)
waitForDelay
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.bridge.service.types.monitoring.IMonitoringEvent> subscribeToEvents(jadex.commons.IFilter<jadex.bridge.service.types.monitoring.IMonitoringEvent> filter, boolean initial, jadex.bridge.service.types.monitoring.IMonitoringService.PublishEventLevel elm)
subscribeToEvents
in interface jadex.bridge.IExternalAccess
filter
- An optional filter.public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,java.lang.Object>> subscribeToResults()
subscribeToResults
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> getArguments()
getArguments
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,java.lang.Object>> getResults()
getResults
in interface jadex.bridge.IExternalAccess
public jadex.commons.future.IFuture<java.util.Map<java.lang.String,jadex.bridge.nonfunctional.INFPropertyMetaInfo>> getNFPropertyMetaInfos()
name
- Name of the property.public jadex.commons.future.IFuture<java.lang.String[]> getNFPropertyNames()
public jadex.commons.future.IFuture<java.lang.String[]> getNFAllPropertyNames()
public jadex.commons.future.IFuture<jadex.bridge.nonfunctional.INFPropertyMetaInfo> getNFPropertyMetaInfo(java.lang.String name)
name
- Name of the property.public <T> jadex.commons.future.IFuture<T> getNFPropertyValue(java.lang.String name)
name
- Name of the property.public <T,U> jadex.commons.future.IFuture<T> getNFPropertyValue(java.lang.String name, U unit)
name
- Name of the property.type
- Type of the property value.unit
- Unit of the property value.public jadex.commons.future.IFuture<java.lang.Void> addNFProperty(jadex.bridge.nonfunctional.INFProperty<?,?> nfprop)
nfprop
- The property.public jadex.commons.future.IFuture<java.lang.Void> removeNFProperty(java.lang.String name)
The
- name.public jadex.commons.future.IFuture<java.lang.Void> shutdownNFPropertyProvider()
public boolean isExternalThread()
isExternalThread
in interface jadex.bridge.IExternalAccess
public boolean isValid()
public <T> jadex.commons.future.IResultListener<T> createResultListener(jadex.commons.future.IResultListener<T> listener)
public jadex.bridge.IInternalAccess getInternalAccess()
public java.lang.String toString()
toString
in class java.lang.Object