AsyncEventBusRegistry

public class AsyncEventBusRegistry

Registry for managing asynceventbus registration. Provides methods to register and query asynceventbus items.

java.lang.Object > AsyncEventBusRegistry

Field Summary

before

final CompletableFuture before

Field before.

future

final CompletableFuture future

Field future.

asyncEventConsumerMap

final AsyncEventConsumerMap asyncEventConsumerMap

Field asyncEventConsumerMap.

k

final KeyType k

Field k.

eventMap

final AsyncEventConsumerMap eventMap

Field eventMap.

eventConsumer

final AsyncEventConsumer eventConsumer

Field eventConsumer.

consumers

final List> consumers

Field consumers.

after

final long after

Field after.

registry

protected AsyncEventBusRegistry registry

Field registry.

beforeGlobal

final CompletableFuture beforeGlobal

Field beforeGlobal.

Method Detail

AsyncEventBusRegistry

public public AsyncEventBusRegistry (@Nonnull final HytaleLogger logger, @Nonnull final Class eventClass)

Method AsyncEventBusRegistry.

Parameters:
@Nonnull final HytaleLogger logger
@Nonnull final Class eventClass

AsyncEventConsumerMap

public new AsyncEventConsumerMap (null)

Method AsyncEventConsumerMap.

Parameters:
null null

registerAsync

public EventType> registerAsync (final short priority, @Nonnull final KeyType key, @Nonnull final Function, CompletableFuture> function)

Method registerAsync.

Parameters:
final short priority
@Nonnull final KeyType key
@Nonnull final Function, CompletableFuture> function

registerAsync0

public EventType> registerAsync0 (final short priority, @Nullable final KeyType key, @Nonnull final Function, CompletableFuture> function, @Nonnull final String consumerString)

Method registerAsync0.

Parameters:
final short priority
@Nullable final KeyType key
@Nonnull final Function, CompletableFuture> function
@Nonnull final String consumerString

unregister

private void unregister (@Nullable final KeyType key, @Nonnull final AsyncEventConsumer consumer)

Method unregister.

Parameters:
@Nullable final KeyType key
@Nonnull final AsyncEventConsumer consumer

registerAsyncGlobal

public EventType> registerAsyncGlobal (final short priority, @Nonnull final Function, CompletableFuture> function)

Method registerAsyncGlobal.

Parameters:
final short priority
@Nonnull final Function, CompletableFuture> function

registerAsyncGlobal0

public EventType> registerAsyncGlobal0 (final short priority, @Nonnull final Function, CompletableFuture> function, @Nonnull final String consumerString)

Method registerAsyncGlobal0.

Parameters:
final short priority
@Nonnull final Function, CompletableFuture> function
@Nonnull final String consumerString

unregisterGlobal

private void unregisterGlobal (@Nonnull final AsyncEventConsumer consumer)

Method unregisterGlobal.

Parameters:
@Nonnull final AsyncEventConsumer consumer

registerAsyncUnhandled

public EventType> registerAsyncUnhandled (final short priority, @Nonnull final Function, CompletableFuture> function)

Method registerAsyncUnhandled.

Parameters:
final short priority
@Nonnull final Function, CompletableFuture> function

registerAsyncUnhandled0

public EventType> registerAsyncUnhandled0 (final short priority, @Nonnull final Function, CompletableFuture> function, @Nonnull final String consumerString)

Method registerAsyncUnhandled0.

Parameters:
final short priority
@Nonnull final Function, CompletableFuture> function
@Nonnull final String consumerString

unregisterUnhandled

private void unregisterUnhandled (@Nonnull final AsyncEventConsumer consumer)

Method unregisterUnhandled.

Parameters:
@Nonnull final AsyncEventConsumer consumer

dispatchGlobal

private CompletableFuture dispatchGlobal (@Nonnull final CompletableFuture future)

Method dispatchGlobal.

Parameters:
@Nonnull final CompletableFuture future

event

public dispatch event (global)

Method event.

Parameters:
global global

dispatchUnhandled

private CompletableFuture dispatchUnhandled (@Nonnull final CompletableFuture future)

Method dispatchUnhandled.

Parameters:
@Nonnull final CompletableFuture future

dispatchEventMap

private CompletableFuture dispatchEventMap (@Nonnull CompletableFuture future, @Nonnull final AsyncEventConsumerMap eventMap, @Nonnull final String s)

Method dispatchEventMap.

Parameters:
@Nonnull CompletableFuture future
@Nonnull final AsyncEventConsumerMap eventMap
@Nonnull final String s

register

public EventType> register (final short priority, final KeyType key, @Nonnull final Consumer consumer)

Method register.

Parameters:
final short priority
final KeyType key
@Nonnull final Consumer consumer

registerGlobal

public EventType> registerGlobal (final short priority, @Nonnull final Consumer consumer)

Method registerGlobal.

Parameters:
final short priority
@Nonnull final Consumer consumer

registerUnhandled

public EventType> registerUnhandled (final short priority, @Nonnull final Consumer consumer)

Method registerUnhandled.

Parameters:
final short priority
@Nonnull final Consumer consumer

dispatchFor

public CompletableFuture> dispatchFor (@Nullable final KeyType key)

Method dispatchFor.

Parameters:
@Nullable final KeyType key

hasListener

public boolean hasListener ()

Method hasListener.

dispatch

public CompletableFuture dispatch (final IAsyncEvent event)

Method dispatch.

Parameters:
final IAsyncEvent event

AsyncEventConsumer

public public AsyncEventConsumer (final short priority, @Nonnull final String consumerString, @Nonnull final Function, CompletableFuture> function)

Method AsyncEventConsumer.

Parameters:
final short priority
@Nonnull final String consumerString
@Nonnull final Function, CompletableFuture> function

getFunction

public CompletableFuture> getFunction ()

Method getFunction.

getTimedFunction

public CompletableFuture> getTimedFunction ()

Method getTimedFunction.

toString

public String toString ()

Method toString.

dispatch0

private CompletableFuture dispatch0 (final EventType event)

Method dispatch0.

Parameters:
final EventType event