Initialize the test domain with commands and events related to find in files.
@param {DomainManager} domainManager The DomainManager for the TernNodeDomain
425689
function init(domainManager) {
    if (!domainManager.hasDomain("TernNodeDomain")) {
        domainManager.registerDomain("TernNodeDomain", {major: 0, minor: 1});
    }

    _domainManager = domainManager;

    domainManager.registerCommand(
        "TernNodeDomain",       // domain name
        "invokeTernCommand",    // command name
        invokeTernCommand,   // command handler function
        false,          // this command is synchronous in Node
        "Invokes a tern command on node",
        [{name: "commandConfig", // parameters
            type: "object",
            description: "Object containing tern command configuration"}]
    );

    domainManager.registerCommand(
        "TernNodeDomain",       // domain name
        "setInterface",    // command name
        setInterface,   // command handler function
        false,          // this command is synchronous in Node
        "Sets the shared message interface",
        [{name: "msgInterface", // parameters
            type: "object",
            description: "Object containing messageId enums"}]
    );

    domainManager.registerCommand(
        "TernNodeDomain",       // domain name
        "resetTernServer",    // command name
        resetTernServer,   // command handler function
        true,          // this command is synchronous in Node
        "Resets an existing tern server"
    );

    domainManager.registerEvent(
        "TernNodeDomain",     // domain name
        "data",   // event name
        [
            {
                name: "data",
                type: "Object",
                description: "data to be returned to main thread"
            }
        ]
    );
    setTimeout(checkInterfaceAndReInit, 1000);
}
318296
private void initStandAlone(String[] args) {
        if (m_bInitialized) {
            m_logger.warn("initStandAlone: Already initialized -- ignoring");
            return;
        }
        m_logger.info("Initializing standalone mode");
        initConfig(args);
        initStandaAloneServices();
        RESTService.instance().registerCommands(CMD_CLASSES);
        m_bInitialized = true;
    }
77150
function initTernModule() {
            var moduleDeferred = $.Deferred();
            ternPromise = moduleDeferred.promise();
            
            function prepareTern() {  
                _ternNodeDomain.exec("setInterface", {
                    messageIds : MessageIds
                });

                _ternNodeDomain.exec("invokeTernCommand", {
                    type: MessageIds.SET_CONFIG,
                    config: config
                });
                moduleDeferred.resolveWith(null, [_ternNodeDomain]);
            }
            
            if (_ternNodeDomain) {
                _ternNodeDomain.exec("resetTernServer");
                moduleDeferred.resolveWith(null, [_ternNodeDomain]);
            } else {
                _ternNodeDomain     = new NodeDomain("TernNodeDomain", _domainPath);
                _ternNodeDomain.on("data", function (evt, data) {
                    if (config.debug) {
                        console.log("Message received", data.type);
                    }

                    var response = data,
                        type = response.type;

                    if (type === MessageIds.TERN_COMPLETIONS_MSG ||
                            type === MessageIds.TERN_CALLED_FUNC_TYPE_MSG) {
                        // handle any completions the tern server calculated
                        handleTernCompletions(response);
                    } else if (type === MessageIds.TERN_GET_FILE_MSG) {
                        // handle a request for the contents of a file
                        handleTernGetFile(response);
                    } else if (type === MessageIds.TERN_JUMPTODEF_MSG) {
                        handleJumptoDef(response);
                    } else if (type === MessageIds.TERN_SCOPEDATA_MSG) {
                        handleScopeData(response);
                    } else if (type === MessageIds.TERN_REFS) {
                        handleRename(response);
                    } else if (type === MessageIds.TERN_PRIME_PUMP_MSG) {
                        handlePrimePumpCompletion(response);
                    } else if (type === MessageIds.TERN_GET_GUESSES_MSG) {
                        handleGetGuesses(response);
                    } else if (type === MessageIds.TERN_UPDATE_FILE_MSG) {
                        handleUpdateFile(response);
                    } else if (type === MessageIds.TERN_INFERENCE_TIMEDOUT) {
                        handleTimedOut(response);
                    } else if (type === MessageIds.TERN_WORKER_READY) {
                        moduleDeferred.resolveWith(null, [_ternNodeDomain]);
                    } else if (type === "RE_INIT_TERN") {
                        // Ensure the request is because of a node restart
                        if (currentModule) {
                            prepareTern();
                            // Mark the module with resetForced, then creation of TernModule will 
                            // happen again as part of '_maybeReset' call
                            currentModule.resetForced = true;
                        }
                    } else {
                        console.log("Tern Module: " + (response.log || response));
                    }
                });
            
                _ternNodeDomain.promise().done(prepareTern);
            }
        }
