Set the current engine.

@param engine - current engine
196408
public Context setEngine(Engine engine) {
        checkThread();
        if (engine != null) {
            if (template != null && template.getEngine() != engine) {
                throw new IllegalStateException("Failed to set the context engine, because is not the same to template engine. template engine: "
                        + template.getEngine().getName() + ", context engine: " + engine.getName()
                        + ", template: " + template.getName() + ", context: " + thread.getName());
            }
            if (parent != null && parent.getEngine() != engine) {
                parent.setEngine(engine);
            }
            if (this.engine == null) {
                setCurrent(engine.createContext(parent, current));
            }
        }
        this.engine = engine;
        return this;
    }
1136963
public static void setCurrent(@Nullable String reason)
    {
        if (reason != null)
        {
            if (currentReason == null)
                currentReason = new ThreadLocal<>();
            currentReason.set(reason);
        }
        else if (currentReason != null)
        {
            currentReason.remove();
        }
    }
1366977
protected void setSchema(final String schema) throws DatabaseEngineException {
        try {
            this.conn.setSchema(schema);
        } catch (final Exception e) {
            throw new DatabaseEngineException(String.format("Could not set current schema to '%s'", schema), e);
        }
    }
1361017
public void messagingEngineReloaded(final JsMessagingEngine engine) {

        final String methodName = "messagingEngineReloaded";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        boolean engineStarted = false;
        // Get all the active ME's that are on the same bus as the reloaded ME
        JsMessagingEngine[] engines = SibRaEngineComponent.getActiveMessagingEngines(engine.getBusName());

        for (int i = 0; i < engines.length; i++)
        {
          // Now check if the reloaded ME is part of the active ME's (i.e. a started ME
          if (engines[i].equals(engine))
          {
            //It is active so lets mark the engine as started
            engineStarted = true;
            break;
          }
        }

        // Only do this logic on a started engine. If the engine isn't started then when
        // the start is called we will do the same logic of trying to create a listener,
        // so there is no need to wait here till it starts.
        if (engineStarted)
        {
          try
          {

            /*
             * If there is not already a connection to the messaging engine and
             * a listener is still required given the new configuration, create
             * one now
             */

            if (!_connections.containsKey(engine.getUuid().toString())
                    && isListenerRequired(engine)) {

                createListener(engine);

            }

          }
          catch (final ResourceException exception)
          {

            // No FFDC code needed

            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                SibTr.exception(this, TRACE, exception);
            }

            SibTr.error(TRACE, "RELOAD_FAILED_CWSIV0773", new Object[] {
                    exception, engine.getName(), engine.getBusName(), this });

          }
        } // end of if(engineStarted)

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
582245
function(exts, fn, options) {
      if (arguments.length === 1 && typeof exts === 'string') {
        return this.getEngine(exts);
      }
      exts = utils.arrayify(exts);
      var len = exts.length;
      while (len--) {
        var ext = exts[len];
        if (ext && ext[0] !== '.') ext = '.' + ext;
        this._.engines.setEngine(ext, fn, options);
      }
      return this;
    }
511471
public function setEngine(string $engine)
  {
    if (in_array($engine, ['modulus', 'blade'])) {
      $this->engine = $engine;
      return $this;
    }

    $this->exception('Engine "' . $engine . '" does not exist.');
  }
1033493
@Override
    public void engineReloaded(Object newEngine) {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "engineReloaded", newEngine);
        // At this point, a dynamic configuartion change has occurred, admin
        // have updated all our
        // localized destinations and we should now make use of the new
        // configuration and drive
        // the update of any remote destinations if needed
        _engine = (JsMessagingEngine) newEngine;

        if (_busReloaded) {
            // The bus-wide definitions did change so we must refresh the
            // destinations that are
            // not localised to this ME.
            _dynamicConfigManager.refreshDestinations();
        }

        // Reset the indicator that bus-wide definitions have changed, now that
        // the updates have
        // been made.
        _busReloaded = false;
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "engineReloaded");
    }
1161132
public void setCurrent(String value)
    {
	current.replace(0, current.length(), value);
	cursor = 0;
	limit = current.length();
	limit_backward = 0;
	bra = cursor;
	ket = limit;
    }
180003
function Engine(options) {
  Options.call(this, options);
  this.views = {};
  this.defaultTemplates();
  this.defaultOptions();

  if (this.enabled('debug')) {
    this.debug();
  }
}
1307598
def set_current_time(self, current_time):
        
        current_time = c_double(current_time)
        try:
            self.library.set_current_time.argtypes = [POINTER(c_double)]
            self.library.set_current_time.restype = None
            self.library.set_current_time(byref(current_time))
        except AttributeError:
            logger.warn("Tried to set current time but method is not implemented in %s", self.engine)
1283162
@Override
    public void engineReloaded(Object messagingEngine)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "engineReloaded");

        // Defect 337421.1
        // Our config has been reloaded so we need to essentially
        // re-initialize so that the next time that we run start()
        // we pick up any changes.
        initialize((JsMessagingEngine) messagingEngine, true);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "engineReloaded");
    }
712930
def activate(self, engine):
        

        LOGGER.debug("> Activating '{0}' Component.".format(self.__class__.__name__))

        self.__engine = engine
        self.__settings = self.__engine.settings
        self.__settings_section = self.name

        self.__default_script_editor_directory = os.path.join(self.__engine.user_application_data_directory,
                                                              Constants.io_directory,
                                                              self.__default_script_editor_directory)
        not foundations.common.path_exists(self.__default_script_editor_directory) and \
        os.makedirs(self.__default_script_editor_directory)
        self.__default_session_directory = os.path.join(
            self.__default_script_editor_directory, self.__default_session_directory)
        not foundations.common.path_exists(self.__default_session_directory) and os.makedirs(
            self.__default_session_directory)
        self.__default_script_editor_file = os.path.join(self.__default_script_editor_directory,
                                                         self.__default_script_editor_file)

        self.__console = code.InteractiveConsole(self.__engine.locals)

        self.activated = True
        return True
929645
public function register(Engine $engine)
    {
        $engine->registerFunction('getFile', [$this, 'getFile']);
        $class = new \ReflectionClass(ViewFileTrait::class);
        foreach ($class->getMethods() as $method) {
            if ($method->name === 'getFile') {
                continue;
            }
            $engine->registerFunction($method->name, [$this, $method->name]);
        }
    }
1248082
public void setCurrentValue(final float currentValue) {
        this.currentValue = currentValue;
        initialValue = currentValue;
        targetValue = currentValue;
        transitionInProgress = false;
    }
1156039
def activate(self, engine):
        

        LOGGER.debug("> Activating '{0}' Component.".format(self.__class__.__name__))

        self.__engine = engine
        self.__settings = self.__engine.settings
        self.__settings_section = self.name

        self.__preferences_manager = self.__engine.components_manager["factory.preferences_manager"]

        self.__tcp_server = TCPServer(self.__address, self.__port, RequestsStackDataHandler)

        self.activated = True
        return True
781064
public void engineReloaded(Object objectSent) {

    	final JsMessagingEngine engine = (JsMessagingEngine)objectSent;
    	
        final String methodName = "engineReloaded";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        RELOADING_MESSAGING_ENGINES.remove(engine.getUuid().toString());

        // Get listeners to notify
        final Set listeners = getListeners(engine.getBusName());

        // Notify listeners
        for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) {

            final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator
                    .next();
            listener.messagingEngineReloaded(engine);

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
732396
public function register(Engine $engine)
    {
        $this->engine = $engine;
        $this->engine->registerFunction('html', array($this, 'getHtmlHelper'));
    }