Search in sources :

Example 1 with AsyncOutputStream

use of org.jboss.resteasy.spi.AsyncOutputStream in project resteasy by resteasy.

the class DigitalSigningInterceptor method asyncAroundWriteTo.

@Override
public CompletionStage<Void> asyncAroundWriteTo(AsyncWriterInterceptorContext context) {
    LogMessages.LOGGER.debugf("Interceptor : %s,  Method : aroundWriteTo", getClass().getName());
    MultivaluedMap<String, Object> headers = context.getHeaders();
    List<DKIMSignature> list = getHeaders(headers);
    if (list.isEmpty()) {
        return context.asyncProceed();
    }
    // System.out.println("TRACE: Found ContentSignatures");
    AsyncOutputStream old = context.getAsyncOutputStream();
    // store body in a byte array so we can use it to calculate signature
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    context.setAsyncOutputStream(new BlockingAsyncOutputStream(baos));
    return context.asyncProceed().thenCompose(v -> {
        byte[] body = baos.toByteArray();
        try {
            for (DKIMSignature dosetaSignature : list) {
                KeyRepository repository = (KeyRepository) context.getProperty(KeyRepository.class.getName());
                sign(repository, headers, body, dosetaSignature);
            }
        } catch (InvalidKeyException | NoSuchAlgorithmException | SignatureException | UnsupportedEncodingException e) {
            CompletableFuture<Void> ret = new CompletableFuture<>();
            ret.completeExceptionally(e);
            return ret;
        }
        return old.asyncWrite(body);
    }).whenComplete((v, t) -> {
        context.setAsyncOutputStream(old);
        if (t != null)
            throw new RuntimeException(Messages.MESSAGES.failedToSign(), t);
    });
}
Also used : BlockingAsyncOutputStream(org.jboss.resteasy.spi.BlockingAsyncOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CompletableFuture(java.util.concurrent.CompletableFuture) ClientRequestContext(jakarta.ws.rs.client.ClientRequestContext) WebApplicationException(jakarta.ws.rs.WebApplicationException) ArrayList(java.util.ArrayList) ResteasyContext(org.jboss.resteasy.core.ResteasyContext) MultivaluedMap(jakarta.ws.rs.core.MultivaluedMap) ProcessingException(jakarta.ws.rs.ProcessingException) ContainerResponseContext(jakarta.ws.rs.container.ContainerResponseContext) ContainerResponseFilter(jakarta.ws.rs.container.ContainerResponseFilter) Priority(jakarta.annotation.Priority) OutputStream(java.io.OutputStream) WriterInterceptorContext(jakarta.ws.rs.ext.WriterInterceptorContext) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) ClientRequestFilter(jakarta.ws.rs.client.ClientRequestFilter) SignatureException(java.security.SignatureException) IOException(java.io.IOException) Messages(org.jboss.resteasy.security.doseta.i18n.Messages) Provider(jakarta.ws.rs.ext.Provider) Priorities(jakarta.ws.rs.Priorities) List(java.util.List) CompletionStage(java.util.concurrent.CompletionStage) ContainerRequestContext(jakarta.ws.rs.container.ContainerRequestContext) PrivateKey(java.security.PrivateKey) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) InvalidKeyException(java.security.InvalidKeyException) AsyncWriterInterceptor(org.jboss.resteasy.spi.AsyncWriterInterceptor) AsyncWriterInterceptorContext(org.jboss.resteasy.spi.AsyncWriterInterceptorContext) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Collections(java.util.Collections) LogMessages(org.jboss.resteasy.security.doseta.i18n.LogMessages) BlockingAsyncOutputStream(org.jboss.resteasy.spi.BlockingAsyncOutputStream) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) BlockingAsyncOutputStream(org.jboss.resteasy.spi.BlockingAsyncOutputStream) CompletableFuture(java.util.concurrent.CompletableFuture)

Example 2 with AsyncOutputStream

use of org.jboss.resteasy.spi.AsyncOutputStream in project resteasy by resteasy.

the class SseEventOutputImpl method close.

