Call this to create a new engine. This method uses the engine
config singleton to create the engine.
187199
@Override
    public final IEngine createEngine() {
        IPluginRegistry pluginRegistry = createPluginRegistry();
        IDataEncrypter encrypter = createDataEncrypter(pluginRegistry);
        CurrentDataEncrypter.instance = encrypter;
        IRegistry registry = createRegistry(pluginRegistry, encrypter);
        IComponentRegistry componentRegistry = createComponentRegistry(pluginRegistry);
        IConnectorFactory cfactory = createConnectorFactory(pluginRegistry);
        IPolicyFactory pfactory = createPolicyFactory(pluginRegistry);
        IMetrics metrics = createMetrics(pluginRegistry);
        IDelegateFactory logFactory = createLoggerFactory(pluginRegistry);
        IApiRequestPathParser pathParser = createRequestPathParser(pluginRegistry);

        List<IGatewayInitializer> initializers = createInitializers(pluginRegistry);
        for (IGatewayInitializer initializer : initializers) {
            initializer.initialize();
        }

        complete();
        return new EngineImpl(registry, pluginRegistry, componentRegistry, cfactory, pfactory, metrics, logFactory, pathParser);
    }
1253999
def create_engine(minsize=1, maxsize=10, loop=None,
                  dialect=_dialect, pool_recycle=-1,  compiled_cache=None,
                  **kwargs):
    
    deprecated_cursor_classes = [
        DeserializationCursor, DictCursor, SSCursor, SSDictCursor,
    ]

    cursorclass = kwargs.get('cursorclass', Cursor)
    if not issubclass(cursorclass, Cursor) or any(
        issubclass(cursorclass, cursor_class)
        for cursor_class in deprecated_cursor_classes
    ):
        raise ArgumentError('SQLAlchemy engine does not support '
                            'this cursor class')

    coro = _create_engine(minsize=minsize, maxsize=maxsize, loop=loop,
                          dialect=dialect, pool_recycle=pool_recycle,
                          compiled_cache=compiled_cache, **kwargs)
    return _EngineContextManager(coro)
116030
def new(self, *args, **kwargs):
        '''
'''
        return self.session().add(self.model(*args, **kwargs))
161316
def singleton(cls):
    '''
    
    '''

    cls.__new_original__ = cls.__new__

    @wraps(cls.__new__)
    def singleton_new(cls, *args, **kw):
        it = cls.__dict__.get('__it__')
        if it is not None:
            return it

        cls.__it__ = it = cls.__new_original__(cls, *args, **kw)
        it.__init_original__(*args, **kw)
        return it

    cls.__new__ = singleton_new
    cls.__init_original__ = cls.__init__
    cls.__init__ = object.__init__

    return cls
1055226
def compile(self):
        

        from ..engines import get_default_engine

        engine = get_default_engine(self)
        return engine.compile(self)
99166
function Engine() {
      var _this;

      var ua = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
      var cssFlagsPrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'engine';

      _classCallCheck(this, Engine);

      _this = _possibleConstructorReturn(this, _getPrototypeOf(Engine).call(this, ua, flags, cssFlagsPrefix));
      _this.version = 'n/a';
      return _this;
    }
146711
def init(**kwargs):
    

    # TODO: Iterate through all engines in name set.
    database = kwargs.pop('database', False)
    if database and not database_exists(engine['default'].url):
        create_database(engine['default'].url, encoding='utf8')
        clear_cache()

    expression = lambda target, table: table.create(target)
    test = lambda target, table: table.exists(target)
    op(expression, test=test, primary='init', secondary='create', **kwargs)
68158
def create(cls, config_file=None):
        
        if cls.instance is None:
            cls.instance = cls(config_file)

            # Load config file, possibly overwriting the defaults
            cls.instance.load_ini()

        if config_file and config_file != cls.instance.config_file:
            raise RuntimeError("Configuration initialized a second time with a different file!")

        return cls.instance
