EventProcessorHost.registerEventProcessor 方法

定义

重载

registerEventProcessor(Class<T> eventProcessorType)

Register class for event processor and start processing.

This overload uses the default event processor factory, which simply creates new instances of the registered event processor class, and uses all the default options.

The returned CompletableFuture completes when host initialization is finished. Initialization failures are reported by completing the future with an exception, so it is important to call get() on the future and handle any exceptions thrown.

class MyEventProcessor implements IEventProcessor { ... }
EventProcessorHost host = new EventProcessorHost(...);
{ CompletableFuture<Void>} foo = host.registerEventProcessor(MyEventProcessor.class);
foo.get();

registerEventProcessor(Class<T> eventProcessorType, EventProcessorOptions processorOptions)

Register class for event processor and start processing.

This overload uses the default event processor factory, which simply creates new instances of the registered event processor class, but takes user-specified options.

The returned CompletableFuture completes when host initialization is finished. Initialization failures are reported by completing the future with an exception, so it is important to call get() on the future and handle any exceptions thrown.

registerEventProcessor(Class<T> eventProcessorType)

Register class for event processor and start processing.

This overload uses the default event processor factory, which simply creates new instances of the registered event processor class, and uses all the default options.

The returned CompletableFuture completes when host initialization is finished. Initialization failures are reported by completing the future with an exception, so it is important to call get() on the future and handle any exceptions thrown.

class MyEventProcessor implements IEventProcessor { ... }
EventProcessorHost host = new EventProcessorHost(...);
{ CompletableFuture<Void>} foo = host.registerEventProcessor(MyEventProcessor.class);
foo.get();

public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType)

参数

eventProcessorType
Class<T>

Class that implements IEventProcessor.

返回

<T extends IEventProcessor> CompletableFuture<Void>

Future that completes when initialization is finished.

registerEventProcessor(Class<T> eventProcessorType, EventProcessorOptions processorOptions)

Register class for event processor and start processing.

This overload uses the default event processor factory, which simply creates new instances of the registered event processor class, but takes user-specified options.

The returned CompletableFuture completes when host initialization is finished. Initialization failures are reported by completing the future with an exception, so it is important to call get() on the future and handle any exceptions thrown.

public <T extends IEventProcessor> CompletableFuture<Void> registerEventProcessor(Class<T> eventProcessorType, EventProcessorOptions processorOptions)

参数

eventProcessorType
Class<T>

Class that implements IEventProcessor.

processorOptions
EventProcessorOptions

Options for the processor host and event processor(s).

返回

<T extends IEventProcessor> CompletableFuture<Void>

Future that completes when initialization is finished.

适用于