public interface CatalystInstance extends MemoryPressureListener, JSInstance, JSBundleLoaderDelegate
Modifier and Type | Method and Description |
---|---|
void |
addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener)
Adds a idle listener for this Catalyst instance.
|
void |
addJSIModules(java.util.List<JSIModuleSpec> jsiModules) |
void |
callFunction(java.lang.String module,
java.lang.String method,
NativeArray arguments) |
void |
destroy()
Destroys this catalyst instance, waiting for any other threads in ReactQueueConfiguration
(besides the UI thread) to finish running.
|
void |
extendNativeModules(NativeModuleRegistry modules)
This method permits a CatalystInstance to extend the known Native modules.
|
JavaScriptContextHolder |
getJavaScriptContextHolder()
Get the C pointer (as a long) to the JavaScriptCore context associated with this instance.
|
CallInvokerHolder |
getJSCallInvokerHolder()
Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule
work on the JS Thread.
|
JSIModule |
getJSIModule(JSIModuleType moduleType) |
<T extends JavaScriptModule> |
getJSModule(java.lang.Class<T> jsInterface) |
CallInvokerHolder |
getNativeCallInvokerHolder()
Returns a hybrid object that contains a pointer to a Native CallInvoker, which is used to
schedule work on the NativeModules thread.
|
<T extends NativeModule> |
getNativeModule(java.lang.Class<T> nativeModuleInterface) |
NativeModule |
getNativeModule(java.lang.String moduleName) |
java.util.Collection<NativeModule> |
getNativeModules() |
ReactQueueConfiguration |
getReactQueueConfiguration() |
java.lang.String |
getSourceURL()
Return the source URL of the JS Bundle that was run, or
null if no JS bundle has been
run yet. |
<T extends NativeModule> |
hasNativeModule(java.lang.Class<T> nativeModuleInterface) |
boolean |
hasRunJSBundle() |
void |
initialize()
Initialize all the native modules
|
void |
invokeCallback(int callbackID,
NativeArrayInterface arguments) |
boolean |
isDestroyed() |
void |
registerSegment(int segmentId,
java.lang.String path)
This method registers the file path of an additional JS segment by its ID.
|
void |
removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener)
Removes a NotThreadSafeBridgeIdleDebugListener previously added with
addBridgeIdleDebugListener(com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener) |
void |
runJSBundle() |
void |
setGlobalVariable(java.lang.String propName,
java.lang.String jsonValue) |
void |
setTurboModuleManager(JSIModule getter)
For the time being, we want code relying on the old infra to also work with TurboModules.
|
handleMemoryPressure
loadScriptFromAssets, loadScriptFromFile, setSourceURLs
void runJSBundle()
boolean hasRunJSBundle()
java.lang.String getSourceURL()
null
if no JS bundle has been
run yet.void invokeCallback(int callbackID, NativeArrayInterface arguments)
invokeCallback
in interface JSInstance
void callFunction(java.lang.String module, java.lang.String method, NativeArray arguments)
void destroy()
boolean isDestroyed()
void initialize()
ReactQueueConfiguration getReactQueueConfiguration()
<T extends JavaScriptModule> T getJSModule(java.lang.Class<T> jsInterface)
<T extends NativeModule> boolean hasNativeModule(java.lang.Class<T> nativeModuleInterface)
<T extends NativeModule> T getNativeModule(java.lang.Class<T> nativeModuleInterface)
NativeModule getNativeModule(java.lang.String moduleName)
JSIModule getJSIModule(JSIModuleType moduleType)
java.util.Collection<NativeModule> getNativeModules()
void extendNativeModules(NativeModuleRegistry modules)
void addBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener)
void removeBridgeIdleDebugListener(NotThreadSafeBridgeIdleDebugListener listener)
addBridgeIdleDebugListener(com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener)
void registerSegment(int segmentId, java.lang.String path)
void setGlobalVariable(java.lang.String propName, java.lang.String jsonValue)
JavaScriptContextHolder getJavaScriptContextHolder()
Use the following pattern to ensure that the JS context is not cleared while you are using it: JavaScriptContextHolder jsContext = reactContext.getJavaScriptContextHolder() synchronized(jsContext) { nativeThingNeedingJsContext(jsContext.get()); }
void addJSIModules(java.util.List<JSIModuleSpec> jsiModules)
CallInvokerHolder getJSCallInvokerHolder()
CallInvokerHolder getNativeCallInvokerHolder()
void setTurboModuleManager(JSIModule getter)