private void close(final boolean flushBeforeClose, final Throwable error) {
    // avoid even attempting to get a lock if someone else has closed it or is closing it
    if (state.getAndSet(CLOSED) != CLOSED) {
        if (error != null) {
            drainQueue(error);
        } else {
            synchronized (lock) {
                events.clear();
            }
        }
        if (flushBeforeClose && responseFlushed) {
            try (CloseableContext c = ResteasyContext.addCloseableContextDataLevel(contextDataMap)) {
                // make sure we flush to await for any queued data being sent
                AsyncOutputStream aos = response.getAsyncOutputStream();
                aos.asyncFlush().toCompletableFuture().get();
            } catch (IOException | InterruptedException | ExecutionException x) {
            // ignore it and let's just close
            }
        }
        if (asyncContext.isSuspended()) {
            ResteasyAsynchronousResponse asyncResponse = asyncContext.getAsyncResponse();
            if (asyncResponse != null) {
                try {
                    asyncResponse.complete();
                } catch (RuntimeException x) {
                    Throwable cause = x;
                    while (cause.getCause() != null && cause.getCause() != cause) cause = cause.getCause();
                    if (cause instanceof IOException) {
                    // ignore it, we're closed now
                    } else {
                        LOG.debug(cause.getMessage());
                        return;
                    }
                }
            }
        }
        clearContextData();
    }
}
Also used : ResteasyAsynchronousResponse(org.jboss.resteasy.spi.ResteasyAsynchronousResponse) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) CloseableContext(org.jboss.resteasy.core.ResteasyContext.CloseableContext) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) ExecutionException(java.util.concurrent.ExecutionException)

Example 3 with AsyncOutputStream

use of org.jboss.resteasy.spi.AsyncOutputStream in project resteasy by resteasy.

the class SseEventOutputImpl method internalWriteEvent.

