public class Connector extends Object implements IoServiceUtils.Configuration
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PACKET_LIMIT
Default packet size limit.
|
| Constructor and Description |
|---|
Connector(org.apache.mina.transport.socket.nio.NioSocketConnector connector,
RequestIoHandler handler,
InetSocketAddress address)
Initializes connector with given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.mina.core.future.ConnectFuture |
connect()
Connects to server.
|
static Connector |
create(InetSocketAddress address)
Creates connector instance with default resources.
|
static Connector |
create(String host,
int port)
Creates connector instance with default resources.
|
void |
dispose()
Releases all 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()
Returns size of maximum JSON-RPC packet size.
|
void |
reconnect(org.apache.mina.core.future.ConnectFuture future)
Enforces connection to server.
|
void |
setMaxPacketSize(int maxPacketSize)
Sets max JSON-RPC packet size.
|
public static final int DEFAULT_PACKET_LIMIT
public Connector(org.apache.mina.transport.socket.nio.NioSocketConnector connector,
RequestIoHandler handler,
InetSocketAddress address)
connector - Socket connector.handler - JSON-RPC request handler.address - Listening address.public void setMaxPacketSize(int maxPacketSize)
maxPacketSize - Packet size in bytes.public int getMaxPacketSize()
getMaxPacketSize in interface IoServiceUtils.Configurationpublic 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 org.apache.mina.core.future.ConnectFuture connect()
public void reconnect(org.apache.mina.core.future.ConnectFuture future)
future - Connection establishing future.public void dispose()
public static Connector create(InetSocketAddress address)
address - Server address.Copyright © 2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.