Different RenderEngines can register themselves with the
EngineManager factory to be available with EngineManager.getInstance();

@param engine RenderEngine instance, e.g. SnipRenderEngine
341760
public static synchronized void registerEngine(RenderEngine engine) {
    if (null == availableEngines) {
      availableEngines = new HashMap();
    }
    availableEngines.put(engine.getName(), engine);
  }
57018
def _make_render_engine(self):
        
        resolve_context = self._make_resolve_context()
        resolve_partial = self._make_resolve_partial()

        engine = RenderEngine(literal=self._to_unicode_hard,
                              escape=self._escape_to_unicode,
                              resolve_context=resolve_context,
                              resolve_partial=resolve_partial,
                              to_str=self.str_coerce)
        return engine
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;
    }
840490
@Override
    public void initialize(JsMessagingEngine engine) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialize", engine);

        // Get the admin factory class
        try {
            jsaf = JsAdminFactory.getInstance();
        } catch (Exception e) {
            // No FFDC code needed
        }

        // Synchronize on stateChangeLock to manage the startup of the engine with
        // potential addition of new engine components via dynamic config.
//        processor = _mainImpl.mpService.getService().getInstance();
        ListIterator<ComponentList> li = null;
        boolean initializationFailed = false;

        synchronized (stateChangeLock) {

            setState(STATE_INITIALIZING);
            for (int i = 0; i < NUM_STOP_PHASES; i++)
            {
                stopSequence[i] = new Vector<ComponentList>();
            }
            try
            {
                _messageStore = JsMainAdminComponentImpl.messageStoreRef.getService();

            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }

            _messageProcessor = loadClass(JsConstants.SIB_CLASS_MP, STOP_PHASE_1, true);

            // Initialize any engine components
            initializationFailed = false;

        } // synchronized(stateChangeLock)
        try {
            //Initialize the message store 
            _messageStore.initialize(this);
            //Initialize the message processor 
            _messageProcessor.initialize(this);
            setState(STATE_INITIALIZED);
        } catch (Exception e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, CLASS_NAME + ".<init>", "625", this);
            SibTr.error(tc, "ME_CANNOT_BE_INITIALIZED_SIAS0033", new Object[] { _name, "MessageProcessor.java", "initialize()" });
            SibTr.exception(tc, e);
            initializationFailed = true;

        }
        if (initializationFailed) {
            destroy();
            // Cleanup finished...
            // Change state to UNINITIALIZED
            setState(STATE_UNINITIALIZED);
        } else {
            setState(STATE_INITIALIZED);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialize");
    }
874612
public function searchEngine(EngineInterface $engine = null)
    {
        if ($engine !== null) {
            $this->_engine = $engine;
        }

        return $this->_engine;
    }
296114
function customRenderFn(renderFn) {
  // The loader context.
  var _this = this

  return function (engine, template, locals, options) {
    return renderFn.call(_this, template, locals, options)
  }
}
303996
public JsEngineComponent getEngineComponent(String className) {

        String thisMethodName = "getEngineComponent";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, className);
        }

        JsEngineComponent foundEngineComponent = null;

        // No need to synchronize on jmeComponents to prevent concurrent
        // modification from dynamic config and runtime callbacks, because
        // jmeComponents is now a CopyOnWriteArrayList.
        Iterator<ComponentList> vIter = jmeComponents.iterator();

        while (vIter.hasNext() && foundEngineComponent == null) {
            ComponentList c = vIter.next();
            if (c.getClassName().equals(className)) {
                foundEngineComponent = c.getRef();
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, foundEngineComponent);
        }

        return foundEngineComponent;
    }
1091874
private <A extends Annotation, AS extends Annotation> void addOrMergeInjectionBinding(int processorIndex,
                                                                                          InjectionProcessor<A, AS> processor,
                                                                                          Class<?> klass,
                                                                                          Member member,
                                                                                          A ann)
                    throws InjectionException
    {
        // Lazily create override processors as needed.
        if (ivOverrideIndices != null)
        {
            int overrideIndex = ivOverrideIndices[processorIndex];
            if (overrideIndex != -1)
            {
                // Create and set the override processor only once.
                ivOverrideIndices[processorIndex] = -1;

                InjectionProcessor<?, ?> overrideProcessor = getProcessor(overrideIndex, ivProviders.get(overrideIndex));
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "adding override processor " + overrideProcessor + " to " + processor);
                InjectionProcessorContextImpl.setOverrideProcessor(processor, overrideProcessor);
            }
        }

        InjectionProcessorContextImpl.addOrMergeInjectionBinding(processor, klass, member, ann);
    }
