Application Management

.NET

Listing All Registered Applications

var applications = await glue.AppManager.AwaitApplications();

foreach (var app in applications)
{
    // access app specific metadata
}

See our .NET Application Management example on GitHub.

Starting Applications

var applications = await glue.AppManager.AwaitApplications();

// get some application
var app = applications[0];

// optionally create a context to be passed to the new app
var context = AppManagerContext.CreateNew();
context.Set("token", "a23axo");

app.Start(context);

Instance Events

    // when an application is started
    event EventHandler<AppManagerApplicationInstanceEventArgs> ApplicationInstanceStarted;
    // when an application is stopped
    event EventHandler<AppManagerApplicationInstanceEventArgs> ApplicationInstanceStopped;

Application Events

    // when an application definition is added
    event EventHandler<AppManagerApplicationEventArgs> ApplicationAdded;
    // when an application definition is updated
    event EventHandler<AppManagerApplicationEventArgs> ApplicationUpdated;
    // when an application definition is removed
    event EventHandler<AppManagerApplicationEventArgs> ApplicationRemoved;

Example

You can find the source code of a sample AppManagement application here or in GitHub.

The application lists all apps defined in Glue42 and all instances that are currently running.

It allows you to start a new instance or to stop existing one.

Image of tab window

Interface

public interface IAppManager
{
    IList<IAppManagerApplication> Applications { get; }

    event EventHandler<AppManagerMessageEventArgs> Notify;

    event EventHandler<AppManagerApplicationEventArgs> ApplicationAdded;

    event EventHandler<AppManagerApplicationEventArgs> ApplicationUpdated;

    event EventHandler<AppManagerApplicationEventArgs> ApplicationRemoved;

    event EventHandler<AppManagerApplicationInstanceEventArgs> ApplicationInstanceStarted;

    event EventHandler<AppManagerApplicationInstanceEventArgs> ApplicationInstanceStopped;

    event EventHandler<AppManagerLayoutEventArgs> LayoutAdded;

    event EventHandler<AppManagerLayoutEventArgs> LayoutRemoved;

    Task<IAppManagerApplication[]> AwaitApplications();

    Task<IAppManagerApplication> AwaitApplication(Func<IAppManagerApplication, bool> predicate);

    Task<IAppManager> Ready();
}