public class Connector extends Object implements StringChannelInitializer.Configuration
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_LIMIT
Default packet size limit.
|
| Constructor and Description |
|---|
Connector(io.netty.channel.EventLoopGroup connectors,
RequestHandler handler,
SocketAddress address)
Initializes connector with given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
io.netty.channel.ChannelFuture |
connect()
Connects to server.
|
static Connector |
create(io.netty.channel.EventLoopGroup connectors,
SocketAddress address)
Creates connector instance with default resources.
|
static Connector |
create(io.netty.channel.EventLoopGroup connectors,
String host,
int port)
Creates connector instance with default resources.
|
Object |
execute(String method)
Executes remote call without parameters.
|
Object |
execute(String method,
Map<String,Object> params)
Executes remote call with parameters.
|
int |
getMaxPacketSize()
Maximum size of JSON-RPC packet.
|
void |
reconnect(io.netty.channel.ChannelFuture future)
Enforces connection to server.
|
void |
setMaxPacketSize(int maxPacketSize)
Maximum size of JSON-RPC packet.
|
public static final int DEFAULT_PACKET_LIMIT
public Connector(io.netty.channel.EventLoopGroup connectors,
RequestHandler handler,
SocketAddress address)
connectors - Connectors thread pool.handler - JSON-RPC request handler.address - Server address.public Object execute(String method)
method - Method name.RpcCallException - When execution fails.public Object execute(String method, Map<String,Object> params)
method - Method name.params - RPC params.RpcCallException - When execution fails.public io.netty.channel.ChannelFuture connect()
public void reconnect(io.netty.channel.ChannelFuture future)
future - Connection establishing future.public static Connector create(io.netty.channel.EventLoopGroup connectors, SocketAddress address)
connectors - Connectors thread pool.address - Server address.public static Connector create(io.netty.channel.EventLoopGroup connectors, String host, int port)
connectors - Connectors thread pool.host - Listen host.port - Listen port.@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.