private CompletionStage<Void> internalWriteEvent(final OutboundSseEvent event) {
    synchronized (lock) {
        try (CloseableContext c = ResteasyContext.addCloseableContextDataLevel(contextDataMap)) {
            if (event != null) {
                // // Check media type?
                ByteArrayOutputStream bout = new ByteArrayOutputStream();
                MediaType mediaType = event.getMediaType();
                boolean mediaTypeSet = !(event instanceof OutboundSseEventImpl) || ((OutboundSseEventImpl) event).isMediaTypeSet();
                if (mediaType == null || !mediaTypeSet) {
                    Object o = response.getOutputHeaders().getFirst("Content-Type");
                    if (o != null) {
                        if (o instanceof MediaType) {
                            MediaType mt = (MediaType) o;
                            String s = mt.getParameters().get(SseConstants.SSE_ELEMENT_MEDIA_TYPE);
                            if (s != null) {
                                mediaType = MediaType.valueOf(s);
                            }
                        } else if (o instanceof String) {
                            MediaType mt = MediaType.valueOf((String) o);
                            String s = mt.getParameters().get(SseConstants.SSE_ELEMENT_MEDIA_TYPE);
                            if (s != null) {
                                mediaType = MediaType.valueOf(s);
                            }
                        } else {
                            throw new RuntimeException(Messages.MESSAGES.expectedStringOrMediaType(o));
                        }
                    }
                }
                if (mediaType == null) {
                    mediaType = MediaType.TEXT_PLAIN_TYPE;
                }
                if (event instanceof OutboundSseEventImpl) {
                    ((OutboundSseEventImpl) event).setMediaType(mediaType);
                }
                writer.writeTo(event, event.getClass(), null, new Annotation[] {}, mediaType, null, bout);
                AsyncOutputStream aos = response.getAsyncOutputStream();
                // eager composition to guarantee ordering
                return aos.asyncWrite(bout.toByteArray()).thenCompose(v -> aos.asyncFlush()).exceptionally(e -> {
                    if (e instanceof CompletionException)
                        e = e.getCause();
                    if (e instanceof IOException)
                        close(false, e);
                    LogMessages.LOGGER.failedToWriteSseEvent(event.toString(), e);
                    SynchronousDispatcher.rethrow(e);
                    // never reached
                    return null;
                });
            }
        } catch (IOException e) {
            // The connection could be broken or closed. whenever IO error happens, mark closed to true to
            // stop event writing
            close(false, e);
            LogMessages.LOGGER.failedToWriteSseEvent(event.toString(), e);
            CompletableFuture<Void> ret = new CompletableFuture<>();
            ret.completeExceptionally(e);
            return ret;
        } catch (Exception e) {
            LogMessages.LOGGER.failedToWriteSseEvent(event.toString(), e);
            CompletableFuture<Void> ret = new CompletableFuture<>();
            ret.completeExceptionally(new ProcessingException(e));
            return ret;
        }
    }
    return CompletableFuture.completedFuture(null);
}
Also used : SseEventSink(jakarta.ws.rs.sse.SseEventSink) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Logger(org.jboss.logging.Logger) Stream(org.jboss.resteasy.annotations.Stream) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Deque(java.util.Deque) SynchronousDispatcher(org.jboss.resteasy.core.SynchronousDispatcher) AtomicReference(java.util.concurrent.atomic.AtomicReference) MessageBodyWriter(jakarta.ws.rs.ext.MessageBodyWriter) ResteasyProviderFactory(org.jboss.resteasy.spi.ResteasyProviderFactory) Response(jakarta.ws.rs.core.Response) ResteasyContext(org.jboss.resteasy.core.ResteasyContext) Messages(org.jboss.resteasy.resteasy_jaxrs.i18n.Messages) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ProcessingException(jakarta.ws.rs.ProcessingException) LogMessages(org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages) Map(java.util.Map) Cleanable(org.jboss.resteasy.plugins.server.Cleanable) ResourceMethodInvoker(org.jboss.resteasy.core.ResourceMethodInvoker) ServerResponseWriter(org.jboss.resteasy.core.ServerResponseWriter) Cleanables(org.jboss.resteasy.plugins.server.Cleanables) FindAnnotation(org.jboss.resteasy.spi.util.FindAnnotation) Iterator(java.util.Iterator) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) SseElementType(org.jboss.resteasy.annotations.SseElementType) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) HttpRequest(org.jboss.resteasy.spi.HttpRequest) HttpResponse(org.jboss.resteasy.spi.HttpResponse) ConcurrentLinkedDeque(java.util.concurrent.ConcurrentLinkedDeque) OutboundSseEvent(jakarta.ws.rs.sse.OutboundSseEvent) CloseableContext(org.jboss.resteasy.core.ResteasyContext.CloseableContext) UncheckedIOException(java.io.UncheckedIOException) ExecutionException(java.util.concurrent.ExecutionException) GenericType(jakarta.ws.rs.core.GenericType) ResteasyAsynchronousContext(org.jboss.resteasy.spi.ResteasyAsynchronousContext) CompletionStage(java.util.concurrent.CompletionStage) BuiltResponse(org.jboss.resteasy.specimpl.BuiltResponse) MediaType(jakarta.ws.rs.core.MediaType) Annotation(java.lang.annotation.Annotation) ResteasyAsynchronousResponse(org.jboss.resteasy.spi.ResteasyAsynchronousResponse) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) ProcessingException(jakarta.ws.rs.ProcessingException) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) UncheckedIOException(java.io.UncheckedIOException) ExecutionException(java.util.concurrent.ExecutionException) CompletableFuture(java.util.concurrent.CompletableFuture) CompletionException(java.util.concurrent.CompletionException) CloseableContext(org.jboss.resteasy.core.ResteasyContext.CloseableContext) MediaType(jakarta.ws.rs.core.MediaType) ProcessingException(jakarta.ws.rs.ProcessingException)

Example 4 with AsyncOutputStream

use of org.jboss.resteasy.spi.AsyncOutputStream in project resteasy by resteasy.

the class SseEventOutputImpl method internalFlushResponseToClient.