166855
function init (directory, callback) {
  var source = path.join(__dirname, 'template');
  ncp(source, directory, callback);
}
1021741
public void setDomainEntries(java.util.Collection<DomainEntry> domainEntries) {
        if (domainEntries == null) {
            this.domainEntries = null;
            return;
        }

        this.domainEntries = new java.util.ArrayList<DomainEntry>(domainEntries);
    }
104587
function init() {
	// Locate config if we dont have one {{{
	if (_.isUndefined(appConfig)) {
		appConfigLocations.forEach(function(key) {
			if (_.has(global, key)) {
				appConfig = _.get(global, key);
				return false;
			}
		});
		if (_.isUndefined(appConfig)) throw new Error('Cannot find email config in', appConfigLocations);
	}
	// }}}

	this.config = { // Reset basics
		from: appConfig.email.from,
		to: appConfig.email.to,
		subject: appConfig.email.subject || '',
		cc: appConfig.email.cc || [],
		bcc: appConfig.email.bcc || [],
	};

	// Work out mail transport {{{
	if (appConfig.email.enabled) {
		switch (appConfig.email.method) {
			case 'mailgun':
				if (
					/^https?:\/\//.test(appConfig.mailgun.domain) ||
					/mailgun/.test(appConfig.mailgun.domain)
				) throw new Error("Mailgun domain should not contain 'http(s)://' prefix or mailgun. Should resemble the domain name e.g. 'acme.com'");

				transporter = nodemailer.createTransport(nodemailerMailgun({
					auth: {
						api_key: appConfig.mailgun.apiKey,
						domain: appConfig.mailgun.domain,
					},
				}));
				break
			case 'sendmail':
				transporter = nodemailer.createTransport(nodemailerSendmail());
				break;
			default:
				next('Unknown mail transport method: ' + appConfig.email.method);
		}
	}
	// }}}

	return this;
}
27482
function Domain(options) {
  EventEmitter.call(this);

  options = options || {};

  if (!options.domainPath) {
    var err = new Error('Please provide domainPath or domainLoader in options');
    debug(err);
    throw err;
  }

  options.retryOnConcurrencyTimeout = options.retryOnConcurrencyTimeout || 800;

  options.commandRejectedEventName = options.commandRejectedEventName || 'commandRejected';

  options.snapshotThreshold = options.snapshotThreshold || 100;

  options.useLoaderExtensions = options.useLoaderExtensions || false;

  this.structureLoader = createStructureLoader(options.structureLoader);

  this.eventStore = createEventStore(options.eventStore);

  this.aggregateLock = createAggregateLock(options.aggregateLock);

  if (options.deduplication) {
    this.commandBumper = createCommandBumper(options.deduplication);
  }

  this.options = options;

  this.definitions = {
    command: {
      id: 'id',
      name: 'name',
      aggregateId: 'aggregate.id'
//      context: 'context.name',        // optional
//      aggregate: 'aggregate.name',    // optional
//      payload: 'payload',             // optional
//      revision: 'revision',           // optional
//      version: 'version',             // optional
//      meta: 'meta'                    // optional (will be passed directly to corresponding event(s))
    },
    event: {
      correlationId: 'correlationId',
      id: 'id',
      name: 'name',
      aggregateId: 'aggregate.id',
//      context: 'context.name',        // optional
//      aggregate: 'aggregate.name',    // optional
      payload: 'payload',               // optional
      revision: 'revision'              // optional
//      version: 'version',             // optional
//      meta: 'meta'                    // optional (will be passed directly from corresponding command)
    }
  };

  this.idGenerator(function () {
    return uuid().toString();
  });

  this.onEvent(function (evt) {
    debug('emit:', evt);
  });

  this.extendValidator(function (validator) {
    debug('no validator extension defined');
  });
}
914071
function setDomains(newDomains) {
    if (!isObject(newDomains)) {
        throw new InvalidException('newDomains should be an object', newDomains);
    }
    domainsMap = domainsMap.merge(newDomains);
}
330572
function resetModule() {
            function resetTernServer() {
                if (_ternNodeDomain.ready()) {
                    _ternNodeDomain.exec('resetTernServer');
                }
            }
            
            if (_ternNodeDomain) {
                if (addFilesPromise) {
                    // If we're in the middle of added files, don't reset 
                    // until we're done
                    addFilesPromise.done(resetTernServer).fail(resetTernServer);
                } else {
                    resetTernServer();
                }
            }
        }
132171
def _add_mgmt_to_domains(self, conf, mgmts):
        

        for dom_name, dom_spec in conf['domains'].iteritems():
            domain_mgmt = [
                nic['net'] for nic in dom_spec['nics'] if nic['net'] in mgmts
            ].pop()

            dom_spec['mgmt_net'] = domain_mgmt
