Class AbstractActivityRun<WD extends WorkDefinition,​AH extends ActivityHandler<WD,​AH>,​WS extends AbstractActivityWorkStateType>

    • Method Detail

      • createReportingCharacteristics

        @NotNull
        public @NotNull ActivityReportingCharacteristics createReportingCharacteristics()
        This method should be called only after the concrete instance is fully initialized.
      • setInstanceReady

        protected void setInstanceReady()
      • determineActivityStateDefinition

        protected ActivityStateDefinition<WS> determineActivityStateDefinition()
        Called during initialization. Should not access reporting characteristics.
      • getTaskRun

        @NotNull
        public @NotNull ActivityBasedTaskRun getTaskRun()
        Returns task run that contains this activity run.
      • getActivity

        @NotNull
        public @NotNull Activity<WD,​AH> getActivity()
      • debugDumpExtra

        protected void debugDumpExtra​(StringBuilder sb,
                                      int indent)
      • getActivityHandler

        @NotNull
        public AH getActivityHandler()
      • getRunningTask

        @NotNull
        public @NotNull RunningTask getRunningTask()
      • canRun

        public boolean canRun()
      • shouldCreateWorkStateOnInitialization

        public boolean shouldCreateWorkStateOnInitialization()
        Returns true if the work (business) state should be created right on activity run initialization, along with the rest of the state. Maybe we should provide this customization in the "specifics" interface for iterative activities.
      • areStatisticsSupported

        public boolean areStatisticsSupported()
      • isProgressSupported

        public boolean isProgressSupported()
      • areSynchronizationStatisticsSupported

        public boolean areSynchronizationStatisticsSupported()
      • areActionsExecutedStatisticsSupported

        public boolean areActionsExecutedStatisticsSupported()
      • areRunRecordsSupported

        public boolean areRunRecordsSupported()
      • isDryRun

        public boolean isDryRun()
      • isFullExecution

        protected boolean isFullExecution()
      • isNoExecution

        public boolean isNoExecution()
      • isBucketAnalysis

        public boolean isBucketAnalysis()
      • getItemsProcessed

        public int getItemsProcessed()
      • isNonScavengingWorker

        public boolean isNonScavengingWorker()
      • isWorker

        public boolean isWorker()
      • getWorkDefinition

        @NotNull
        public WD getWorkDefinition()
      • getActivityDefinition

        @NotNull
        protected @NotNull ActivityDefinition<WD> getActivityDefinition()
      • getStartTimestampRequired

        public long getStartTimestampRequired()
      • onActivityRealizationStart

        protected void onActivityRealizationStart​(OperationResult result)
                                           throws ActivityRunException
        Called when the activity realization starts. - For delegated activities this is _after_ the delegation occurred. (I.e. in the delegate run.) - For distributed activities this is before any of the workers are started. - For non-delegated, non-distributed (local-only) activities this is when the local run starts the first time. Overall, this should happen exactly once per activity realization. In subclasses: Do not forget to call the implementation in the super-class.
        Throws:
        ActivityRunException
      • onActivityRealizationComplete

        protected void onActivityRealizationComplete​(OperationResult result)
                                              throws ActivityRunException
        Called when the activity realization is complete. It should be called at most once for any given activity. (Regardless of its delegation or distribution.) Planned e.g. for closing the simulation result (for computing statistics, etc). TODO this is something like a placeholder for now -- probably it will NOT work in the current implementation!
        Throws:
        ActivityRunException
      • ensureNoPreviewNorDryRun

        protected void ensureNoPreviewNorDryRun()
        Use this to disallow running activities that do not honor preview and/or dry-run mode, to avoid any confusion of the user.
      • ensureNoDryRun

        protected void ensureNoDryRun()
      • ensureFullExecution

        protected void ensureFullExecution()