Search in sources :

Example 1 with Book

use of demo.jaxws.tracing.server.Book in project cxf by apache.

the class CatalogServiceImpl method addBookAsync.

public Future<?> addBookAsync(Book book, AsyncHandler<Book> handler) {
    final ServerAsyncResponse<Book> response = new ServerAsyncResponse<Book>();
    executor.submit(() -> {
        final Span span = brave.tracer().nextSpan().name("Inserting New Book").start();
        try (SpanInScope scope = brave.tracer().withSpanInScope(span)) {
            books.put(book.getId(), book);
            handler.handleResponse(response);
        } finally {
            span.finish();
        }
    });
    return response;
}
Also used : Book(demo.jaxws.tracing.server.Book) SpanInScope(brave.Tracer.SpanInScope) ServerAsyncResponse(org.apache.cxf.jaxws.ServerAsyncResponse) Span(brave.Span)

Aggregations

Span (brave.Span)1 SpanInScope (brave.Tracer.SpanInScope)1 Book (demo.jaxws.tracing.server.Book)1 ServerAsyncResponse (org.apache.cxf.jaxws.ServerAsyncResponse)1