public class Handlers extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Handlers.EventAndTargets
Pair of an event and targets.
|
static interface |
Handlers.EventDelivery
Event delivery.
|
static class |
Handlers.EventHandler
An event handler.
|
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Predicate<Method> |
IS_SUBSCRIBE_METHOD
Tests if a method is a
Subscribe handler. |
| Modifier and Type | Method and Description |
|---|---|
static Handlers.EventDelivery |
createDelivery(Method handler,
boolean concurrent)
Creates a new delivery for the given handler method.
|
static com.google.common.base.Function<Method,Handler> |
handlerBuilder(String identifier,
com.google.common.base.Function<? super Method,? extends Executor> deliveryExecutor,
com.google.common.base.Predicate<? super Method> batchDelivery)
Creates a handler factory.
|
static com.google.common.base.Predicate<Method> |
isHandlerMarkedWith(Class<? extends Annotation> marker)
Checks if a method is a valid handler method.
|
static Set<Class<?>> |
linearizeHierarchy(Class<?> concreteClass)
Linearizes a class's type hierarchy into a set of Class objects.
|
static com.google.common.cache.LoadingCache<Class<?>,Set<Handler>> |
newHandlerCache(com.google.common.base.Predicate<? super Method> isHandler,
com.google.common.base.Function<? super Method,Handler> builder)
Creates a new event
Handler cache. |
public static final com.google.common.base.Predicate<Method> IS_SUBSCRIBE_METHOD
Subscribe handler.public static com.google.common.cache.LoadingCache<Class<?>,Set<Handler>> newHandlerCache(com.google.common.base.Predicate<? super Method> isHandler, com.google.common.base.Function<? super Method,Handler> builder)
Handler cache.isHandler - determines if a method is a handlerbuilder - the factory for handlerspublic static Handlers.EventDelivery createDelivery(Method handler, boolean concurrent)
handler - the handlerconcurrent - if true, concurrent deliveries are allowed on a single targetpublic static com.google.common.base.Function<Method,Handler> handlerBuilder(String identifier, com.google.common.base.Function<? super Method,? extends Executor> deliveryExecutor, com.google.common.base.Predicate<? super Method> batchDelivery)
identifier - a bus identifierdeliveryExecutor - provides executors for the handler methodsbatchDelivery - determines if handler invocations are batchedpublic static com.google.common.base.Predicate<Method> isHandlerMarkedWith(Class<? extends Annotation> marker)
marker - the marker to identify handlerstrue if a method is a handler methodpublic static Set<Class<?>> linearizeHierarchy(Class<?> concreteClass)
concreteClass - the type whose hierarchy will be processedCopyright © 2013. All Rights Reserved.