private CompletionStage<Void> internalFlushResponseToClient(boolean throwIOException) {
    synchronized (lock) {
        if (!responseFlushed) {
            final BuiltResponse jaxrsResponse = createResponse();
            try {
                CompletableFuture<Void> ret = new CompletableFuture<>();
                ServerResponseWriter.writeNomapResponse(jaxrsResponse, request, response, providerFactory, t -> {
                    AsyncOutputStream aos;
                    try {
                        aos = response.getAsyncOutputStream();
                    } catch (IOException x) {
                        close(false, x);
                        ret.completeExceptionally(x);
                        return;
                    }
                    // eager composition to guarantee ordering
                    CompletionStage<Void> a = aos.asyncWrite(SseConstants.DOUBLE_EOL).thenCompose(v -> aos.asyncFlush());
                    // we've queued a response flush, so avoid a second one being queued
                    responseFlushed = true;
                    a.thenAccept(v -> {
                        ret.complete(null);
                    }).exceptionally(e -> {
                        if (e instanceof CompletionException)
                            e = e.getCause();
                        if (e instanceof IOException)
                            close(false, e);
                        if (throwIOException)
                            ret.completeExceptionally(e);
                        else
                            ret.completeExceptionally(new ProcessingException(Messages.MESSAGES.failedToCreateSseEventOutput(), e));
                        return null;
                    });
                }, true);
                return ret;
            } catch (IOException e) {
                close(false, e);
                CompletableFuture<Void> ret = new CompletableFuture<>();
                if (throwIOException) {
                    ret.completeExceptionally(e);
                } else {
                    ret.completeExceptionally(new ProcessingException(Messages.MESSAGES.failedToCreateSseEventOutput(), e));
                }
                return ret;
            }
        }
    }
    return CompletableFuture.completedFuture(null);
}
Also used : SseEventSink(jakarta.ws.rs.sse.SseEventSink) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Logger(org.jboss.logging.Logger) Stream(org.jboss.resteasy.annotations.Stream) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) Deque(java.util.Deque) SynchronousDispatcher(org.jboss.resteasy.core.SynchronousDispatcher) AtomicReference(java.util.concurrent.atomic.AtomicReference) MessageBodyWriter(jakarta.ws.rs.ext.MessageBodyWriter) ResteasyProviderFactory(org.jboss.resteasy.spi.ResteasyProviderFactory) Response(jakarta.ws.rs.core.Response) ResteasyContext(org.jboss.resteasy.core.ResteasyContext) Messages(org.jboss.resteasy.resteasy_jaxrs.i18n.Messages) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ProcessingException(jakarta.ws.rs.ProcessingException) LogMessages(org.jboss.resteasy.resteasy_jaxrs.i18n.LogMessages) Map(java.util.Map) Cleanable(org.jboss.resteasy.plugins.server.Cleanable) ResourceMethodInvoker(org.jboss.resteasy.core.ResourceMethodInvoker) ServerResponseWriter(org.jboss.resteasy.core.ServerResponseWriter) Cleanables(org.jboss.resteasy.plugins.server.Cleanables) FindAnnotation(org.jboss.resteasy.spi.util.FindAnnotation) Iterator(java.util.Iterator) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) SseElementType(org.jboss.resteasy.annotations.SseElementType) IOException(java.io.IOException) CompletionException(java.util.concurrent.CompletionException) HttpRequest(org.jboss.resteasy.spi.HttpRequest) HttpResponse(org.jboss.resteasy.spi.HttpResponse) ConcurrentLinkedDeque(java.util.concurrent.ConcurrentLinkedDeque) OutboundSseEvent(jakarta.ws.rs.sse.OutboundSseEvent) CloseableContext(org.jboss.resteasy.core.ResteasyContext.CloseableContext) UncheckedIOException(java.io.UncheckedIOException) ExecutionException(java.util.concurrent.ExecutionException) GenericType(jakarta.ws.rs.core.GenericType) ResteasyAsynchronousContext(org.jboss.resteasy.spi.ResteasyAsynchronousContext) CompletionStage(java.util.concurrent.CompletionStage) BuiltResponse(org.jboss.resteasy.specimpl.BuiltResponse) MediaType(jakarta.ws.rs.core.MediaType) Annotation(java.lang.annotation.Annotation) ResteasyAsynchronousResponse(org.jboss.resteasy.spi.ResteasyAsynchronousResponse) CompletableFuture(java.util.concurrent.CompletableFuture) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) CompletionException(java.util.concurrent.CompletionException) BuiltResponse(org.jboss.resteasy.specimpl.BuiltResponse) IOException(java.io.IOException) UncheckedIOException(java.io.UncheckedIOException) ProcessingException(jakarta.ws.rs.ProcessingException)

Example 5 with AsyncOutputStream

use of org.jboss.resteasy.spi.AsyncOutputStream in project resteasy by resteasy.

the class SseEventProvider method asyncWriteTo.

@Override
@SuppressWarnings({ "unchecked" })
public CompletionStage<Void> asyncWriteTo(OutboundSseEvent event, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, AsyncOutputStream entityStream) {
    Charset charset = StandardCharsets.UTF_8;
    boolean textLike = MediaTypeHelper.isTextLike(mediaType);
    boolean escape = event instanceof OutboundSseEventImpl ? ((OutboundSseEventImpl) event).isEscape() : false;
    CompletionStage<Void> ret = CompletableFuture.completedFuture(null);
    if (event.getComment() != null) {
        for (final String comment : event.getComment().split("\n")) {
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.COMMENT_LEAD));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(comment.getBytes(charset)));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
        }
    }
    if (event.getType() != null) {
        if (event.getName() != null) {
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.NAME_LEAD));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(event.getName().getBytes(charset)));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
        }
        if (event.getId() != null) {
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.ID_LEAD));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(event.getId().getBytes(charset)));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
        }
        if (event.getReconnectDelay() > -1) {
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.RETRY_LEAD));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(Long.toString(event.getReconnectDelay()).getBytes(StandardCharsets.UTF_8)));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
        }
        if (event.getData() != null) {
            Class<?> payloadClass = event.getType();
            Type payloadType = event.getGenericType();
            if (payloadType == null) {
                payloadType = payloadClass;
            }
            if (payloadType == null && payloadClass == null) {
                payloadType = Object.class;
                payloadClass = Object.class;
            }
            Class<?> finalPayloadClass = payloadClass;
            Type finalPayloadType = payloadType;
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.DATA_LEAD));
            @SuppressWarnings("rawtypes") AsyncMessageBodyWriter writer = (AsyncMessageBodyWriter) providers.getMessageBodyWriter(payloadClass, payloadType, annotations, event.getMediaType());
            if (writer == null) {
                throw new ServerErrorException(Messages.MESSAGES.notFoundMBW(payloadClass.getName()), Response.Status.INTERNAL_SERVER_ERROR);
            }
            ret = ret.thenCompose(v -> writer.asyncWriteTo(event.getData(), finalPayloadClass, finalPayloadType, annotations, event.getMediaType(), httpHeaders, new AsyncOutputStream() {

                boolean isNewLine = false;

                @Override
                public CompletionStage<Void> asyncFlush() {
                    return entityStream.asyncFlush();
                }

                @Override
                public CompletionStage<Void> asyncWrite(byte[] bytes, int offset, int length) {
                    return entityStream.asyncWrite(escape(textLike, escape, bytes, offset, length));
                }

                private byte[] escape(boolean textLike, boolean escape, byte[] data, int offset, int length) {
                    ByteArrayOutputStream os = new ByteArrayOutputStream(data.length);
                    for (int i = 0; i < length; i++) {
                        byte b = data[i + offset];
                        if (textLike) {
                            if (b == '\n' || b == '\r') {
                                if (!isNewLine) {
                                    try {
                                        os.write(SseConstants.EOL);
                                    } catch (IOException e) {
                                        // cannot happen
                                        throw new RuntimeException(e);
                                    }
                                }
                                isNewLine = true;
                            } else {
                                if (isNewLine) {
                                    try {
                                        os.write(SseConstants.DATA_LEAD);
                                    } catch (IOException e) {
                                        // cannot happen
                                        throw new RuntimeException(e);
                                    }
                                }
                                os.write(b);
                                isNewLine = false;
                            }
                        } else {
                            if (escape && (b == '\n' || b == '\r' || b == '\\')) {
                                os.write('\\');
                                os.write(b);
                            } else {
                                os.write(b);
                            }
                        }
                    }
                    return os.toByteArray();
                }

                @Override
                public void write(int b) throws IOException {
                    throw new IllegalStateException("Not supported");
                }
            }));
            ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
        }
    }
    return ret = ret.thenCompose(v -> entityStream.asyncWrite(SseConstants.EOL));
}
Also used : Context(jakarta.ws.rs.core.Context) ByteArrayOutputStream(java.io.ByteArrayOutputStream) CompletableFuture(java.util.concurrent.CompletableFuture) WebApplicationException(jakarta.ws.rs.WebApplicationException) MessageBodyWriter(jakarta.ws.rs.ext.MessageBodyWriter) Response(jakarta.ws.rs.core.Response) Messages(org.jboss.resteasy.resteasy_jaxrs.i18n.Messages) Charset(java.nio.charset.Charset) MultivaluedMap(jakarta.ws.rs.core.MultivaluedMap) Map(java.util.Map) AsyncMessageBodyWriter(org.jboss.resteasy.spi.AsyncMessageBodyWriter) Produces(jakarta.ws.rs.Produces) OutputStream(java.io.OutputStream) Consumes(jakarta.ws.rs.Consumes) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) IOException(java.io.IOException) Provider(jakarta.ws.rs.ext.Provider) MediaTypeHelper(org.jboss.resteasy.util.MediaTypeHelper) StandardCharsets(java.nio.charset.StandardCharsets) OutboundSseEvent(jakarta.ws.rs.sse.OutboundSseEvent) CompletionStage(java.util.concurrent.CompletionStage) MediaType(jakarta.ws.rs.core.MediaType) Type(java.lang.reflect.Type) ServerErrorException(jakarta.ws.rs.ServerErrorException) Annotation(java.lang.annotation.Annotation) Providers(jakarta.ws.rs.ext.Providers) MessageBodyReader(jakarta.ws.rs.ext.MessageBodyReader) InputStream(java.io.InputStream) AsyncOutputStream(org.jboss.resteasy.spi.AsyncOutputStream) Charset(java.nio.charset.Charset) AsyncMessageBodyWriter(org.jboss.resteasy.spi.AsyncMessageBodyWriter) ByteArrayOutputStream(java.io.ByteArrayOutputStream) IOException(java.io.IOException) MediaType(jakarta.ws.rs.core.MediaType) Type(java.lang.reflect.Type) ServerErrorException(jakarta.ws.rs.ServerErrorException) CompletionStage(java.util.concurrent.CompletionStage)

