本文整理汇总了Java中com.facebook.react.bridge.queue.ReactQueueConfigurationSpec类的典型用法代码示例。如果您正苦于以下问题:Java ReactQueueConfigurationSpec类的具体用法?Java ReactQueueConfigurationSpec怎么用?Java ReactQueueConfigurationSpec使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReactQueueConfigurationSpec类属于com.facebook.react.bridge.queue包,在下文中一共展示了ReactQueueConfigurationSpec类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createMockCatalystInstance
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
/**
* @return a CatalystInstance mock that has a default working ReactQueueConfiguration.
*/
public static CatalystInstance createMockCatalystInstance() {
ReactQueueConfigurationSpec spec = ReactQueueConfigurationSpec.builder()
.setJSQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.setNativeModulesQueueThreadSpec(MessageQueueThreadSpec.mainThreadSpec())
.build();
ReactQueueConfiguration ReactQueueConfiguration = ReactQueueConfigurationImpl.create(
spec,
new QueueThreadExceptionHandler() {
@Override
public void handleException(Exception e) {
throw new RuntimeException(e);
}
});
CatalystInstance reactInstance = mock(CatalystInstance.class);
when(reactInstance.getReactQueueConfiguration()).thenReturn(ReactQueueConfiguration);
when(reactInstance.getNativeModule(UIManagerModule.class))
.thenReturn(mock(UIManagerModule.class));
return reactInstance;
}
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:25,代码来源:ReactTestHelper.java
示例2: build
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
@Override
public CatalystInstance build() {
return new CatalystInstanceImpl.Builder()
.setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(new JSCJavaScriptExecutor(new WritableNativeMap()))
.setRegistry(mNativeModuleRegistryBuilder.build())
.setJSModulesConfig(mJSModulesConfigBuilder.build())
.setJSBundleLoader(JSBundleLoader.createFileLoader(
mContext,
"assets://AndroidTestBundle.js"))
.setNativeModuleCallExceptionHandler(
new NativeModuleCallExceptionHandler() {
@Override
public void handleException(Exception e) {
throw new RuntimeException(e);
}
})
.build();
}
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:20,代码来源:ReactTestHelper.java
示例3: CatalystInstanceImpl
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
private CatalystInstanceImpl(
final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry,
final JavaScriptModuleRegistry jsModuleRegistry,
final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
mHybridData = initHybrid();
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
ReactQueueConfigurationSpec,
new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry;
mJSModuleRegistry = jsModuleRegistry;
mJSBundleLoader = jsBundleLoader;
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread();
mTraceListener = new JSProfilerTraceListener(this);
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge");
initializeBridge(
new BridgeCallback(this),
jsExecutor,
mReactQueueConfiguration.getJSQueueThread(),
mNativeModulesQueueThread,
mJavaRegistry.getJavaModules(this),
mJavaRegistry.getCxxModules());
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge");
mMainExecutorToken = getMainExecutorToken();
}
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:33,代码来源:CatalystInstanceImpl.java
示例4: CatalystInstanceImpl
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
private CatalystInstanceImpl(
final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry,
final JavaScriptModuleRegistry jsModuleRegistry,
final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
FLog.w(ReactConstants.TAG, "Initializing React Xplat Bridge.");
mHybridData = initHybrid();
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
ReactQueueConfigurationSpec,
new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry;
mJSModuleRegistry = jsModuleRegistry;
mJSBundleLoader = jsBundleLoader;
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mNativeModulesQueueThread = mReactQueueConfiguration.getNativeModulesQueueThread();
mTraceListener = new JSProfilerTraceListener(this);
FLog.w(ReactConstants.TAG, "Initializing React Xplat Bridge before initializeBridge");
initializeBridge(
new BridgeCallback(this),
jsExecutor,
mReactQueueConfiguration.getJSQueueThread(),
mNativeModulesQueueThread,
mJavaRegistry.getJavaModules(this),
mJavaRegistry.getCxxModules());
FLog.w(ReactConstants.TAG, "Initializing React Xplat Bridge after initializeBridge");
mMainExecutorToken = getMainExecutorToken();
}
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:33,代码来源:CatalystInstanceImpl.java
示例5: CatalystInstanceImpl
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
private CatalystInstanceImpl(
final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry,
final JavaScriptModulesConfig jsModulesConfig,
final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
FLog.d(ReactConstants.TAG, "Initializing React Bridge.");
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
ReactQueueConfigurationSpec,
new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry;
mJSModuleRegistry = new JavaScriptModuleRegistry(CatalystInstanceImpl.this, jsModulesConfig);
mJSBundleLoader = jsBundleLoader;
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mTraceListener = new JSProfilerTraceListener();
try {
mBridge = mReactQueueConfiguration.getJSQueueThread().callOnQueue(
new Callable<ReactBridge>() {
@Override
public ReactBridge call() throws Exception {
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "initializeBridge");
try {
return initializeBridge(jsExecutor, jsModulesConfig);
} finally {
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
}
}
}).get();
} catch (Exception t) {
throw new RuntimeException("Failed to initialize bridge", t);
}
}
开发者ID:john1jan,项目名称:ReactNativeSignatureExample,代码行数:36,代码来源:CatalystInstanceImpl.java
示例6: CatalystInstanceImpl
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
private CatalystInstanceImpl(
final ReactQueueConfigurationSpec ReactQueueConfigurationSpec,
final JavaScriptExecutor jsExecutor,
final NativeModuleRegistry registry,
final JavaScriptModuleRegistry jsModuleRegistry,
final JSBundleLoader jsBundleLoader,
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
FLog.d(ReactConstants.TAG, "Initializing React Xplat Bridge.");
mHybridData = initHybrid();
mReactQueueConfiguration = ReactQueueConfigurationImpl.create(
ReactQueueConfigurationSpec,
new NativeExceptionHandler());
mBridgeIdleListeners = new CopyOnWriteArrayList<>();
mJavaRegistry = registry;
mJSModuleRegistry = jsModuleRegistry;
mJSBundleLoader = jsBundleLoader;
mNativeModuleCallExceptionHandler = nativeModuleCallExceptionHandler;
mTraceListener = new JSProfilerTraceListener(this);
initializeBridge(
new BridgeCallback(this),
jsExecutor,
mReactQueueConfiguration.getJSQueueThread(),
mReactQueueConfiguration.getNativeModulesQueueThread(),
mJavaRegistry.getModuleRegistryHolder(this));
mMainExecutorToken = getMainExecutorToken();
}
开发者ID:Right-Men,项目名称:Ironman,代码行数:29,代码来源:CatalystInstanceImpl.java
示例7: setReactQueueConfigurationSpec
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec; //导入依赖的package包/类
public Builder setReactQueueConfigurationSpec(
ReactQueueConfigurationSpec ReactQueueConfigurationSpec) {
mReactQueueConfigurationSpec = ReactQueueConfigurationSpec;
return this;
}
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:6,代码来源:CatalystInstanceImpl.java
注:本文中的com.facebook.react.bridge.queue.ReactQueueConfigurationSpec类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论