Package com.xebisco.yield.manager
Class ApplicationManager
java.lang.Object
com.xebisco.yield.manager.ApplicationManager
- All Implemented Interfaces:
Runnable
ApplicationManager class manages the lifecycle of applications.
It runs the applications and handles their disposal when necessary.-
Constructor Summary
ConstructorsConstructorDescriptionApplicationManager(ContextTime contextTime) Constructs an instance ofApplicationManagerwith the specified context time. -
Method Summary
Modifier and TypeMethodDescriptionReturns the list of applications managed by this manager.booleanReturns the flag indicating whether to dispose of the manager when there are no more applications.Returns the context in which this manager operates.voidrun()Starts the thread for the manager.setApplications(List<Application> applications) Sets the list of applications managed by this manager.setDisposeWhenEmpty(boolean disposeWhenEmpty) Sets the flag indicating whether to dispose of the manager when there are no more applications.setManagerContext(Context managerContext) Sets the context in which this manager operates.
-
Constructor Details
-
ApplicationManager
Constructs an instance ofApplicationManagerwith the specified context time.- Parameters:
contextTime- The context time for the manager.
-
-
Method Details
-
run
public void run()Starts the thread for the manager. It starts all theApplications in thisApplicationManager. -
applications
Returns the list of applications managed by this manager.- Returns:
- The list of applications.
-
setApplications
Sets the list of applications managed by this manager.- Parameters:
applications- The list of applications.- Returns:
- This instance of
ApplicationManagerfor method chaining.
-
managerContext
Returns the context in which this manager operates.- Returns:
- The context.
-
setManagerContext
Sets the context in which this manager operates.- Parameters:
managerContext- The context.- Returns:
- This instance of
ApplicationManagerfor method chaining.
-
disposeWhenEmpty
public boolean disposeWhenEmpty()Returns the flag indicating whether to dispose of the manager when there are no more applications.- Returns:
- The flag.
-
setDisposeWhenEmpty
Sets the flag indicating whether to dispose of the manager when there are no more applications.- Parameters:
disposeWhenEmpty- The flag.- Returns:
- This instance of
ApplicationManagerfor method chaining.
-