Package jadex.bridge.modelinfo
Class ModelInfo
- java.lang.Object
-
- jadex.bridge.modelinfo.Startable
-
- jadex.bridge.modelinfo.ModelInfo
-
- All Implemented Interfaces:
IModelInfo
- Direct Known Subclasses:
BDIXModel
public class ModelInfo extends Startable implements IModelInfo
Public model information that is provided as result from component factories when a model is loaded.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
allimports
All imports (cached for speed).protected java.util.List<IArgument>
arguments
The arguments.protected java.lang.String[]
breakpoints
The breakpoints.protected java.lang.ClassLoader
classloader
The classloader.protected java.util.List<ConfigurationInfo>
configurations
The configurations.protected IComponentFeatureFactory[]
features
The component features.protected java.lang.String
filename
The filename.protected java.lang.String
fullname
The full name (cached for speed).protected java.util.List<java.lang.String>
imports
The imports.protected java.lang.String
name
The name.protected java.lang.String
namehint
The name hint for instances of this model.protected java.util.List<NFPropertyInfo>
nfproperties
The nf properties.protected java.lang.String
packagename
The package.protected java.lang.String[]
predecessors
The predecessors.protected java.util.Map<java.lang.String,java.lang.Object>
properties
The properties.protected java.util.List<ProvidedServiceInfo>
providedservices
The provided services.protected java.lang.Object
rawmodel
The raw model.protected IErrorReport
report
The report.protected java.util.Map<java.lang.String,RequiredServiceInfo>
requiredservices
The required services.protected java.util.List<IArgument>
results
The results.protected IResourceIdentifier
rid
The resource identifier.protected boolean
startable
Flag if startable.protected java.util.List<SubcomponentTypeInfo>
subcomponents
The subcomponent types.protected java.lang.String[]
successors
The predecessors.protected java.lang.String
type
The type.-
Fields inherited from class jadex.bridge.modelinfo.Startable
description
-
-
Constructor Summary
Constructors Constructor Description ModelInfo()
Create a new model info.ModelInfo(java.lang.String name, java.lang.String packagename, java.lang.String description, IErrorReport report, IArgument[] arguments, IArgument[] results, boolean startable, java.lang.String filename, java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.ClassLoader classloader, RequiredServiceInfo[] requiredservices, ProvidedServiceInfo[] providedservices, ConfigurationInfo[] configurations, SubcomponentTypeInfo[] subcomponents, java.lang.String[] imports, IResourceIdentifier rid, java.lang.Object rawmodel, IComponentFeatureFactory[] features)
Create a new model info.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArgument(IArgument argument)
Add an argument.void
addConfiguration(ConfigurationInfo configuration)
Add a configuration.void
addImport(java.lang.String imp)
Add an import statement.void
addNFProperty(NFPropertyInfo pi)
Add a non functional property.void
addPredecessors(java.lang.String[] predecessors)
Adds required predecessors (dependencies).void
addProperty(UnparsedExpression unexp)
Add a property.void
addProperty(java.lang.String name, java.lang.Object value)
Add a property.void
addProvidedService(ProvidedServiceInfo providedservice)
Add a provided service.void
addRequiredService(RequiredServiceInfo requiredservice)
Add a required service.void
addResult(IArgument result)
Add a result.void
addSubcomponentType(SubcomponentTypeInfo subcomponent)
Add a subcomponent type.void
addSuccessors(java.lang.String[] successors)
Adds required predecessors (dependencies).boolean
checkName()
Check if the specified name matches the file name.boolean
checkPackage()
Check if the specified package matches the file name.java.lang.String[]
getAllImports()
Get the imports including the package.IArgument
getArgument(java.lang.String name)
Get an argument per name.IArgument[]
getArguments()
Get the arguments.java.lang.String[]
getBreakpoints()
Get the possible breakpoint places in that model.java.lang.ClassLoader
getClassLoader()
Return the class loader corresponding to the model.ConfigurationInfo
getConfiguration(java.lang.String name)
Get a configuration.java.lang.String[]
getConfigurationNames()
Get the configurations.ConfigurationInfo[]
getConfigurations()
Get the configurations.IComponentFeatureFactory[]
getFeatures()
Get the features.java.lang.String
getFilename()
Get the filename.java.lang.String
getFullName()
Get the full model name (package.name)java.lang.String[]
getImports()
Get the imports.java.lang.Boolean
getKeepalive(java.lang.String configname)
Get the keepalive flag.IMonitoringService.PublishEventLevel
getMonitoring(java.lang.String configname)
Get the monitoring flag.java.lang.String
getName()
Get the name.java.lang.String
getNameHint()
Get the namehint.java.util.List<NFPropertyInfo>
getNFProperties()
Get the nfproperties.java.lang.String
getPackage()
Get the package name.java.lang.String[]
getPredecessors()
Get required predecessors (dependencies).java.util.Map<java.lang.String,java.lang.Object>
getProperties()
Get the properties.java.lang.Object
getProperty(java.lang.String name, java.lang.ClassLoader cl)
Get a parsed property.ProvidedServiceInfo[]
getProvidedServices()
Get the provided services.java.lang.Object
getRawModel()
Get the kernel-specific model.IErrorReport
getReport()
Get the report.IResourceIdentifier
getResourceIdentifier()
Return the resource identifier.IArgument
getResult(java.lang.String name)
Get a result per name.IArgument[]
getResults()
Get the results.RequiredServiceInfo
getService(java.lang.String name)
Get the required service.RequiredServiceInfo[]
getServices()
Get the required services.SubcomponentTypeInfo[]
getSubcomponentTypes()
Get the subcomponent names.java.lang.String[]
getSuccessors()
Get declared successors (dependencies).java.lang.Boolean
getSuspend(java.lang.String configname)
Get the suspend flag.java.lang.Boolean
getSynchronous(java.lang.String configname)
Get the synchronous flag.java.lang.String
getType()
Get the model type.void
internalSetRawModel(java.lang.Object rawmodel)
Set the kernel-specific model.boolean
isStartable()
Is the model startable.void
removeProvidedService(ProvidedServiceInfo providedservice)
Remove a provided service.void
removeRequiredService(RequiredServiceInfo requiredservice)
Remove a required service.void
setArguments(IArgument[] arguments)
Set the arguments.void
setBreakpoints(java.lang.String[] breakpoints)
Set the breakpoints.void
setClassloader(java.lang.ClassLoader classloader)
Set the classloader.void
setConfigurations(ConfigurationInfo[] configurations)
Set the configurations.void
setFeatures(IComponentFeatureFactory[] features)
The features to set.void
setFilename(java.lang.String filename)
Set the filename.void
setImports(java.lang.String[] imports)
Set the imports.void
setName(java.lang.String name)
Set the name.void
setNameHint(java.lang.String namehint)
Set the namehint.void
setNFProperties(java.util.List<NFPropertyInfo> nfproperties)
Set the nfproperties.void
setPackage(java.lang.String packagename)
Set the packagename.void
setPredecessors(java.lang.String[] predecessors)
Set required predecessors (dependencies).void
setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Set the properties.void
setProvidedServices(ProvidedServiceInfo[] providedservices)
Set the provided services.void
setReport(IErrorReport report)
Set the report.void
setRequiredServices(RequiredServiceInfo[] requiredservices)
Set the required services.void
setResourceIdentifier(IResourceIdentifier rid)
Set the resource identifier.void
setResults(IArgument[] results)
Set the results.void
setStartable(boolean startable)
Set the startable.void
setSubcomponentTypes(SubcomponentTypeInfo[] subcomponents)
Set the subcomponent types.void
setSuccessors(java.lang.String[] successors)
Set declared successors (dependencies).void
setType(java.lang.String type)
Set the component type.-
Methods inherited from class jadex.bridge.modelinfo.Startable
getDescription, getKeepalive, getMonitoring, getSuspend, getSynchronous, setDescription, setKeepalive, setMonitoring, setSuspend, setSynchronous
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jadex.bridge.modelinfo.IModelInfo
getDescription
-
-
-
-
Field Detail
-
name
protected java.lang.String name
The name.
-
packagename
protected java.lang.String packagename
The package.
-
predecessors
protected java.lang.String[] predecessors
The predecessors.
-
successors
protected java.lang.String[] successors
The predecessors.
-
imports
protected java.util.List<java.lang.String> imports
The imports.
-
allimports
protected java.lang.String[] allimports
All imports (cached for speed).
-
report
protected IErrorReport report
The report.
-
configurations
protected java.util.List<ConfigurationInfo> configurations
The configurations.
-
arguments
protected java.util.List<IArgument> arguments
The arguments.
-
results
protected java.util.List<IArgument> results
The results.
-
startable
protected boolean startable
Flag if startable.
-
filename
protected java.lang.String filename
The filename.
-
type
protected java.lang.String type
The type.
-
fullname
protected java.lang.String fullname
The full name (cached for speed).
-
properties
protected java.util.Map<java.lang.String,java.lang.Object> properties
The properties.
-
nfproperties
protected java.util.List<NFPropertyInfo> nfproperties
The nf properties.
-
classloader
protected java.lang.ClassLoader classloader
The classloader.
-
requiredservices
protected java.util.Map<java.lang.String,RequiredServiceInfo> requiredservices
The required services.
-
providedservices
protected java.util.List<ProvidedServiceInfo> providedservices
The provided services.
-
subcomponents
protected java.util.List<SubcomponentTypeInfo> subcomponents
The subcomponent types.
-
rid
protected IResourceIdentifier rid
The resource identifier.
-
breakpoints
protected java.lang.String[] breakpoints
The breakpoints.
-
rawmodel
protected java.lang.Object rawmodel
The raw model.
-
features
protected IComponentFeatureFactory[] features
The component features.
-
namehint
protected java.lang.String namehint
The name hint for instances of this model.
-
-
Constructor Detail
-
ModelInfo
public ModelInfo()
Create a new model info.
-
ModelInfo
public ModelInfo(java.lang.String name, java.lang.String packagename, java.lang.String description, IErrorReport report, IArgument[] arguments, IArgument[] results, boolean startable, java.lang.String filename, java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.ClassLoader classloader, RequiredServiceInfo[] requiredservices, ProvidedServiceInfo[] providedservices, ConfigurationInfo[] configurations, SubcomponentTypeInfo[] subcomponents, java.lang.String[] imports, IResourceIdentifier rid, java.lang.Object rawmodel, IComponentFeatureFactory[] features)
Create a new model info.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name.- Specified by:
getName
in interfaceIModelInfo
- Returns:
- The name.
-
getPredecessors
public java.lang.String[] getPredecessors()
Get required predecessors (dependencies).- Specified by:
getPredecessors
in interfaceIModelInfo
-
getSuccessors
public java.lang.String[] getSuccessors()
Get declared successors (dependencies).- Specified by:
getSuccessors
in interfaceIModelInfo
-
getPackage
public java.lang.String getPackage()
Get the package name.- Specified by:
getPackage
in interfaceIModelInfo
- Returns:
- The package name.
-
getFullName
public java.lang.String getFullName()
Get the full model name (package.name)- Specified by:
getFullName
in interfaceIModelInfo
- Returns:
- The full name.
-
getImports
public java.lang.String[] getImports()
Get the imports.- Specified by:
getImports
in interfaceIModelInfo
- Returns:
- The imports.
-
getAllImports
public java.lang.String[] getAllImports()
Get the imports including the package.- Specified by:
getAllImports
in interfaceIModelInfo
- Returns:
- The imports.
-
addImport
public void addImport(java.lang.String imp)
Add an import statement.
-
getReport
public IErrorReport getReport()
Get the report.- Specified by:
getReport
in interfaceIModelInfo
- Returns:
- The report.
-
getConfigurationNames
public java.lang.String[] getConfigurationNames()
Get the configurations.- Specified by:
getConfigurationNames
in interfaceIModelInfo
- Returns:
- The configuration.
-
getConfigurations
public ConfigurationInfo[] getConfigurations()
Get the configurations.- Specified by:
getConfigurations
in interfaceIModelInfo
- Returns:
- The configuration.
-
getConfiguration
public ConfigurationInfo getConfiguration(java.lang.String name)
Get a configuration.- Specified by:
getConfiguration
in interfaceIModelInfo
- Returns:
- The configuration.
-
getArguments
public IArgument[] getArguments()
Get the arguments.- Specified by:
getArguments
in interfaceIModelInfo
- Returns:
- The arguments.
-
getArgument
public IArgument getArgument(java.lang.String name)
Get an argument per name.- Specified by:
getArgument
in interfaceIModelInfo
- Parameters:
name
- The name.- Returns:
- The argument.
-
getResults
public IArgument[] getResults()
Get the results.- Specified by:
getResults
in interfaceIModelInfo
- Returns:
- The results.
-
getResult
public IArgument getResult(java.lang.String name)
Get a result per name.- Specified by:
getResult
in interfaceIModelInfo
- Parameters:
name
- The name.- Returns:
- The result.
-
isStartable
public boolean isStartable()
Is the model startable.- Specified by:
isStartable
in interfaceIModelInfo
- Returns:
- True, if startable.
-
getType
public java.lang.String getType()
Get the model type.- Specified by:
getType
in interfaceIModelInfo
- Returns:
- The model type (kernel specific).
-
getFilename
public java.lang.String getFilename()
Get the filename.- Specified by:
getFilename
in interfaceIModelInfo
- Returns:
- The filename.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Get the properties. Arbitrary properties that can e.g. be used to define model-specific settings to configure tools.- Specified by:
getProperties
in interfaceIModelInfo
- Returns:
- The properties.
-
getProperty
public java.lang.Object getProperty(java.lang.String name, java.lang.ClassLoader cl)
Get a parsed property. Unlike raw properties, which may be parsed or unparsed, this method always returns parsed property values.- Specified by:
getProperty
in interfaceIModelInfo
- Parameters:
name
- The property name.- Returns:
- The property value or null if property not defined.
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Return the class loader corresponding to the model.- Returns:
- The class loader corresponding to the model.
-
getNFProperties
public java.util.List<NFPropertyInfo> getNFProperties()
Get the nfproperties.- Specified by:
getNFProperties
in interfaceIModelInfo
- Returns:
- The nfproperties.
-
setNFProperties
public void setNFProperties(java.util.List<NFPropertyInfo> nfproperties)
Set the nfproperties.- Parameters:
nfproperties
- The nfproperties to set.
-
addNFProperty
public void addNFProperty(NFPropertyInfo pi)
Add a non functional property.
-
getResourceIdentifier
public IResourceIdentifier getResourceIdentifier()
Return the resource identifier.- Specified by:
getResourceIdentifier
in interfaceIModelInfo
- Returns:
- The resource identifier.
-
setName
public void setName(java.lang.String name)
Set the name.- Parameters:
name
- The name to set.
-
addPredecessors
public void addPredecessors(java.lang.String[] predecessors)
Adds required predecessors (dependencies).
-
setPredecessors
public void setPredecessors(java.lang.String[] predecessors)
Set required predecessors (dependencies).
-
addSuccessors
public void addSuccessors(java.lang.String[] successors)
Adds required predecessors (dependencies).
-
setSuccessors
public void setSuccessors(java.lang.String[] successors)
Set declared successors (dependencies).
-
setPackage
public void setPackage(java.lang.String packagename)
Set the packagename.- Parameters:
packagename
- The packagename to set.
-
setReport
public void setReport(IErrorReport report)
Set the report.- Parameters:
report
- The report to set.
-
setImports
public void setImports(java.lang.String[] imports)
Set the imports.- Parameters:
imports
- The imports to set.
-
setConfigurations
public void setConfigurations(ConfigurationInfo[] configurations)
Set the configurations.- Parameters:
configurations
- The configurations to set.
-
addConfiguration
public void addConfiguration(ConfigurationInfo configuration)
Add a configuration.- Parameters:
configuration
- The configuration.
-
setArguments
public void setArguments(IArgument[] arguments)
Set the arguments.- Parameters:
arguments
- The arguments to set.
-
addArgument
public void addArgument(IArgument argument)
Add an argument.- Parameters:
argument
- The argument.
-
setResults
public void setResults(IArgument[] results)
Set the results.- Parameters:
results
- The results to set.
-
addResult
public void addResult(IArgument result)
Add a result.- Parameters:
result
- The result.
-
setStartable
public void setStartable(boolean startable)
Set the startable.- Parameters:
startable
- The startable to set.
-
setFilename
public void setFilename(java.lang.String filename)
Set the filename.- Parameters:
filename
- The filename to set.
-
setType
public void setType(java.lang.String type)
Set the component type.- Parameters:
type
- The component type to set.
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)
Set the properties.- Parameters:
properties
- The properties to set.
-
addProperty
public void addProperty(java.lang.String name, java.lang.Object value)
Add a property.
-
addProperty
public void addProperty(UnparsedExpression unexp)
Add a property.
-
setClassloader
public void setClassloader(java.lang.ClassLoader classloader)
Set the classloader.- Parameters:
classloader
- The classloader to set.
-
getServices
public RequiredServiceInfo[] getServices()
Get the required services.- Specified by:
getServices
in interfaceIModelInfo
- Returns:
- The required services.
-
setResourceIdentifier
public void setResourceIdentifier(IResourceIdentifier rid)
Set the resource identifier.- Parameters:
rid
- The resource identifier to set.
-
setRequiredServices
public void setRequiredServices(RequiredServiceInfo[] requiredservices)
Set the required services.- Parameters:
required
- services The required services to set.
-
getService
public RequiredServiceInfo getService(java.lang.String name)
Get the required service.- Specified by:
getService
in interfaceIModelInfo
- Returns:
- The required service.
-
addRequiredService
public void addRequiredService(RequiredServiceInfo requiredservice)
Add a required service.- Parameters:
requiredservice
- The required service.
-
removeRequiredService
public void removeRequiredService(RequiredServiceInfo requiredservice)
Remove a required service.- Parameters:
requiredservice
- The required service.
-
getProvidedServices
public ProvidedServiceInfo[] getProvidedServices()
Get the provided services.- Specified by:
getProvidedServices
in interfaceIModelInfo
- Returns:
- The provided services.
-
setProvidedServices
public void setProvidedServices(ProvidedServiceInfo[] providedservices)
Set the provided services.- Parameters:
provided
- services The provided services to set.
-
addProvidedService
public void addProvidedService(ProvidedServiceInfo providedservice)
Add a provided service.- Parameters:
providedservice
- The provided service.
-
removeProvidedService
public void removeProvidedService(ProvidedServiceInfo providedservice)
Remove a provided service.- Parameters:
providedservice
- The provided service.
-
getSynchronous
public java.lang.Boolean getSynchronous(java.lang.String configname)
Get the synchronous flag.- Specified by:
getSynchronous
in interfaceIModelInfo
- Parameters:
synchronous
- The synchronous.- Returns:
- The synchronous flag value.
-
getSuspend
public java.lang.Boolean getSuspend(java.lang.String configname)
Get the suspend flag.- Specified by:
getSuspend
in interfaceIModelInfo
- Parameters:
configname
- The configname.- Returns:
- The suspend flag value.
-
getKeepalive
public java.lang.Boolean getKeepalive(java.lang.String configname)
Get the keepalive flag.- Specified by:
getKeepalive
in interfaceIModelInfo
- Parameters:
configname
- The configname.- Returns:
- The keepalive flag value.
-
getMonitoring
public IMonitoringService.PublishEventLevel getMonitoring(java.lang.String configname)
Get the monitoring flag.- Specified by:
getMonitoring
in interfaceIModelInfo
- Parameters:
configname
- The configname.- Returns:
- The monitoring flag value.
-
getSubcomponentTypes
public SubcomponentTypeInfo[] getSubcomponentTypes()
Get the subcomponent names.- Specified by:
getSubcomponentTypes
in interfaceIModelInfo
-
setSubcomponentTypes
public void setSubcomponentTypes(SubcomponentTypeInfo[] subcomponents)
Set the subcomponent types.
-
addSubcomponentType
public void addSubcomponentType(SubcomponentTypeInfo subcomponent)
Add a subcomponent type.- Parameters:
subcomponent
- The subcomponent type.
-
getBreakpoints
public java.lang.String[] getBreakpoints()
Get the possible breakpoint places in that model.- Specified by:
getBreakpoints
in interfaceIModelInfo
- Returns:
- The breakpoints.
-
setBreakpoints
public void setBreakpoints(java.lang.String[] breakpoints)
Set the breakpoints.- Parameters:
breakpoints
- The breakpoints to set.
-
checkName
public boolean checkName()
Check if the specified name matches the file name.
-
checkPackage
public boolean checkPackage()
Check if the specified package matches the file name.
-
getRawModel
public java.lang.Object getRawModel()
Get the kernel-specific model.- Specified by:
getRawModel
in interfaceIModelInfo
- Returns:
- The kernel-specific model when loaded locally, null for remote models.
-
internalSetRawModel
public void internalSetRawModel(java.lang.Object rawmodel)
Set the kernel-specific model.- Parameters:
rawmodel
- The kernel-specific model when loaded locally, null for remote models.
-
getFeatures
public IComponentFeatureFactory[] getFeatures()
Get the features.- Specified by:
getFeatures
in interfaceIModelInfo
- Returns:
- The features
-
setFeatures
public void setFeatures(IComponentFeatureFactory[] features)
The features to set.- Parameters:
features
- The features to set
-
getNameHint
public java.lang.String getNameHint()
Get the namehint.- Specified by:
getNameHint
in interfaceIModelInfo
- Returns:
- the namehint
-
setNameHint
public void setNameHint(java.lang.String namehint)
Set the namehint.- Parameters:
namehint
- The namehint to set
-
-