1085987
protected void initializeNewEngineComponent(JsEngineComponent engineComponent) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, "initializeNewEngineComponent", engineComponent);
        }

        // Synchronize on stateChangeLock to manage the startup of the engine with
        // potential addition of new engine components via dynamic config.

        synchronized (stateChangeLock) {

            if (_state != STATE_UNINITIALIZED && _state != STATE_DESTROYED) {
                // Initialize
                engineComponent.initialize(this);
                // Set ME config
                engineComponent.setConfig(this);
            }

            if (_state == STATE_STARTING || _state == STATE_STARTED) {
                // Start engine component (in recovery mode if needed)
                int mode = JsConstants.ME_START_DEFAULT;
                if (_mainImpl.isServerInRecoveryMode() == true) {
                    mode += JsConstants.ME_START_RECOVERY;
                }
                engineComponent.start(mode);
            }

        } // synchronized (stateChangeLock)

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, "initializeNewEngineComponent");
        }
    }
328393
public static synchronized RenderEngine getInstance(String name) {
    if (null == availableEngines) {
      availableEngines = new HashMap();
    }

    //Logger.debug("Engines: " + availableEngines);
    return (RenderEngine) availableEngines.get(name);
  }
272860
public void registerParameters(IGenerator<? extends IChemObject> generator) {
        for (IGeneratorParameter<?> param : generator.getParameters()) {
            try {
                renderingParameters.put(param.getClass().getName(),
                                        param.getClass().newInstance());
            } catch (InstantiationException | IllegalAccessException e) {
                throw new IllegalStateException("Could not create a copy of rendering parameter.");
            }
        }
    }
1339700
public GedRenderer<? extends GedObject> create(
            final GedObject gedObject,
            final RenderingContext renderingContext) {
        if (gedObject != null) {
            final RendererBuilder builder = builders.get(gedObject.getClass());
            if (builder != null) {
                return builder.build(gedObject, this, renderingContext);
            }
        }
        return new DefaultRenderer(
                gedObject, this, renderingContext);
    }
263322
private static Renderer createRenderer(final String rendererName) {
		if (rendererName.endsWith(".vm")) {
			// This is a velocity template, so use a VelocityLayout
			return new VelocityRenderer(rendererName);
		}

		try {
			Class<?> managerClass = Class.forName(rendererName);
			Object manager = managerClass.newInstance();

			if (!(manager instanceof Renderer)) {
				throw new SystemException(rendererName + " is not a Renderer");
			}

			return (Renderer) manager;
		} catch (ClassNotFoundException e) {
			// Legal - there might not a manager implementation in a given theme
			return null;
		} catch (InstantiationException e) {
			throw new SystemException("Failed to instantiate " + rendererName, e);
		} catch (IllegalAccessException e) {
			throw new SystemException("Failed to access " + rendererName, e);
		}
	}
275833
public void initialize(final JsMessagingEngine engine) {

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

        final Set listeners;

        _messagingEngine = engine;

        synchronized (MESSAGING_ENGINES) {

            // Do we already have a set of initialized MEs on this bus?
            Set messagingEngines = (Set) MESSAGING_ENGINES.get(engine
                    .getBusName());

            // If not, create a new set and add it to the map
            if (messagingEngines == null) {

                messagingEngines = new HashSet();
                MESSAGING_ENGINES.put(engine.getBusName(), messagingEngines);

            }

            // Add the initializing ME to the set
            messagingEngines.add(engine);

            // Get listeners to notify
            listeners = getListeners(_messagingEngine.getBusName());

        }

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

            final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator
                    .next();
            listener.messagingEngineInitializing(_messagingEngine);

        }

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

    }
244222
protected ScriptEngine getEngine()
    {
        if (engine == null)
        {
            ScriptEngineManager factory = new ScriptEngineManager();
            engine = factory.getEngineByName("JavaScript");
            engine.put("proc", this);
            
            //rhino compatibility workaround, println should be replaced by print in all occurences
            try
            {
                engine.eval("if (typeof println == 'undefined') this.println = print;");
            } catch (ScriptException e) {
                e.printStackTrace();
            }
            
            Map<String, ScriptObject> scriptObjects = ServiceManager.findScriptObjects();
            for (Map.Entry<String, ScriptObject> obj : scriptObjects.entrySet())
            {
                engine.put(obj.getKey(), obj.getValue());
            }
        }
        return engine;
    }
1085596
public function registerEngineResolver()
    {
        $this->container['view.engine.resolver'] = function () {
            $resolver = new EngineResolver;

            // Next, we will register the various view engines with the resolver so that the
            // environment will resolve the engines needed for various views based on the
            // extension of view file. We call a method for each of the view's engines.
            foreach (['file', 'php', 'blade'] as $engine) {
                $this->{'register' . ucfirst($engine) . 'Engine'}($resolver);
            }

            return $resolver;
        };
    }
416902
public function registerFactory()
    {
        // Next we need to grab the engine resolver instance that will be used by the
        // environment. The resolver will be used by an environment to get each of
        // the various engine implementations such as plain PHP or Blade engine.
        $resolver = $this->container['view.engine.resolver'];

        $finder = $this->container['view.finder'];

        $env = new Factory($resolver, $finder, $this->container['events']);

        // We will also set the container instance on this view environment since the
        // view composers may be classes registered in the container, which allows
        // for great testable, flexible composers for the application developer.
        $env->setContainer($this->container);

        return $env;
    }