22023
public static void reloadInstance(CFMLEngine engine, ConfigServerImpl configServer)
	    throws SAXException, ClassException, PageException, IOException, TagLibException, FunctionLibException, BundleException {
	Resource configFile = configServer.getConfigFile();

	if (configFile == null) return;
	if (second(configServer.getLoadTime()) > second(configFile.lastModified())) return;
	int iDoNew = doNew(engine, configServer.getConfigDir(), false).updateType;
	boolean doNew = iDoNew != NEW_NONE;

	load(configServer, loadDocument(configFile), true, doNew);

	((CFMLEngineImpl) ConfigWebUtil.getEngine(configServer)).onStart(configServer, true);
    }
521331
def make_connector(self, app=None, bind=None):
        """"""
        return _EngineConnector(self, self.get_app(app), bind)
562460
function setEngine(Engine, config) {
    initialized = false;
    engine = new Engine(config);

    init(config);
  }
381609
private static void createFactoryInstance()
  {
    if (tc.isEntryEnabled())
      tc.entry(cclass, "createFactoryInstance");

    try
    {
      Class cls = Class.forName(MATCHING_CLASS_NAME);
      instance = (Matching) cls.newInstance();
    }
    catch (Exception e)
    {
      // No FFDC Code Needed.
      // FFDC driven by wrapper class.
      FFDC.processException(cclass,
        "com.ibm.ws.sib.matchspace.Matching.createFactoryInstance",
        e,
        "1:94:1.18");
//TODO: trace.error  
//      tc.error(cclass, "UNABLE_TO_CREATE_MATCHING_INSTANCE_CWSIH0007E", e);

      createException = e;
    }
    
    if (tc.isEntryEnabled())
      tc.exit(cclass, "createFactoryInstance");
  }
1316967
def new(self, name, *args, **kwargs):
        '''
        '''
        if name in self._instance_map:
            raise ValueError('Instance {0} is already initialized'
                             .format(name))

        instance = self._class_map[name](*args, **kwargs)
        self._instance_map[name] = instance
        return instance
1207957
public static final synchronized void start(Engine engine)
    {
        Check.notNull(engine);

        if (started)
        {
            throw new LionEngineException(ERROR_STARTED_ALREADY);
        }
        Verbose.info(new StringBuilder(MIN_LENGTH).append(ENGINE_STARTING)
                                                  .append(Constant.ENGINE_VERSION)
                                                  .append(Constant.QUOTE)
                                                  .append(FOR)
                                                  .append(Constant.QUOTE)
                                                  .append(engine.getName())
                                                  .append(Constant.SPACE)
                                                  .append(engine.getVersion())
                                                  .append(Constant.QUOTE)
                                                  .toString());

        Medias.setFactoryMedia(new FactoryMediaDefault());

        engine.open();
        Engine.engine = engine;
        started = true;
    }
1132877
def create(self):
        
        # add various pointers to those editing vent_cfg
        if self.vent_cfg:
            self.add(npyscreen.Textfield,
                     value='# when configuring external'
                           ' services make sure to do so',
                     editable=False)
            self.add(npyscreen.Textfield,
                     value='# in the form of Service = {"setting": "value"}',
                     editable=False)
            self.add(npyscreen.Textfield,
                     value='# make sure to capitalize your service correctly'
                           ' (i.e. Elasticsearch vs. elasticsearch)',
                     editable=False)
            self.add(npyscreen.Textfield,
                     value='# and make sure to enclose all dict keys and'
                           ' values in double quotes ("")',
                     editable=False)
            self.add(npyscreen.Textfield,
                     value='',
                     editable=False)
        elif self.instance_cfg:
            self.add(npyscreen.Textfield,
                     value='# these settings will be used'
                           ' to configure the new instances',
                     editable=False)
        self.edit_space = self.add(npyscreen.MultiLineEdit,
                                   value=self.config_val)
836226
def create_table(self, model_class):
        '''
        
        '''
        if model_class.is_system_model():
            raise DatabaseException("You can't create system table")
        if getattr(model_class, 'engine') is None:
            raise DatabaseException("%s class must define an engine" % model_class.__name__)
        self._send(model_class.create_table_sql(self))
903017
def create_session_engine(uri=None, cfg=None):
    
    if uri is not None:
        eng = sa.create_engine(uri)
    elif cfg is not None:
        eng = sa.create_engine(cfg.get('db', 'SA_ENGINE_URI'))
    else:
        raise IOError("unable to connect to SQL database")
    ses = orm.sessionmaker(bind=eng)()
    return ses, eng