EventBus

public class EventBus implements IEventBus

The central event dispatcher for the Hytale server. Provides both synchronous and asynchronous event handling with priority-based ordering, keyed events for per-entity/per-player events, global and unhandled event handlers, and performance timing metrics.

java.lang.Object > EventBus

Field Summary

classNames

final Set classNames

Field classNames.

Method Detail

EventBus

public public EventBus (final boolean timeEvents)

Method EventBus.

Parameters:
final boolean timeEvents

shutdown

public void shutdown ()

Method shutdown.

getRegisteredEventClasses

public IBaseEvent>> getRegisteredEventClasses ()

Method getRegisteredEventClasses.

getRegisteredEventClassNames

public Set getRegisteredEventClassNames ()

Method getRegisteredEventClassNames.

getRegistry

public ?> getRegistry (@Nonnull final String eventName)

Method getRegistry.

Parameters:
@Nonnull final String eventName

getSyncRegistry

public ?> getSyncRegistry (@Nonnull final Class eventClass)

Method getSyncRegistry.

Parameters:
@Nonnull final Class eventClass

SyncEventBusRegistry

public new SyncEventBusRegistry (EventBus.LOGGER, aClass)

Method SyncEventBusRegistry.

Parameters:
EventBus.LOGGER EventBus.LOGGER
aClass aClass

getAsyncRegistry

public EventType> getAsyncRegistry (@Nonnull final Class eventClass)

Method getAsyncRegistry.

Parameters:
@Nonnull final Class eventClass

AsyncEventBusRegistry

public new AsyncEventBusRegistry (EventBus.LOGGER, aClass)

Method AsyncEventBusRegistry.

Parameters:
EventBus.LOGGER EventBus.LOGGER
aClass aClass

register

public EventType> register (@Nonnull final Class eventClass, @Nonnull final Consumer consumer)

Method register.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Consumer consumer

registerAsync

public EventType> registerAsync (@Nonnull final Class eventClass, @Nonnull final Function, CompletableFuture> function)

Method registerAsync.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Function, CompletableFuture> function

registerGlobal

public EventType> registerGlobal (@Nonnull final Class eventClass, @Nonnull final Consumer consumer)

Method registerGlobal.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Consumer consumer

registerAsyncGlobal

public EventType> registerAsyncGlobal (@Nonnull final Class eventClass, @Nonnull final Function, CompletableFuture> function)

Method registerAsyncGlobal.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Function, CompletableFuture> function

registerUnhandled

public EventType> registerUnhandled (@Nonnull final Class eventClass, @Nonnull final Consumer consumer)

Method registerUnhandled.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Consumer consumer

registerAsyncUnhandled

public EventType> registerAsyncUnhandled (@Nonnull final Class eventClass, @Nonnull final Function, CompletableFuture> function)

Method registerAsyncUnhandled.

Parameters:
@Nonnull final Class eventClass
@Nonnull final Function, CompletableFuture> function

dispatchFor

public EventType> dispatchFor (@Nonnull final Class eventClass, final KeyType key)

Method dispatchFor.

Parameters:
@Nonnull final Class eventClass
final KeyType key

dispatchForAsync

public CompletableFuture> dispatchForAsync (@Nonnull final Class eventClass, final KeyType key)

Method dispatchForAsync.

Parameters:
@Nonnull final Class eventClass
final KeyType key
See Also: