Skip to content

Commit

Permalink
Add constructors for server transport classes
Browse files Browse the repository at this point in the history
The ByteBufAllocator versions were not intended for public use.
  • Loading branch information
electrum committed May 23, 2018
1 parent 5247962 commit 89aa3d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package io.airlift.drift.transport.netty.server;

import com.google.common.annotations.VisibleForTesting;
import io.airlift.drift.transport.netty.ssl.SslContextFactory;
import io.airlift.drift.transport.server.ServerMethodInvoker;
import io.airlift.drift.transport.server.ServerTransport;
Expand Down Expand Up @@ -53,6 +54,12 @@ public class DriftNettyServerTransport

private final AtomicBoolean running = new AtomicBoolean();

public DriftNettyServerTransport(ServerMethodInvoker methodInvoker, DriftNettyServerConfig config)
{
this(methodInvoker, config, ByteBufAllocator.DEFAULT);
}

@VisibleForTesting
public DriftNettyServerTransport(ServerMethodInvoker methodInvoker, DriftNettyServerConfig config, ByteBufAllocator allocator)
{
requireNonNull(methodInvoker, "methodInvoker is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public class DriftNettyServerTransportFactory
private final DriftNettyServerConfig config;
private final ByteBufAllocator allocator;

public DriftNettyServerTransportFactory(DriftNettyServerConfig config)
{
this(config, ByteBufAllocator.DEFAULT);
}

@Inject
public DriftNettyServerTransportFactory(DriftNettyServerConfig config, ByteBufAllocator allocator)
{
Expand Down

0 comments on commit 89aa3d4

Please sign in to comment.