Class: AppManager

'brixy.mvc.AppManager'~ AppManager

new AppManager ()

AppManager class.

Source:

Methods

add (config)

Saves the configuration of a new application. Application instance will be created on the first request.
Application is a class of 'brixy.mvc.Application' or config.application.
If config.autorun is passed, application runs immediately with it as the first request.
Application with the specified config.id is added only once.

Parameters:
Name Type Description
config Object

Configuration object is used to create application.

Throws:
  • Exception on error.

Source:

exists (id) → {boolean}

Checks if there exists an application with the given id.

Parameters:
Name Type Description
id *

Application ID.

Returns:
  • boolean
Source:

get (id) → {Object|null}

Returns an application with the given id.

Parameters:
Name Type Description
id *

Application ID.

Returns:
  • Object | null
Source:

processEvent (event, data)

Processes the event. Passes the event to each application that listens it.

Parameters:
Name Type Description
event string

Event name.

data Object

Application will pass the data to the event handler. (optional)

Source:

processRequest (id, request)

Passes the request to the application of the ID. If the ID doesn't exist, does nothing.

Parameters:
Name Type Description
id *

Application ID.

request string | Object

Request string or route object.

Throws:
  • Exception on error.

Source:

toString () → {string}

Returns a string representation of the object.

Returns:
  • string
Source: