Class Subscriber<T>
java.lang.Object
org.palladiosimulator.analyzer.slingshot.eventdriver.entity.Subscriber<T>
- Type Parameters:
T
- The event type
- All Implemented Interfaces:
io.reactivex.rxjava3.disposables.Disposable
,io.reactivex.rxjava3.functions.Consumer<T>
,Comparable<Subscriber<T>>
,InterceptorInformation
public class Subscriber<T>
extends Object
implements io.reactivex.rxjava3.functions.Consumer<T>, io.reactivex.rxjava3.disposables.Disposable, Comparable<Subscriber<T>>, InterceptorInformation
A subscriber to an event of type
T
that should be activated upon the event.
It holds a reference to a EventHandler
.
It also holds further information about
- A non-negative number priority (default is 0). Subscribers are compared based on its priority.
- An array of reified types.
- A name that identifies this subscriber.
- The event type itself (reified).
- The associated contracts to this subscriber.
- Optionally the enclosing type where the event handler is residing (i.e. if the event handler is a Java Method).
- Optionally Pre and Post interceptors specifically for this subscriber.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addPostInterceptor
(IPostInterceptor postInterceptor) void
addPreInterceptor
(IPreInterceptor preInterceptor) static <T> Subscriber.Builder<T>
Creates builder to buildSubscriber
.int
compareTo
(Subscriber<T> other) void
dispose()
boolean
Class<?>
getName()
int
int
hashCode()
boolean
-
Method Details
-
accept
-
dispose
public void dispose()- Specified by:
dispose
in interfaceio.reactivex.rxjava3.disposables.Disposable
-
isDisposed
public boolean isDisposed()- Specified by:
isDisposed
in interfaceio.reactivex.rxjava3.disposables.Disposable
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T>
-
addPreInterceptor
-
addPostInterceptor
-
getPriority
public int getPriority() -
getReifiedClasses
-
getName
- Specified by:
getName
in interfaceInterceptorInformation
-
getHandlerType
- Specified by:
getHandlerType
in interfaceInterceptorInformation
-
getEnclosingType
- Specified by:
getEnclosingType
in interfaceInterceptorInformation
-
getEventType
- Specified by:
getEventType
in interfaceInterceptorInformation
-
getAssociatedContracts
- Specified by:
getAssociatedContracts
in interfaceInterceptorInformation
-
builder
Creates builder to buildSubscriber
.- Returns:
- created builder
-
hashCode
public int hashCode() -
equals
-