Interface ApplicationManager
-
public interface ApplicationManagerApplication Manager API. Used to manipulate Glue Desktop applications.- See Also:
Glue.appManager()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<String,Map<String,Object>>applications()Returns configurations for all available applications.Collection<ApplicationInstance>instances()Returns all currently running application instances.Optional<ApplicationInstance>myInstance()Returns the current application instance.CompletionStage<ApplicationManager>ready()A future that completes when app manager is initialized.CompletionStage<AsynchronousCloseable>registerInstanceHandler(String applicationName, ApplicationInstanceHandler handler)Registers a handler function to be executed when child application instance is started.CompletionStage<AsynchronousCloseable>registerShuttingDownHandler(ShuttingDownHandler handler)Registers a handler function to be executed when Glue Desktop will shut down or restart.default CompletionStage<ApplicationInstance>start(String applicationName)Start an application by specified name.default CompletionStage<ApplicationInstance>start(String applicationName, Map<String,Object> context)Start an application instance by specified name and context.CompletionStage<ApplicationInstance>start(String applicationName, Map<String,Object> context, Map<String,Object> options)Start an application instance by specified name, context and options.
-
-
-
Method Detail
-
applications
Map<String,Map<String,Object>> applications()
Returns configurations for all available applications. They are keyed by application name.- Returns:
- a map with available application configurations keyed by application name, never
null
-
instances
Collection<ApplicationInstance> instances()
Returns all currently running application instances.- Returns:
- collection with all running application instances, never
null
-
myInstance
Optional<ApplicationInstance> myInstance()
Returns the current application instance.- Returns:
- current application instance
- Since:
- 1.4.12
-
ready
CompletionStage<ApplicationManager> ready()
A future that completes when app manager is initialized.- Returns:
- a stage that completes when application manager is initialized, never
null - Since:
- 1.4.12
-
start
CompletionStage<ApplicationInstance> start(String applicationName, Map<String,Object> context, Map<String,Object> options)
Start an application instance by specified name, context and options.- Parameters:
applicationName- identifying name for the applicationcontext- starting context specificationoptions- starting options specification- Returns:
- a stage that completes when application instance starts, never
null - Since:
- 1.4.9
-
start
default CompletionStage<ApplicationInstance> start(String applicationName, Map<String,Object> context)
Start an application instance by specified name and context.- Parameters:
applicationName- identifying name for the applicationcontext- starting context specification- Returns:
- a stage that completes when application instance starts, never
null
-
start
default CompletionStage<ApplicationInstance> start(String applicationName)
Start an application by specified name.- Parameters:
applicationName- identifying name for the application- Returns:
- a stage that completes when the application instance is started, never
null
-
registerInstanceHandler
CompletionStage<AsynchronousCloseable> registerInstanceHandler(String applicationName, ApplicationInstanceHandler handler)
Registers a handler function to be executed when child application instance is started.- Parameters:
applicationName- The application name, must not benullhandler- The application instance handler, must not benull- Returns:
- A stage that completes when the handler is registered, never
null - Since:
- 1.4.2
-
registerShuttingDownHandler
CompletionStage<AsynchronousCloseable> registerShuttingDownHandler(ShuttingDownHandler handler)
Registers a handler function to be executed when Glue Desktop will shut down or restart.- Returns:
- A stage that completes when the handler is registered, never
null - Since:
- 1.4.12
-
-