test_class.declarator: runner
test_class.modifier: private
test_class.original_string: private StandardLiveActivityRunner runner;
test_class.type: StandardLiveActivityRunner
test_class.var_name: runner
test_class.declarator: installedActivity
test_class.modifier: private
test_class.original_string: private InstalledLiveActivity installedActivity;
test_class.type: InstalledLiveActivity
test_class.var_name: installedActivity
test_class.declarator: activityWrapper
test_class.modifier: private
test_class.original_string: private ActivityWrapper activityWrapper;
test_class.type: ActivityWrapper
test_class.var_name: activityWrapper
test_class.declarator: activityFilesystem
test_class.modifier: private
test_class.original_string: private InternalLiveActivityFilesystem activityFilesystem;
test_class.type: InternalLiveActivityFilesystem
test_class.var_name: activityFilesystem
test_class.declarator: configuration
test_class.modifier: private
test_class.original_string: private LiveActivityConfiguration configuration;
test_class.type: LiveActivityConfiguration
test_class.var_name: configuration
test_class.declarator: liveActivityRunnerListener
test_class.modifier: private
test_class.original_string: private LiveActivityRunnerListener liveActivityRunnerListener;
test_class.type: LiveActivityRunnerListener
test_class.var_name: liveActivityRunnerListener
test_class.declarator: liveActivityRuntime
test_class.modifier: private
test_class.original_string: private LiveActivityRuntime liveActivityRuntime;
test_class.type: LiveActivityRuntime
test_class.var_name: liveActivityRuntime
test_class.declarator: instance
test_class.modifier: private
test_class.original_string: private Activity instance;
test_class.type: Activity
test_class.var_name: instance
test_class.declarator: spaceEnvironment
test_class.modifier: private
test_class.original_string: private InteractiveSpacesEnvironment spaceEnvironment;
test_class.type: InteractiveSpacesEnvironment
test_class.var_name: spaceEnvironment
test_class.declarator: timeProvider
test_class.modifier: private
test_class.original_string: private SettableTimeProvider timeProvider;
test_class.type: SettableTimeProvider
test_class.var_name: timeProvider
test_class.file: runtime/activity/interactivespaces-activity-runtime/src/test/java/interactivespaces/liveactivity/runtime/StandardLiveActivityRunnerTest.java
test_class.identifier: StandardLiveActivityRunnerTest
test_case.body: @Test
    public void testStartupFail() {
      Mockito.when(activityWrapper.newInstance()).thenThrow(new RuntimeException());
      runner.startup();
  
      Mockito.verify(instance, Mockito.times(0)).startup();
      Mockito.verify(liveActivityRunnerListener).onNoInstanceActivityStatusEvent(runner);
    }
