C# 클래스 React.JavaScriptEngineFactory

Handles creation of JavaScript engines. All methods are thread-safe.
상속: IDisposable, IJavaScriptEngineFactory
파일 보기 프로젝트 열기: reactjs/React.NET

보호된 프로퍼티들

프로퍼티 타입 설명
_config IReactSiteConfiguration
_disposed bool
_engines IJsEngine>.ConcurrentDictionary
_factory Func
_fileSystem IFileSystem
_jsEngineSwitcher JavaScriptEngineSwitcher.Core.JsEngineSwitcher
_pool IJsPool
_scriptLoadException System.Exception

공개 메소드들

메소드 설명
Dispose ( ) : void

Clean up all engines

DisposeEngineForCurrentThread ( ) : void

Disposes the JavaScript engine for the current thread.

EnsureValidState ( ) : void

Ensures that this object has not been disposed, and that no error was thrown while loading the scripts.

GetEngine ( ) : IJsEngine

Gets a JavaScript engine from the pool.

GetEngineForCurrentThread ( ) : IJsEngine

Gets the JavaScript engine for the current thread. It is recommended to use GetEngine instead, which will pool/reuse engines.

JavaScriptEngineFactory ( JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem ) : System

Initializes a new instance of the JavaScriptEngineFactory class.

ReturnEngineToPool ( IJsEngine engine ) : void

Returns an engine to the pool so it can be reused

보호된 메소드들

메소드 설명
CreatePool ( ) : IJsPool

Creates a new JavaScript engine pool.

InitialiseEngine ( IJsEngine engine ) : void

Loads standard React and Babel scripts into the engine.

비공개 메소드들

메소드 설명
EngineIsUsable ( IJsEngine engine, bool allowMsie ) : bool

Performs a sanity check to ensure the specified engine type is usable.

EnsureJsEnginesRegistered ( JsEngineSwitcher jsEngineSwitcher, bool allowMsie ) : void

Ensures that some engines have been registered with JavaScriptEngineSwitcher. IF not, registers some default engines.

EnsureReactLoaded ( IJsEngine engine ) : void

Ensures that React has been correctly loaded into the specified engine.

GetFactory ( JsEngineSwitcher jsEngineSwitcher, bool allowMsie ) : Func

Gets a factory for the most appropriate JavaScript engine for the current environment. The first functioning JavaScript engine with the lowest priority will be used.

LoadUserScripts ( IJsEngine engine ) : void

Loads any user-provided scripts. Only scripts that don't need JSX transformation can run immediately here. JSX files are loaded in ReactEnvironment.

메소드 상세

CreatePool() 보호된 메소드

Creates a new JavaScript engine pool.
protected CreatePool ( ) : IJsPool
리턴 IJsPool

Dispose() 공개 메소드

Clean up all engines
public Dispose ( ) : void
리턴 void

DisposeEngineForCurrentThread() 공개 메소드

Disposes the JavaScript engine for the current thread.
public DisposeEngineForCurrentThread ( ) : void
리턴 void

EnsureValidState() 공개 메소드

Ensures that this object has not been disposed, and that no error was thrown while loading the scripts.
public EnsureValidState ( ) : void
리턴 void

GetEngine() 공개 메소드

Gets a JavaScript engine from the pool.
public GetEngine ( ) : IJsEngine
리턴 IJsEngine

GetEngineForCurrentThread() 공개 메소드

Gets the JavaScript engine for the current thread. It is recommended to use GetEngine instead, which will pool/reuse engines.
public GetEngineForCurrentThread ( ) : IJsEngine
리턴 IJsEngine

InitialiseEngine() 보호된 메소드

Loads standard React and Babel scripts into the engine.
protected InitialiseEngine ( IJsEngine engine ) : void
engine IJsEngine
리턴 void

JavaScriptEngineFactory() 공개 메소드

Initializes a new instance of the JavaScriptEngineFactory class.
public JavaScriptEngineFactory ( JsEngineSwitcher jsEngineSwitcher, IReactSiteConfiguration config, IFileSystem fileSystem ) : System
jsEngineSwitcher JavaScriptEngineSwitcher.Core.JsEngineSwitcher
config IReactSiteConfiguration
fileSystem IFileSystem
리턴 System

ReturnEngineToPool() 공개 메소드

Returns an engine to the pool so it can be reused
public ReturnEngineToPool ( IJsEngine engine ) : void
engine IJsEngine Engine to return
리턴 void

프로퍼티 상세

_config 보호되어 있는 프로퍼티

React configuration for the current site
protected IReactSiteConfiguration _config
리턴 IReactSiteConfiguration

_disposed 보호되어 있는 프로퍼티

Whether this class has been disposed.
protected bool _disposed
리턴 bool

_engines 보호되어 있는 프로퍼티

Contains all current JavaScript engine instances. One per thread, keyed on thread ID.
protected ConcurrentDictionary _engines
리턴 IJsEngine>.ConcurrentDictionary

_factory 보호되어 있는 프로퍼티

Function used to create new JavaScript engine instances.
protected Func _factory
리턴 Func

_fileSystem 보호되어 있는 프로퍼티

File system wrapper
protected IFileSystem _fileSystem
리턴 IFileSystem

_jsEngineSwitcher 보호되어 있는 프로퍼티

The JavaScript Engine Switcher instance used by ReactJS.NET
protected JsEngineSwitcher,JavaScriptEngineSwitcher.Core _jsEngineSwitcher
리턴 JavaScriptEngineSwitcher.Core.JsEngineSwitcher

_pool 보호되어 있는 프로퍼티

Pool of JavaScript engines to use
protected IJsPool _pool
리턴 IJsPool

_scriptLoadException 보호되어 있는 프로퍼티

The exception that was thrown during the most recent recycle of the pool.
protected Exception,System _scriptLoadException
리턴 System.Exception