ContextType - Execution context type.public class Listener<ContextType extends ContextInterface> extends Object implements StringChannelInitializer.Configuration
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_LIMIT
Default packet size limit.
|
static io.netty.channel.ChannelHandler |
LOGGING_HANDLER
Netty logging handler.
|
| Constructor and Description |
|---|
Listener(String name,
ContextType context,
Dispatcher<? super ContextType> dispatcher)
Initializes listener thread.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getMaxPacketSize()
Maximum size of JSON-RPC packet.
|
String |
getName()
Listener name.
|
void |
setAddress(SocketAddress address)
Listening address.
|
void |
setMaxPacketSize(int maxPacketSize)
Maximum size of JSON-RPC packet.
|
void |
start(io.netty.channel.EventLoopGroup acceptors,
io.netty.channel.EventLoopGroup workers)
Perform the thread loop.
|
Listener<ContextType> |
stop()
Sets shutdown flag.
|
public static final int DEFAULT_PACKET_LIMIT
public static final io.netty.channel.ChannelHandler LOGGING_HANDLER
public Listener(String name, ContextType context, Dispatcher<? super ContextType> dispatcher)
name - Thread title.context - API context.dispatcher - JSON-RPC dispatcher.public Listener<ContextType> stop() throws InterruptedException
InterruptedException - When the thread got interrupted when waiting for sockets to be closed.public void start(io.netty.channel.EventLoopGroup acceptors,
io.netty.channel.EventLoopGroup workers)
throws InterruptedException
acceptors - Acceptors thread pool.workers - Workers thread pool.InterruptedException - When the thread got interrupted when waiting for sockets to be started.@Generated(value="lombok") public String getName()
@Generated(value="lombok") public void setAddress(SocketAddress address)
@Generated(value="lombok") public int getMaxPacketSize()
getMaxPacketSize in interface StringChannelInitializer.Configuration@Generated(value="lombok") public void setMaxPacketSize(int maxPacketSize)
Copyright © 2015–2016 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.