- Type Parameters:
T- event type
- All Known Implementing Classes:
SseSinkProvider
public interface SinkProvider<T>
ServiceLoader provider interface for Sink providers.-
Method Summary
Modifier and TypeMethodDescriptioncreate(ServerResponse response, BiConsumer<Object, MediaType> eventConsumer, Runnable closeRunnable) Deprecated, for removal: This API element is subject to removal in a future version.create(SinkProviderContext context) Creates a sink using this provider.booleansupports(GenericType<? extends Sink<?>> type, ServerRequest request) Checks if a provider supports the type.
-
Method Details
-
supports
Checks if a provider supports the type.- Parameters:
type- the typerequest- the current request- Returns:
- outcome of test
-
create
Creates a sink using this provider.- Type Parameters:
X- type of sink- Parameters:
context- a context for a sync provider- Returns:
- newly created sink
-
create
@Deprecated(since="4.1.2", forRemoval=true) <X extends Sink<T>> X create(ServerResponse response, BiConsumer<Object, MediaType> eventConsumer, Runnable closeRunnable) Deprecated, for removal: This API element is subject to removal in a future version.replaced bycreate(SinkProviderContext)Creates a sink using this provider.- Type Parameters:
X- type of sink- Parameters:
response- the HTTP responseeventConsumer- an event consumercloseRunnable- a runnable to call on close- Returns:
- newly created sink
-
create(SinkProviderContext)