Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
trustin committed Mar 17, 2023
1 parent 64978ae commit df7152c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ContextAwareBlockingTaskExecutor
extends BlockingTaskExecutor, ContextAwareScheduledExecutorService {

/**
* Returns a new {@link ContextAwareEventLoop} that sets the specified {@link RequestContext}
* Returns a new {@link ContextAwareBlockingTaskExecutor} that sets the specified {@link RequestContext}
* before executing any submitted tasks.
*/
static ContextAwareBlockingTaskExecutor of(RequestContext context, BlockingTaskExecutor executor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.List;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Function;
import java.util.function.Predicate;

Expand Down Expand Up @@ -677,7 +676,7 @@ static String toString(
long http2MaxHeaderListSize, long http1MaxInitialLineLength, long http1MaxHeaderSize,
long http1MaxChunkSize, int proxyProtocolMaxTlvSize,
Duration gracefulShutdownQuietPeriod, Duration gracefulShutdownTimeout,
@Nullable ScheduledExecutorService blockingTaskExecutor,
@Nullable BlockingTaskExecutor blockingTaskExecutor,
@Nullable MeterRegistry meterRegistry,
Map<ChannelOption<?>, ?> channelOptions, Map<ChannelOption<?>, ?> childChannelOptions,
List<ClientAddressSource> clientAddressSources,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.linecorp.armeria.common.HttpMethod;
import com.linecorp.armeria.common.HttpRequest;
import com.linecorp.armeria.common.HttpResponse;
import com.linecorp.armeria.common.util.BlockingTaskExecutor;
import com.linecorp.armeria.common.util.UnmodifiableFuture;
import com.linecorp.armeria.server.logging.AccessLogWriter;

Expand All @@ -50,7 +51,7 @@ public void serviceBindingBuilder() {
final ServerBuilder sb = Server.builder();
final AccessLogWriter accessLogWriter = mock(AccessLogWriter.class);
when(accessLogWriter.shutdown()).thenReturn(UnmodifiableFuture.completedFuture(null));
final ScheduledExecutorService blockingTaskExecutor = mock(ScheduledExecutorService.class);
final BlockingTaskExecutor blockingTaskExecutor = mock(BlockingTaskExecutor.class);
when(blockingTaskExecutor.isTerminated()).thenReturn(true);
final Path multipartUploadsLocation = Files.newTemporaryFolder().toPath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

package com.linecorp.armeria.server.jetty;

import java.util.concurrent.ScheduledExecutorService;

import org.eclipse.jetty.util.thread.ThreadPool;

import com.linecorp.armeria.common.util.BlockingTaskExecutor;

final class ArmeriaThreadPool implements ThreadPool {
private final ScheduledExecutorService blockingTaskExecutor;
private final BlockingTaskExecutor blockingTaskExecutor;

ArmeriaThreadPool(ScheduledExecutorService blockingTaskExecutor) {
ArmeriaThreadPool(BlockingTaskExecutor blockingTaskExecutor) {
this.blockingTaskExecutor = blockingTaskExecutor;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -60,6 +59,7 @@
import com.linecorp.armeria.common.ResponseHeaders;
import com.linecorp.armeria.common.ResponseHeadersBuilder;
import com.linecorp.armeria.common.annotation.Nullable;
import com.linecorp.armeria.common.util.BlockingTaskExecutor;
import com.linecorp.armeria.common.util.CompletionActions;
import com.linecorp.armeria.common.util.Exceptions;
import com.linecorp.armeria.internal.server.servlet.ServletTlsAttributes;
Expand Down Expand Up @@ -166,7 +166,7 @@ public static JettyServiceBuilder builder() {
return new JettyServiceBuilder();
}

private final Function<ScheduledExecutorService, Server> serverFactory;
private final Function<BlockingTaskExecutor, Server> serverFactory;
private final Consumer<Server> postStopTask;
private final Configurator configurator;

Expand All @@ -182,13 +182,13 @@ public static JettyServiceBuilder builder() {
private boolean startedServer;

private JettyService(@Nullable String hostname, boolean tlsReverseDnsLookup,
Function<ScheduledExecutorService, Server> serverSupplier) {
Function<BlockingTaskExecutor, Server> serverSupplier) {
this(hostname, tlsReverseDnsLookup, serverSupplier, unused -> { /* unused */ });
}

JettyService(@Nullable String hostname,
boolean tlsReverseDnsLookup,
Function<ScheduledExecutorService, Server> serverFactory,
Function<BlockingTaskExecutor, Server> serverFactory,
Consumer<Server> postStopTask) {

this.hostname = hostname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import java.util.function.Function;

Expand All @@ -38,6 +37,7 @@
import com.google.common.collect.ImmutableMap;

import com.linecorp.armeria.common.annotation.Nullable;
import com.linecorp.armeria.common.util.BlockingTaskExecutor;

/**
* Builds a {@link JettyService}. Use {@link JettyService#of(Server)} if you have a configured Jetty
Expand Down Expand Up @@ -271,7 +271,7 @@ public JettyService build() {
final List<LifeCycle.Listener> lifeCycleListeners = this.lifeCycleListeners.build();
final List<Consumer<? super Server>> customizers = this.customizers.build();

final Function<ScheduledExecutorService, Server> serverFactory = blockingTaskExecutor -> {
final Function<BlockingTaskExecutor, Server> serverFactory = blockingTaskExecutor -> {
final Server server = new Server(new ArmeriaThreadPool(blockingTaskExecutor));

if (dumpAfterStart != null) {
Expand Down

0 comments on commit df7152c

Please sign in to comment.