Package jadex.bdiv3
Class BDIAgentFactory
- java.lang.Object
- 
- jadex.bridge.service.BasicService
- 
- jadex.bdiv3.BDIAgentFactory
 
 
- 
- All Implemented Interfaces:
- IInternalService,- IService,- IBootstrapFactory,- IComponentFactory
 
 public class BDIAgentFactory extends BasicService implements IComponentFactory, IBootstrapFactory Factory for creating micro agents.
- 
- 
Field SummaryFields Modifier and Type Field Description static java.util.Collection<IComponentFeatureFactory>BDI_FEATURESThe specific component features for micro agents.static java.lang.StringCAPA_TYPEThe model type identifier for a capability.protected java.util.Collection<IComponentFeatureFactory>featuresThe standard + micro component features.static java.lang.StringFILETYPE_BDIAGENTThe BDI agent model type name (human readable for display).static java.lang.StringFILETYPE_BDICAPAThe BDI capability model type name (human readable for display).protected static LazyResourceICONThe image icon.protected ILibraryServicelibserviceThe library service.protected ILibraryServiceListenerlibservicelistenerThe library service listenerprotected BDIModelLoaderloaderThe application model loader.static java.util.Collection<IComponentFeatureFactory>NOPLATFORM_DEFAULT_FEATURESThe default component features.protected IInternalAccessproviderThe platform.static java.lang.StringTYPEThe model type identifier for use in the @Agent annotation.- 
Fields inherited from class jadex.bridge.service.BasicServiceidcnt, impltype, internalaccess, providerid, shutdowned, sid, started, type
 - 
Fields inherited from interface jadex.bridge.service.IServiceEMPTY_SERVICES
 
- 
 - 
