Skip to content

Commit

Permalink
[sre][janus] Add protected access to the executor service into the Li…
Browse files Browse the repository at this point in the history
…fecycle service.

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Aug 22, 2020
1 parent fc30354 commit 61902ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -46,6 +46,7 @@ import org.eclipse.xtext.xbase.lib.Functions.Function0
import static io.sarl.sre.services.lifecycle.AgentLife.*
import static java.text.MessageFormat.*
import io.sarl.sre.IssueCodes
import org.eclipse.xtend.lib.annotations.Accessors

/**
* Implementation of a spawning service that is based on the other services of the SRE platform.
Expand All @@ -72,6 +73,7 @@ abstract class AbstractLifecycleService extends AbstractSreService implements Li

val platformContextEventEmitter : ExternalContextMemberListener

@Accessors(PROTECTED_GETTER)
val executor : ExecutorService

val lifecycleConfig : LifecycleConfig
Expand Down Expand Up @@ -317,10 +319,10 @@ abstract class AbstractLifecycleService extends AbstractSreService implements Li

]
if (nbAgents > 1) {
this.executor.executeNotBlockingTask(loggingService.kernelLogger, nbAgents,
getExecutor.executeNotBlockingTask(loggingService.kernelLogger, nbAgents,
this.lifecycleConfig.agentSpawningCountPerThread, agentCreator)
} else {
this.executor.executeAsap(loggingService.kernelLogger, agentCreator)
getExecutor.executeAsap(loggingService.kernelLogger, agentCreator)
}
} else {
throw new SpawnDisabledException(parent.ID, agentClazz)
Expand Down
Expand Up @@ -197,8 +197,7 @@ class EventBus {
assert ^event !== null
assert listener !== null

val behaviorGuardEvaluators = this.behaviorGuardEvaluatorRegistry.
getBehaviorGuardEvaluatorsFor(^event, listener)
val behaviorGuardEvaluators = this.behaviorGuardEvaluatorRegistry.getBehaviorGuardEvaluatorsFor(^event, listener)

if (behaviorGuardEvaluators !== null && behaviorGuardEvaluators.size() > 0) {
val behaviorsMethodsToExecute = evaluateGuards(^event, behaviorGuardEvaluators, logger)
Expand Down

0 comments on commit 61902ce

Please sign in to comment.