test_case.class_method_signature: StandardLiveActivityRunnerTest.testStartupFail()
test_case.full_signature: @Test public void testStartupFail()
test_case.identifier: testStartupFail
test_case.invocations: thenThrow when newInstance startup startup verify times onNoInstanceActivityStatusEvent verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testStartupFail()
focal_class.declarator: INSTANCE_LOCK_WAIT_TIME = 20000
focal_class.modifier: private static final
focal_class.original_string: private static final long INSTANCE_LOCK_WAIT_TIME = 20000;
focal_class.type: long
focal_class.var_name: INSTANCE_LOCK_WAIT_TIME
focal_class.declarator: uuid
focal_class.modifier: private final
focal_class.original_string: private final String uuid;
focal_class.type: String
focal_class.var_name: uuid
focal_class.declarator: installedActivity
focal_class.modifier: private final
focal_class.original_string: private final InstalledLiveActivity installedActivity;
focal_class.type: InstalledLiveActivity
focal_class.var_name: installedActivity
focal_class.declarator: activityWrapper
focal_class.modifier: private final
focal_class.original_string: private final ActivityWrapper activityWrapper;
focal_class.type: ActivityWrapper
focal_class.var_name: activityWrapper
focal_class.declarator: activityFilesystem
focal_class.modifier: private final
focal_class.original_string: private final InternalLiveActivityFilesystem activityFilesystem;
focal_class.type: InternalLiveActivityFilesystem
focal_class.var_name: activityFilesystem
focal_class.declarator: configuration
focal_class.modifier: private final
focal_class.original_string: private final LiveActivityConfiguration configuration;
focal_class.type: LiveActivityConfiguration
focal_class.var_name: configuration
focal_class.declarator: liveActivityRunnerListener
focal_class.modifier: private final
focal_class.original_string: private final LiveActivityRunnerListener liveActivityRunnerListener;
focal_class.type: LiveActivityRunnerListener
focal_class.var_name: liveActivityRunnerListener
focal_class.declarator: liveActivityRuntime
focal_class.modifier: private
focal_class.original_string: private LiveActivityRuntime liveActivityRuntime;
focal_class.type: LiveActivityRuntime
focal_class.var_name: liveActivityRuntime
focal_class.declarator: activityLog
focal_class.modifier: private
focal_class.original_string: private Log activityLog;
focal_class.type: Log
focal_class.var_name: activityLog
focal_class.declarator: instance
focal_class.modifier: private
focal_class.original_string: private Activity instance;
focal_class.type: Activity
focal_class.var_name: instance
focal_class.declarator: cachedActivityStatus
focal_class.modifier: private
focal_class.original_string: private ActivityStatus cachedActivityStatus;
focal_class.type: ActivityStatus
focal_class.var_name: cachedActivityStatus
focal_class.declarator: instanceLock = new ReentrantLock()
focal_class.modifier: private final
focal_class.original_string: private final ReentrantLock instanceLock = new ReentrantLock();
focal_class.type: ReentrantLock
focal_class.var_name: instanceLock
focal_class.declarator: instanceLockState
focal_class.modifier: private
focal_class.original_string: private InstanceLockState instanceLockState;
focal_class.type: InstanceLockState
focal_class.var_name: instanceLockState
focal_class.declarator: stale
focal_class.modifier: private
focal_class.original_string: private boolean stale;
focal_class.type: boolean
focal_class.var_name: stale
focal_class.file: runtime/activity/interactivespaces-activity-runtime/src/main/java/interactivespaces/liveactivity/runtime/StandardLiveActivityRunner.java
focal_class.identifier: StandardLiveActivityRunner
focal_class.interfaces: implements LiveActivityRunner
focal_class.class_method_signature: StandardLiveActivityRunner.StandardLiveActivityRunner(InstalledLiveActivity installedActivity, ActivityWrapper activityWrapper,
        InternalLiveActivityFilesystem activityFilesystem, LiveActivityConfiguration configuration,
        LiveActivityRunnerListener liveActivityRunnerListener, LiveActivityRuntime liveActivityRuntime)
focal_class.full_signature: public  StandardLiveActivityRunner(InstalledLiveActivity installedActivity, ActivityWrapper activityWrapper,
        InternalLiveActivityFilesystem activityFilesystem, LiveActivityConfiguration configuration,
        LiveActivityRunnerListener liveActivityRunnerListener, LiveActivityRuntime liveActivityRuntime)
focal_class.identifier: StandardLiveActivityRunner
focal_class.modifiers: public
focal_class.parameters: (InstalledLiveActivity installedActivity, ActivityWrapper activityWrapper,
        InternalLiveActivityFilesystem activityFilesystem, LiveActivityConfiguration configuration,
        LiveActivityRunnerListener liveActivityRunnerListener, LiveActivityRuntime liveActivityRuntime)
focal_class.signature:  StandardLiveActivityRunner(InstalledLiveActivity installedActivity, ActivityWrapper activityWrapper,
        InternalLiveActivityFilesystem activityFilesystem, LiveActivityConfiguration configuration,
        LiveActivityRunnerListener liveActivityRunnerListener, LiveActivityRuntime liveActivityRuntime)