Aggregations

IOException (java.io.IOException)5 AsyncOutputStream (org.jboss.resteasy.spi.AsyncOutputStream)5 ByteArrayOutputStream (java.io.ByteArrayOutputStream)4 CompletableFuture (java.util.concurrent.CompletableFuture)4 CompletionStage (java.util.concurrent.CompletionStage)4 ProcessingException (jakarta.ws.rs.ProcessingException)3 MediaType (jakarta.ws.rs.core.MediaType)3 Response (jakarta.ws.rs.core.Response)3 MessageBodyWriter (jakarta.ws.rs.ext.MessageBodyWriter)3 OutboundSseEvent (jakarta.ws.rs.sse.OutboundSseEvent)3 UncheckedIOException (java.io.UncheckedIOException)3 Annotation (java.lang.annotation.Annotation)3 Map (java.util.Map)3 ExecutionException (java.util.concurrent.ExecutionException)3 ResteasyContext (org.jboss.resteasy.core.ResteasyContext)3 CloseableContext (org.jboss.resteasy.core.ResteasyContext.CloseableContext)3 Messages (org.jboss.resteasy.resteasy_jaxrs.i18n.Messages)3 ResteasyAsynchronousResponse (org.jboss.resteasy.spi.ResteasyAsynchronousResponse)3 GenericType (jakarta.ws.rs.core.GenericType)2 SseEventSink (jakarta.ws.rs.sse.SseEventSink)2