public final class SREutils extends Object
These utilities are provided for enabling the implementation of high-performance SRE by giving storage area into the instances of SARL concepts.
The data that is set and get by the functions in this utility class are SRE-dependent. The instance type of the data is known only by the SRE.
Note that any SRE-specific data stored into a SARL object has the following properties:
Object.equals(Object)
function;Object.hashCode()
function;Object.toString()
function.Modifier and Type | Method and Description |
---|---|
static <S extends Capacity> |
castInternalSkillReference(container : AbstractSkillContainer,
reference : AtomicSkillReference,
type : Class<S>)
Casts the internal skill reference of a skill container.
|
static void |
doSkillInstallation(skill : Skill)
Do the installation of the given skill.
|
static void |
doSkillUninstallation(skill : Skill)
Do the uninstallation of the given skill.
|
static void |
doSkillUninstallationPreparation(skill : Skill)
Do the uninstallation preparation of the given skill.
|
static <S extends Capacity> |
getInternalSkill(container : AbstractSkillContainer,
type : Class<S>)
Replies the internal skill of a skill container.
|
static AtomicSkillReference |
getInternalSkillReference(container : AbstractSkillContainer,
type : Class<? extends Capacity>)
Replies the internal skill reference of a skill container.
|
static ConcurrentMap<Class<? extends Capacity>,AtomicSkillReference> |
getSkillRepository(container : AbstractSkillContainer)
Replies the skill repository of the given container.
|
static <S> S |
getSreSpecificData(container : SRESpecificDataContainer,
type : Class<S>)
Replies the data associated to the container by the SRE.
|
static void |
setDynamicSkillProvider(container : AbstractSkillContainer,
provider : DynamicSkillProvider)
Change the dynamic skill provider of a skill container.
|
static AtomicSkillReference |
setInternalSkill(container : AbstractSkillContainer,
skill : Skill,
capacities : Class<? extends Capacity>[])
Set the internal skill of a skill container.
|
static AtomicSkillReference |
setInternalSkillIfAbsent(container : AbstractSkillContainer,
skill : Skill,
capacities : Class<? extends Capacity>[])
Set the internal skill of a skill container if the skill is not yet mapped.
|
static void |
setSreSpecificData(container : SRESpecificDataContainer,
data : Object)
Change the data associated to the given container by the SRE.
|
static <S> S |
setSreSpecificData(container : SRESpecificDataContainer,
data : S,
type : Class<S>)
Change the data associated to the given container by the SRE.
|
@Pure public staticdef
getSreSpecificData(container : SRESpecificDataContainer, type : Class<S>) : Swith
<S>
SREutils
S
- the type of the data.type
- the type of the data.container
- the container.public static def
setSreSpecificData(container : SRESpecificDataContainer,
data : Object) : void
SREutils
container
- the container.data
- the SRE-specific data.public staticdef
setSreSpecificData(container : SRESpecificDataContainer, data : S, type : Class<S>) : Swith
<S>
SREutils
S
- the type of the data.type
- the type of the data.container
- the container.data
- the SRE-specific data.@Pure
public static def
getInternalSkillReference(container : AbstractSkillContainer,
type : Class<? extends Capacity>) : AtomicSkillReference
SREutils
container
- the container.type
- the type of the capacity.@Pure public staticdef
castInternalSkillReference(container : AbstractSkillContainer, reference : AtomicSkillReference, type : Class<S>) : Swith
<S extends Capacity>
SREutils
S
- the type of the capacity.container
- the container.reference
- the reference to cast.type
- the type of the capacity.public static def
setInternalSkill(container : AbstractSkillContainer,
skill : Skill,
capacities : Class<? extends Capacity>[]) : AtomicSkillReference
SREutils
container
- the container.skill
- the skill instance to attach to the container.capacities
- the list of implemented capacities. This array cannot be null
.public static def
setInternalSkillIfAbsent(container : AbstractSkillContainer,
skill : Skill,
capacities : Class<? extends Capacity>[]) : AtomicSkillReference
SREutils
container
- the container.skill
- the skill instance to attach to the container.capacities
- the list of implemented capacities. This array cannot be null
.@Pure public staticdef
getInternalSkill(container : AbstractSkillContainer, type : Class<S>) : Swith
<S extends Capacity>
SREutils
S
- the type of the capacity.container
- the container.type
- the type of the capacity.public static def
getSkillRepository(container : AbstractSkillContainer) : ConcurrentMap<Class<? extends Capacity>,AtomicSkillReference>
SREutils
The replied repository is not protected against asynchronous accesses.
container
- the container.public static def
setDynamicSkillProvider(container : AbstractSkillContainer,
provider : DynamicSkillProvider) : void
SREutils
container
- the container.provider
- the provider.public static def
doSkillInstallation(skill : Skill) : void
SREutils
This function invokes Skill.install()
and nothing more.
skill
- the skill to be installed.SREutils.doSkillUninstallationPreparation(Skill)
,
SREutils.doSkillUninstallation(Skill)
public static def
doSkillUninstallationPreparation(skill : Skill) : void
SREutils
This function invokes Skill.prepareUninstallation()
and nothing more.
skill
- the skill to be uninstalled.SREutils.doSkillInstallation(Skill)
,
SREutils.doSkillUninstallation(Skill)
public static def
doSkillUninstallation(skill : Skill) : void
SREutils
This function invokes Skill.uninstall()
and nothing more.
skill
- the skill to be uninstalled.SREutils.doSkillInstallation(Skill)
,
SREutils.doSkillUninstallationPreparation(Skill)
Copyright © 2020 the original authors or authors.