focal_class.class_method_signature: StandardLiveActivityRunner.getUuid()
focal_class.full_signature: @Override public String getUuid()
focal_class.identifier: getUuid
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUuid()
focal_class.class_method_signature: StandardLiveActivityRunner.updateConfiguration(Map<String, String> update)
focal_class.full_signature: @Override public void updateConfiguration(Map<String, String> update)
focal_class.identifier: updateConfiguration
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, String> update)
focal_class.return: void
focal_class.signature: void updateConfiguration(Map<String, String> update)
focal_class.class_method_signature: StandardLiveActivityRunner.startup()
focal_class.full_signature: @Override public void startup()
focal_class.identifier: startup
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void startup()
focal_class.class_method_signature: StandardLiveActivityRunner.shutdown()
focal_class.full_signature: @Override public void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: StandardLiveActivityRunner.activate()
focal_class.full_signature: @Override public void activate()
focal_class.identifier: activate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void activate()
focal_class.class_method_signature: StandardLiveActivityRunner.deactivate()
focal_class.full_signature: @Override public void deactivate()
focal_class.identifier: deactivate
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deactivate()
focal_class.class_method_signature: StandardLiveActivityRunner.sampleActivityStatus()
focal_class.full_signature: @Override public ActivityStatus sampleActivityStatus()
focal_class.identifier: sampleActivityStatus
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ActivityStatus
focal_class.signature: ActivityStatus sampleActivityStatus()
focal_class.class_method_signature: StandardLiveActivityRunner.sampleActivityStatusUnprotected()
focal_class.full_signature: private ActivityStatus sampleActivityStatusUnprotected()
focal_class.identifier: sampleActivityStatusUnprotected
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: ActivityStatus
focal_class.signature: ActivityStatus sampleActivityStatusUnprotected()
focal_class.class_method_signature: StandardLiveActivityRunner.getCachedActivityStatus()
focal_class.full_signature: @Override public ActivityStatus getCachedActivityStatus()
focal_class.identifier: getCachedActivityStatus
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ActivityStatus
focal_class.signature: ActivityStatus getCachedActivityStatus()
focal_class.class_method_signature: StandardLiveActivityRunner.getInstance()
focal_class.full_signature: @Override public Activity getInstance()
focal_class.identifier: getInstance
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Activity
focal_class.signature: Activity getInstance()
focal_class.class_method_signature: StandardLiveActivityRunner.setInstance(Activity instance)
focal_class.full_signature: @VisibleForTesting void setInstance(Activity instance)
focal_class.identifier: setInstance
focal_class.modifiers: @VisibleForTesting
focal_class.parameters: (Activity instance)
focal_class.return: void
focal_class.signature: void setInstance(Activity instance)
focal_class.class_method_signature: StandardLiveActivityRunner.setCachedActivityStatus(ActivityStatus cachedActivityStatus)
focal_class.full_signature: @VisibleForTesting public void setCachedActivityStatus(ActivityStatus cachedActivityStatus)
focal_class.identifier: setCachedActivityStatus
focal_class.modifiers: @VisibleForTesting public
focal_class.parameters: (ActivityStatus cachedActivityStatus)
focal_class.return: void
focal_class.signature: void setCachedActivityStatus(ActivityStatus cachedActivityStatus)
focal_class.class_method_signature: StandardLiveActivityRunner.setActivityStatus(ActivityStatus status)
focal_class.full_signature: @Override public void setActivityStatus(ActivityStatus status)
focal_class.identifier: setActivityStatus
focal_class.modifiers: @Override public
focal_class.parameters: (ActivityStatus status)
focal_class.return: void
focal_class.signature: void setActivityStatus(ActivityStatus status)
focal_class.class_method_signature: StandardLiveActivityRunner.getDisplayName()
focal_class.full_signature: @Override public String getDisplayName()
focal_class.identifier: getDisplayName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDisplayName()
focal_class.class_method_signature: StandardLiveActivityRunner.cleanupResources()
focal_class.full_signature: private void cleanupResources()
focal_class.identifier: cleanupResources
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cleanupResources()
focal_class.class_method_signature: StandardLiveActivityRunner.setActivityStatusUnprotected(ActivityStatus status)
focal_class.full_signature: private void setActivityStatusUnprotected(ActivityStatus status)
focal_class.identifier: setActivityStatusUnprotected
focal_class.modifiers: private
focal_class.parameters: (ActivityStatus status)
focal_class.return: void
focal_class.signature: void setActivityStatusUnprotected(ActivityStatus status)
focal_class.class_method_signature: StandardLiveActivityRunner.getActivityWrapper()
focal_class.full_signature: @Override @VisibleForTesting public ActivityWrapper getActivityWrapper()
focal_class.identifier: getActivityWrapper
focal_class.modifiers: @Override @VisibleForTesting public
focal_class.parameters: ()
focal_class.return: ActivityWrapper
focal_class.signature: ActivityWrapper getActivityWrapper()
focal_class.class_method_signature: StandardLiveActivityRunner.markStale()
focal_class.full_signature: @Override public void markStale()
focal_class.identifier: markStale
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void markStale()
focal_class.class_method_signature: StandardLiveActivityRunner.isStale()
focal_class.full_signature: @Override public boolean isStale()
focal_class.identifier: isStale
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isStale()
focal_class.class_method_signature: StandardLiveActivityRunner.obtainInstanceLock(InstanceLockState newInstanceLockState)
focal_class.full_signature: private boolean obtainInstanceLock(InstanceLockState newInstanceLockState)
focal_class.identifier: obtainInstanceLock
focal_class.modifiers: private
focal_class.parameters: (InstanceLockState newInstanceLockState)
focal_class.return: boolean
focal_class.signature: boolean obtainInstanceLock(InstanceLockState newInstanceLockState)
focal_class.class_method_signature: StandardLiveActivityRunner.releaseInstanceLock()
focal_class.full_signature: private void releaseInstanceLock()
focal_class.identifier: releaseInstanceLock
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void releaseInstanceLock()
focal_method.body: @Override
    public void startup() {
      if (obtainInstanceLock(InstanceLockState.STARTUP)) {
        try {
          if (instance == null) {
            try {
              configuration.load();
              instance = activityWrapper.newInstance();
  
              activityLog = liveActivityRuntime.getActivityLog(installedActivity, configuration, activityFilesystem);
              liveActivityRuntime.initializeActivityInstance(installedActivity, activityFilesystem, instance,
                  configuration, activityLog, activityWrapper.newExecutionContext());
  
              instance.startup();
  
              // Instances notify status changes through their event listeners, so the startup notification is already
              // handled. .
  
              // If not running, we want to punt on having an instance as the runner only holds onto an instance reference
              // if it successfully starts.
              if (!instance.getActivityStatus().getState().isRunning()) {
                instance = null;
              }
            } catch (Throwable e) {
              setActivityStatusUnprotected(new ActivityStatus(ActivityState.STARTUP_FAILURE, null, e));
  
              if (instance != null) {
                try {
                  instance.handleStartupFailure();
                } catch (Throwable e1) {
                  liveActivityRuntime.getSpaceEnvironment().getLog()
                      .error("Error cleaning up activity which could not start", e1);
                }
                instance = null;
              }
            }
  
            // If no instance is referenced, then something bad happened.
            if (instance == null) {
              cleanupResources();
            }
          } else {
            liveActivityRuntime.getSpaceEnvironment().getLog()
                .warn(String.format("Attempt to start activity %s that is already started", uuid));
          }
        } finally {
          releaseInstanceLock();
        }
      }
    }
focal_method.class_method_signature: StandardLiveActivityRunner.startup()
focal_method.full_signature: @Override public void startup()
focal_method.identifier: startup
focal_method.invocations: obtainInstanceLock load newInstance getActivityLog initializeActivityInstance newExecutionContext startup isRunning getState getActivityStatus setActivityStatusUnprotected handleStartupFailure error getLog getSpaceEnvironment cleanupResources warn getLog getSpaceEnvironment format releaseInstanceLock
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void startup()