Constructor SummaryConstructors Constructor Description BDIAgentFactory(IInternalAccess provider)Create a new agent factory.BDIAgentFactory(IInternalAccess provider, java.util.Map<java.lang.String,java.lang.Object> properties)Create a new agent factory.BDIAgentFactory(java.lang.String providerid)Create a new agent factory for startup.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddExcludedMethods(java.util.Map<java.lang.String,java.lang.String[]> props, java.lang.String[] excludes)Add excluded methods.IFuture<java.util.Collection<IComponentFeatureFactory>>getComponentFeatures(IModelInfo model)Get the component features for a model.IFuture<java.lang.String>getComponentType(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid)Get the component type of a model.IFuture<byte[]>getComponentTypeIcon(java.lang.String type)Get a default icon for a file type.java.lang.String[]getComponentTypes()Get the names of ADF file types supported by this factory.protected ILibraryServicegetLibraryService()Get the library servicestatic java.lang.StringgetLoadableType(SClassReader.ClassInfo ci)Get the model type from the class info.java.util.Map<java.lang.String,java.lang.Object>getProperties(java.lang.String type)Get the properties.IFuture<java.lang.Boolean>isLoadable(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid)Test if a model can be loaded by the factory.IFuture<java.lang.Boolean>isStartable(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid)Test if a model is startable (e.g.IFuture<SClassReader.ClassInfo>loadClassInfo0(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid)Load the class info for the model.IFuture<IModelInfo>loadModel(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid)Load a model.voidsetFeatures(java.util.Collection<IComponentFeatureFactory> features)Set the features.IFuture<java.lang.Void>shutdownService()Shutdown the service.IFuture<java.lang.Void>startService()Start the service.IFuture<java.lang.Void>startService(IInternalAccess component, IResourceIdentifier rid)Start the service.- 
Methods inherited from class jadex.bridge.service.BasicServicecreateServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getInterfaceType, getInternalAccess, getInvokeMethod, getMethodInfos, getMethodTimeout, getPropertyMap, getProviderId, getServiceId, hashCode, initNFProperties, invokeMethod, isValid, setComponentAccess, setPropertyMap, setServiceIdentifier, toString
 
- 
 
- 
- 
- 
Field Detail- 
NOPLATFORM_DEFAULT_FEATURESpublic static final java.util.Collection<IComponentFeatureFactory> NOPLATFORM_DEFAULT_FEATURES The default component features.
 - 
FILETYPE_BDIAGENTpublic static final java.lang.String FILETYPE_BDIAGENT The BDI agent model type name (human readable for display).- See Also:
- Constant Field Values
 
 - 
FILETYPE_BDICAPApublic static final java.lang.String FILETYPE_BDICAPA The BDI capability model type name (human readable for display).- See Also:
- Constant Field Values
 
 - 
TYPEpublic static final java.lang.String TYPE The model type identifier for use in the @Agent annotation.- See Also:
- Constant Field Values
 
 - 
CAPA_TYPEpublic static final java.lang.String CAPA_TYPE The model type identifier for a capability.- See Also:
- Constant Field Values
 
 - 
ICONprotected static final LazyResource ICON The image icon.
 - 
BDI_FEATURESpublic static final java.util.Collection<IComponentFeatureFactory> BDI_FEATURES The specific component features for micro agents.
 - 
loaderprotected BDIModelLoader loader The application model loader.
 - 
providerprotected IInternalAccess provider The platform.
 - 
libserviceprotected ILibraryService libservice The library service.
 - 
libservicelistenerprotected ILibraryServiceListener libservicelistener The library service listener
 - 
featuresprotected java.util.Collection<IComponentFeatureFactory> features The standard + micro component features.
 
- 
 - 
Constructor Detail- 
BDIAgentFactorypublic BDIAgentFactory(IInternalAccess provider) Create a new agent factory.
 - 
BDIAgentFactorypublic BDIAgentFactory(IInternalAccess provider, java.util.Map<java.lang.String,java.lang.Object> properties) Create a new agent factory.
 - 
BDIAgentFactorypublic BDIAgentFactory(java.lang.String providerid) Create a new agent factory for startup.- Parameters:
- platform- The platform.
 
 
- 
 - 
Method Detail- 
startServicepublic IFuture<java.lang.Void> startService(IInternalAccess component, IResourceIdentifier rid) Start the service.- Specified by:
- startServicein interface- IBootstrapFactory
- Parameters:
- component- The component.
- rid- The resource identifier.
 
 - 
startServicepublic IFuture<java.lang.Void> startService() Start the service.- Specified by:
- startServicein interface- IInternalService
- Overrides:
- startServicein class- BasicService
- Returns:
- A future that is done when the service has completed starting.
 
 - 
shutdownServicepublic IFuture<java.lang.Void> shutdownService() Shutdown the service.- Specified by:
- shutdownServicein interface- IInternalService
- Overrides:
- shutdownServicein class- BasicService
- Parameters:
- listener- The listener.
- Returns:
- A future that is done when the service has completed its shutdown.
 
 - 
getComponentFeaturespublic IFuture<java.util.Collection<IComponentFeatureFactory>> getComponentFeatures(IModelInfo model) Get the component features for a model.- Specified by:
- getComponentFeaturesin interface- IComponentFactory
- Parameters:
- model- The component model.
- Returns:
- The component features.
 
 - 
setFeaturespublic void setFeatures(java.util.Collection<IComponentFeatureFactory> features) Set the features.- Parameters:
- features- The features to set.
 
 - 
loadModelpublic IFuture<IModelInfo> loadModel(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid) Load a model.- Specified by:
- loadModelin interface- IComponentFactory
- Parameters:
- model- The model (e.g. file name).
- The- imports (if any).
- Returns:
- The loaded model.
 
 - 
isLoadablepublic IFuture<java.lang.Boolean> isLoadable(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid) Test if a model can be loaded by the factory.- Specified by:
- isLoadablein interface- IComponentFactory
- Parameters:
- model- The model (e.g. file name).
- The- imports (if any).
- Returns:
- True, if model can be loaded.
 
 - 
getLoadableTypepublic static java.lang.String getLoadableType(SClassReader.ClassInfo ci) Get the model type from the class info.- Returns:
- null, if no BDI model.
 
 - 
loadClassInfo0public IFuture<SClassReader.ClassInfo> loadClassInfo0(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid) Load the class info for the model.- Returns:
- null, if it could not be loaded.
 
 - 
getLibraryServiceprotected ILibraryService getLibraryService() Get the library service
 - 
isStartablepublic IFuture<java.lang.Boolean> isStartable(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid) Test if a model is startable (e.g. an component).- Specified by:
- isStartablein interface- IComponentFactory
- Parameters:
- model- The model (e.g. file name).
- The- imports (if any).
- Returns:
- True, if startable (and loadable).
 
 - 
getComponentTypespublic java.lang.String[] getComponentTypes() Get the names of ADF file types supported by this factory.- Specified by:
- getComponentTypesin interface- IComponentFactory
 
 - 
getComponentTypeIconpublic IFuture<byte[]> getComponentTypeIcon(java.lang.String type) Get a default icon for a file type.- Specified by:
- getComponentTypeIconin interface- IComponentFactory
 
 - 
getComponentTypepublic IFuture<java.lang.String> getComponentType(java.lang.String model, java.lang.String[] imports, IResourceIdentifier rid) Get the component type of a model.- Specified by:
- getComponentTypein interface- IComponentFactory
- Parameters:
- model- The model (e.g. file name).
- The- imports (if any).
 
 - 
getPropertiespublic java.util.Map<java.lang.String,java.lang.Object> getProperties(java.lang.String type) Get the properties. Arbitrary properties that can e.g. be used to define kernel-specific settings to configure tools.- Specified by:
- getPropertiesin interface- IComponentFactory
- Parameters:
- type- The component type.
- Returns:
- The properties or null, if the component type is not supported by this factory.
 
 - 
addExcludedMethodspublic static void addExcludedMethods(java.util.Map<java.lang.String,java.lang.String[]> props, java.lang.String[] excludes)Add excluded methods.
 
- 
 
-