1109373
function initDomHandler(instance) {
    zrUtil.each(touchHandlerNames, function (name) {
        instance._handlers[name] = zrUtil.bind(domHandlers[name], instance);
    });

    zrUtil.each(pointerHandlerNames, function (name) {
        instance._handlers[name] = zrUtil.bind(domHandlers[name], instance);
    });

    zrUtil.each(mouseHandlerNames, function (name) {
        instance._handlers[name] = makeMouseHandler(domHandlers[name], instance);
    });

    function makeMouseHandler(fn, instance) {
        return function () {
            if (instance._touching) {
                return;
            }
            return fn.apply(instance, arguments);
        };
    }
}
1053246
function Resolver(domains, arbiters, exts, npmTree, builtIns, serverModules) {
  this.finder = makeFinder(exts);
  this.npmResolve = makeNpmResolver(domains.npm);
  this.domains = domains;
  this.arbiters = arbiters;
  this.exts = exts;
  this.npmTree = npmTree;
  this.builtIns = builtIns;
  this.serverModules = serverModules;
}
809053
public void init (PlaceManager plmgr, RootDObjectManager omgr, InvocationManager invmgr)
    {
        _plmgr = plmgr;
        _omgr = omgr;
        _invmgr = invmgr;
    }
493946
public static void initialize(Object instance, Map namedArgs) {
        PersistentEntity dc = getDomainClass(instance);
        if (dc == null) {
            DataBindingUtils.bindObjectToInstance(instance, namedArgs);
        }
        else {
            DataBindingUtils.bindObjectToDomainInstance(dc, instance, namedArgs);
            DataBindingUtils.assignBidirectionalAssociations(instance, namedArgs, dc);
        }
        autowire(instance);
    }
1253172
function (callback) {

    var self = this;

    var warnings = null;

    async.series([
      // load domain files...
      function (callback) {
        debug('load denormalizer files..');
        self.structureLoader(self.options.denormalizerPath, function (err, tree, warns) {
          if (err) {
            return callback(err);
          }
          warnings = warns;
          self.tree = attachLookupFunctions(tree);
          callback(null);
        });
      },

      // prepare infrastructure...
      function (callback) {
        debug('prepare infrastructure...');
        async.parallel([

          // prepare repository...
          function (callback) {
            debug('prepare repository...');

            self.repository.on('connect', function () {
              self.emit('connect');
            });

            self.repository.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.repository.connect(callback);
          },

          // prepare revisionGuard...
          function (callback) {
            debug('prepare revisionGuard...');

            self.revisionGuardStore.on('connect', function () {
              self.emit('connect');
            });

            self.revisionGuardStore.on('disconnect', function () {
              self.emit('disconnect');
            });

            self.revisionGuardStore.connect(callback);
          }
        ], callback);
      },

      // inject all needed dependencies...
      function (callback) {
        debug('inject all needed dependencies...');

        self.revisionGuard = new RevisionGuard(self.revisionGuardStore, self.options.revisionGuard);
        self.revisionGuard.onEventMissing(function (info, evt) {
          self.onEventMissingHandle(info, evt);
        });

        self.eventDispatcher = new EventDispatcher(self.tree, self.definitions.event);
        self.tree.defineOptions(self.options)
          .defineEvent(self.definitions.event)
          .defineNotification(self.definitions.notification)
          .idGenerator(self.getNewId)
          .useRepository(self.repository);

        self.revisionGuard.defineEvent(self.definitions.event);

        self.replayHandler = new ReplayHandler(self.eventDispatcher, self.revisionGuardStore, self.definitions.event, self.options);

        callback(null);
      }
    ], function (err) {
      if (err) {
        debug(err);
      }
      if (callback) { callback(err, warnings); }
    });
  }
1170991
public boolean init(String modelDir) {
		this.modelDir = modelDir;
		
		Option taggerOpt = new Option(this.modelDir);
		if (!taggerOpt.readOptions()) {
			return false;
		}

		taggerMaps = new Maps();
		taggerDict = new Dictionary();
		taggerFGen = new FeatureGen(taggerMaps, taggerDict);
		taggerVtb = new Viterbi();

		taggerModel = new Model(taggerOpt, taggerMaps, taggerDict, taggerFGen,
				taggerVtb);
		if (!taggerModel.init()) {
			System.out.println("Couldn't load the model");
			System.out.println("Check the <model directory> and the <model file> again");
			return false;
		}
		return true;
	}
1127409
function ComponentManager(generator, config) {
        this._parserManager = new ParserManager(config);
        this._config = config || {};
        this._allComponents = {};
        this._componentsForLayer = {};
        this._componentsForComp = {};
        this._componentsForDocument = {};
        this._paths = {};
        this._defaultLayerId = null;
        this._metaDefaultComponents = [];
        this._metaDataRoot = config["meta-data-root"] || META_PLUGIN_ID;
    }