function NodeDomain(domainName, domainPath) {
        var connection = new NodeConnection();

        this.connection = connection;
        this._domainName = domainName;
        this._domainPath = domainPath;
        this._domainLoaded = false;
        this._load = this._load.bind(this);
        this._connectionPromise = connection.connect(true)
            .then(this._load);

        connection.on("close", function (event, promise) {
            this.connection.off(EVENT_NAMESPACE);
            this._domainLoaded = false;
            this._connectionPromise = promise.then(this._load);
        }.bind(this));
    }
Provides a simple abstraction for executing the commands of a single
domain loaded via a NodeConnection. Automatically handles connection
management and domain loading, and exposes each command in the domain as
a promise-returning method that can safely be called regardless of the
current status of the underlying connection. Example usage:

    var myDomain = new NodeDomain("someDomain", "/path/to/SomeDomainDef.js"),
        $result = myDomain.exec("someCommand", arg1, arg2);

    $result.done(function (value) {
        // the command succeeded!
    });

    $result.fail(function (err) {
        // the command failed; act accordingly!
    });

To handle domain events, just listen for the event on the domain:

    myDomain.on("someEvent", someHandler);

@constructor
@param {string} domainName Name of the registered Node Domain
@param {string} domainPath Full path of the JavaScript Node domain specification