Interface Session

  • All Superinterfaces:
    java.util.concurrent.Callable<java.lang.Void>

    public interface Session
    extends java.util.concurrent.Callable<java.lang.Void>
    • Method Detail

      • reserve

        void reserve​(Scenario scenario)
      • uniqueId

        int uniqueId()
        Returns:
        int >= 0 that's unique across whole simulation
      • agentThreadId

        int agentThreadId()
      • agentThreads

        int agentThreads()
      • globalThreadId

        int globalThreadId()
      • globalThreads

        int globalThreads()
      • agentId

        int agentId()
      • agents

        int agents()
      • runId

        java.lang.String runId()
      • executor

        io.netty.util.concurrent.EventExecutor executor()
      • phaseStartTimestamp

        long phaseStartTimestamp()
      • statistics

        Statistics statistics​(int stepId,
                              java.lang.String name)
      • pruneStats

        void pruneStats​(Phase phase)
      • declareResource

        <R extends Session.Resource> void declareResource​(Session.ResourceKey<R> key,
                                                          java.util.function.Supplier<R> resourceSupplier)
        See declareResource(ResourceKey, Supplier, boolean), with singleton defaulting to false
        Type Parameters:
        R - Resource type.
        Parameters:
        key - Unique key (usually the step or handler itself)
        resourceSupplier - Supplier creating the resource, possible multiple times.
      • declareResource

        <R extends Session.Resource> void declareResource​(Session.ResourceKey<R> key,
                                                          java.util.function.Supplier<R> resourceSupplier,
                                                          boolean singleton)
        Reserve space in the session for a resource, stored under given key. If this is executed within a sequence with non-zero concurrency the session stores one resource for each concurrent instance. If this behaviour should be avoided set singleton to true.
        Type Parameters:
        R - Resource type.
        Parameters:
        key - Unique key (usually the step or handler itself)
        resourceSupplier - Supplier creating the resource, possible multiple times.
        singleton - Is the resource shared amongst concurrent sequences?
      • proceed

        void proceed()
        Run anything that can be executed.
      • reset

        void reset()
      • stop

        void stop()
      • fail

        void fail​(java.lang.Throwable t)
      • isActive

        boolean isActive()
      • currentRequest

        Request currentRequest()
        Returns:
        Currently executed request, or null if not in scope.
      • currentRequest

        void currentRequest​(Request request)