com.buglabs.bug.program
Class UserAppManager

java.lang.Object
  extended by java.lang.Thread
      extended by com.buglabs.bug.program.UserAppManager
All Implemented Interfaces:
IUserAppManager, java.lang.Runnable

public class UserAppManager
extends java.lang.Thread
implements IUserAppManager

This manager starts user applications. It's designed to be tolerant of applications that fail to start or have other serious problems. The state for each user application is stored in the Configuration Manager.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String BUG_APP_SYSTEM_PROP_KEY
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
UserAppManager(BundleContext context, LogService logService)
           
 
Method Summary
 void addApplication(java.lang.String filePath)
           
 void clearState()
          Clears any knowledge of existing user applications.
 Bundle[] getInstalledBundles()
          Returns an array of bundles that have been installed since the last time getInstalledBundles() was run.
protected  void initialize()
          Load the state of the manager from CM.
 void removeApplication(java.lang.String location)
          Removes an application from the User App Storage location.
 void run()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUG_APP_SYSTEM_PROP_KEY

public static final java.lang.String BUG_APP_SYSTEM_PROP_KEY
See Also:
Constant Field Values
Constructor Detail

UserAppManager

public UserAppManager(BundleContext context,
                      LogService logService)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

addApplication

public void addApplication(java.lang.String filePath)
                    throws java.io.IOException
Specified by:
addApplication in interface IUserAppManager
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface IUserAppManager
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

initialize

protected void initialize()
                   throws java.io.IOException
Load the state of the manager from CM.

Throws:
java.io.IOException

shutdown

public void shutdown()
Specified by:
shutdown in interface IUserAppManager

clearState

public void clearState()
Description copied from interface: IUserAppManager
Clears any knowledge of existing user applications.

Specified by:
clearState in interface IUserAppManager

removeApplication

public void removeApplication(java.lang.String location)
                       throws java.io.IOException
Description copied from interface: IUserAppManager
Removes an application from the User App Storage location.

Specified by:
removeApplication in interface IUserAppManager
Throws:
java.io.IOException

getInstalledBundles

public Bundle[] getInstalledBundles()
Description copied from interface: IUserAppManager
Returns an array of bundles that have been installed since the last time getInstalledBundles() was run. Clears the list afterwards.

Specified by:
getInstalledBundles in interface IUserAppManager
Returns: