Class DefaultEventLoop
java.lang.Object
org.springframework.shell.component.view.event.DefaultEventLoop
- All Implemented Interfaces:
EventLoop
Default implementation of an
EventLoop
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.shell.component.view.event.EventLoop
EventLoop.EventLoopProcessor, EventLoop.Type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
void
dispatch
(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> messages) DispatchMessage
s into anEventLoop
from aPublisher
.void
dispatch
(org.springframework.messaging.Message<?> message) Dispatch aMessage
into anEventLoop
.reactor.core.publisher.Flux<org.springframework.messaging.Message<?>>
events()
Return aFlux
ofMessage
events.<T> reactor.core.publisher.Flux<T>
events
(EventLoop.Type type, Class<T> clazz) Specialisation ofEventLoop.events()
which returns type safe stream filtered by given eventloop message type and message payload class type.<T> reactor.core.publisher.Flux<T>
events
(EventLoop.Type type, org.springframework.core.ParameterizedTypeReference<T> typeRef) Specialisation ofEventLoop.events()
which returns type safe stream filtered by given eventloop message type and message payload class type.reactor.core.publisher.Flux<KeyEvent>
Specialisation ofEventLoop.events()
which returns type safeKeyEvent
s.reactor.core.publisher.Flux<MouseEvent>
Specialisation ofEventLoop.events()
which returns type safeMouseEvent
s.void
onDestroy
(reactor.core.Disposable disposable) RegisterDisposable
to get disposed when event loop terminates.reactor.core.publisher.Flux<String>
Specialisation ofEventLoop.events()
which returns type safe {code signal} events.void
subscribeTo
(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> publisher) reactor.core.publisher.Flux<String>
Specialisation ofEventLoop.events()
which returns type safe {code system} events.<T extends ViewEvent>
reactor.core.publisher.Flux<T>viewEvents
(Class<T> clazz) Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.<T extends ViewEvent>
reactor.core.publisher.Flux<T>viewEvents
(Class<T> clazz, View filterBy) Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.<T extends ViewEvent>
reactor.core.publisher.Flux<T>viewEvents
(org.springframework.core.ParameterizedTypeReference<T> typeRef) Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.<T extends ViewEvent>
reactor.core.publisher.Flux<T>viewEvents
(org.springframework.core.ParameterizedTypeReference<T> typeRef, View filterBy) Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.
-
Constructor Details
-
DefaultEventLoop
public DefaultEventLoop() -
DefaultEventLoop
-
-
Method Details
-
dispatch
public void dispatch(org.springframework.messaging.Message<?> message) Description copied from interface:EventLoop
Dispatch aMessage
into anEventLoop
. -
dispatch
public void dispatch(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> messages) Description copied from interface:EventLoop
DispatchMessage
s into anEventLoop
from aPublisher
. Usually type is eitherMono
orFlux
. -
events
public reactor.core.publisher.Flux<org.springframework.messaging.Message<?>> events()Description copied from interface:EventLoop
Return aFlux
ofMessage
events. When subscribed events will be received until disposed orEventLoop
terminates. -
events
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safe stream filtered by given eventloop message type and message payload class type. -
events
public <T> reactor.core.publisher.Flux<T> events(EventLoop.Type type, org.springframework.core.ParameterizedTypeReference<T> typeRef) Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safe stream filtered by given eventloop message type and message payload class type. -
keyEvents
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeKeyEvent
s. -
mouseEvents
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeMouseEvent
s.- Specified by:
mouseEvents
in interfaceEventLoop
- Returns:
- the mouse events from an event loop
-
systemEvents
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safe {code system} events.- Specified by:
systemEvents
in interfaceEventLoop
- Returns:
- the system events from an event loop
-
signalEvents
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safe {code signal} events.- Specified by:
signalEvents
in interfaceEventLoop
- Returns:
- the signal events from an event loop
-
viewEvents
Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.- Specified by:
viewEvents
in interfaceEventLoop
- Type Parameters:
T
- the type to expect- Parameters:
clazz
- the type class to filter- Returns:
- the filtered events from an event loop
-
viewEvents
public <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef) Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.- Specified by:
viewEvents
in interfaceEventLoop
- Type Parameters:
T
- the type to expect- Parameters:
typeRef
- the parameterized type to filter- Returns:
- the filtered events from an event loop
-
viewEvents
public <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(Class<T> clazz, View filterBy) Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.- Specified by:
viewEvents
in interfaceEventLoop
- Type Parameters:
T
- the type to expect- Parameters:
clazz
- the type class to filterfilterBy
- the view to filter- Returns:
- the filtered events from an event loop
-
viewEvents
public <T extends ViewEvent> reactor.core.publisher.Flux<T> viewEvents(org.springframework.core.ParameterizedTypeReference<T> typeRef, View filterBy) Description copied from interface:EventLoop
Specialisation ofEventLoop.events()
which returns type safeViewEvent
s.- Specified by:
viewEvents
in interfaceEventLoop
- Type Parameters:
T
- the type to expect- Parameters:
typeRef
- the parameterized type to filterfilterBy
- the view to filter- Returns:
- the filtered events from an event loop
-
onDestroy
public void onDestroy(reactor.core.Disposable disposable) Description copied from interface:EventLoop
RegisterDisposable
to get disposed when event loop terminates. -
subscribeTo
public void subscribeTo(org.reactivestreams.Publisher<? extends org.springframework.messaging.Message<?>> publisher) -
destroy
public void destroy()
-