Beispiel #1
0
	invoker = require('invoker');

var TAG = "Titanium";

// The app entry point
Titanium.sourceUrl = "app://app.js";

// A list of java APIs that need an invocation-specific URL
// passed in as the first argument
Titanium.invocationAPIs = [];

// A list of 3rd party (external) modules
Titanium.externalModules = [];

// Define lazy initializers for all Titanium APIs
bootstrap.bootstrap(Titanium);

// Custom JS extensions to Java modules
require("ui").bootstrap(Titanium);

var Properties = require("properties");
Properties.bootstrap(Titanium);

// Custom native modules
bootstrap.defineLazyBinding(Titanium, "API")

// Context-bound modules -------------------------------------------------
//
// Specialized modules that require binding context specific data
// within a script execution scope. This is how Ti.UI.currentWindow,
// Ti.Android.currentActivity, and others are implemented.
Beispiel #2
0
/**
 * Graceful exit callback, called when
 * the application is killed or exited.
 *
 * @callback function called when the callback is done
 */

var gracefulExit = function (callback) {
	if (connection) {
		connection.close(callback);
	} else {
		if (callback) callback();
	}
};



/**
 * Bootstrap the application.
 * Start listening to agent connections.
 */

bootstrap.bootstrap('oms-agent-manager', gracefulExit, function () {
	// Load modules
	connection = require('connection');
	agentCommander = require('agentCommander');
	// Start
	agentCommander.listen();
	connection.listen();
});