SubscriberMethod

public abstract class SubscriberMethod extends AbstractHandlerMethod<T, M, C, E, R> implements VoidMethod<T, C, E>, SelectiveHandler<T, C, E, R>

A method annotated with the @Subscribe annotation.

Such a method may have side effects, but provides no visible output.

See also

io.spine.core.Subscribe

Inheritors

Constructors

Link copied to clipboard
protected void SubscriberMethod(Method method, ParameterSpec<EventEnvelope> parameterSpec)

Functions

Link copied to clipboard
protected abstract ArgumentFilter createFilter()
Creates the filter for messages handled by this method.
Link copied to clipboard
public final ArgumentFilter filter()
Obtains the filter to apply to the messages received by this method.
Link copied to clipboard
Obtains the type of the incoming message class.
Link copied to clipboard
Obtains parameters of the method.

Inherited functions

Link copied to clipboard
public final Set<Attribute<? extends Object>> attributes()
Obtains the set of method attributes configured for this method.
Link copied to clipboard
Obtains a set of functions for getting method attributes by a raw method value.
Link copied to clipboard
protected void checkAttributesMatch(E envelope)
Allows to make sure that the passed envelope matches the annotation attributes of a method.
Link copied to clipboard
public final void discoverAttributes()
Initializes attributes by obtaining values via functions provided by attributeSuppliers.
Link copied to clipboard
public void ensureExternalMatch(boolean expectedValue)
Ensures that the external attribute of the method is the one expected.
Link copied to clipboard
public boolean equals(Object obj)
Link copied to clipboard
protected static Class<M> firstParamType<M extends Message>(Method handler)
Returns the class of the first parameter of the passed handler method object.
Link copied to clipboard
Returns a full name of the handler method.
Link copied to clipboard
protected Optional<Success> handleRejection(ThrowableMessage throwableMessage, T target, E origin)
Link copied to clipboard
public int hashCode()
Link copied to clipboard
public DispatchOutcome invoke(T target, E envelope)
Feeds the given envelope to the given target and returns the outcome.
Link copied to clipboard
public boolean isDomestic()
Tells if the passed method is domestic, that is not marked as external).
Link copied to clipboard
public boolean isExternal()
Tells if the passed method is external.
Link copied to clipboard
protected final boolean isPrivate()
Returns true if the method is declared private, false otherwise.
Link copied to clipboard
protected final boolean isPublic()
Returns true if the method is declared public, false otherwise.
Link copied to clipboard
public DispatchKey key()
Creates a handler method dispatch key out of the message class.
Link copied to clipboard
Obtains the specification of parameters for this method.
Link copied to clipboard
public final Set<R> producedMessages()
Retrieves the message classes produced by this handler method.
Link copied to clipboard
protected Class<? extends M> rawMessageClass()
Link copied to clipboard
public final Method rawMethod()
Obtains the handling method.
Link copied to clipboard
public String toString()
Obtains the full name of the handler method.
Link copied to clipboard
public abstract Success toSuccessfulOutcome(Object rawResult, T target, E handledSignal)
public Success toSuccessfulOutcome(Object result, T target, E handledSignal)
Converts the raw method result to a successful propagation outcome.