-
- All Implemented Interfaces:
-
com.facebook.react.bridge.JSIModule,com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry
public class TurboModuleManager implements JSIModule, TurboModuleRegistry
This is the main class and entry point for TurboModules. Note that this is a hybrid class, and has a C++ counterpart This class installs the JSI bindings. It also implements the method to get a Java module, that the C++ counterpart calls.
-
-
Constructor Summary
Constructors Constructor Description TurboModuleManager(RuntimeExecutor runtimeExecutor, TurboModuleManagerDelegate delegate, CallInvokerHolder jsCallInvokerHolder, CallInvokerHolder nativeCallInvokerHolder)
-
Method Summary
Modifier and Type Method Description List<String>getEagerInitModuleNames()Return the names of all the NativeModules that are supposed to be eagerly initialized. TurboModulegetModule(String moduleName)Return the TurboModule instance that corresponds to the provided moduleName. Collection<TurboModule>getModules()Which TurboModules have been created? booleanhasModule(String moduleName)Has the TurboModule with name `moduleName` been instantiated? voidinitialize()This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules. voidonCatalystInstanceDestroy()Called before {CatalystInstance#onHostDestroy} -
-
Constructor Detail
-
TurboModuleManager
TurboModuleManager(RuntimeExecutor runtimeExecutor, TurboModuleManagerDelegate delegate, CallInvokerHolder jsCallInvokerHolder, CallInvokerHolder nativeCallInvokerHolder)
-
-
Method Detail
-
getEagerInitModuleNames
List<String> getEagerInitModuleNames()
Return the names of all the NativeModules that are supposed to be eagerly initialized. Bycalling getModule on each name, this allows the application to eagerly initialize itsNativeModules.
-
getModule
@Nullable() TurboModule getModule(String moduleName)
Return the TurboModule instance that corresponds to the provided moduleName.
This method: - Creates and initializes the module if it doesn't already exist. - Returnsnull after TurboModuleManager has been torn down.
-
getModules
Collection<TurboModule> getModules()
Which TurboModules have been created?
-
hasModule
boolean hasModule(String moduleName)
Has the TurboModule with name `moduleName` been instantiated?
-
initialize
void initialize()
This is called at the end of createCatalystInstance afterthe CatalystInstance has been created, in order to initialize NativeModules that require theCatalystInstance or JS modules.
-
onCatalystInstanceDestroy
void onCatalystInstanceDestroy()
Called before {CatalystInstance#onHostDestroy}
-
-
-
-