|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.nhncorp.neptune.common.ipc.NClient
public class NClient
A client for an IPC service. IPC calls take a single NWritable as a
parameter, and return a NWritable as their value. A service runs on
a port and is defined by a parameter class and a value class.
NServer| Field Summary | |
|---|---|
static org.apache.commons.logging.Log |
LOG
|
java.util.Random |
random
|
static int |
READ_TIMEOUT
|
| Constructor Summary | |
|---|---|
NClient(java.lang.Class<?> valueClass,
NConfiguration conf)
Construct an IPC client with the default SocketFactory |
|
NClient(java.lang.Class valueClass,
NConfiguration conf,
javax.net.SocketFactory factory)
Construct an IPC client whose values are of the given NWritable
class. |
|
| Method Summary | |
|---|---|
NWritable[] |
call(NWritable[] params,
java.net.InetSocketAddress[] addresses)
Makes a set of calls in parallel. |
NWritable |
call(NWritable param,
java.net.InetSocketAddress address)
Make a call, passing param, to the IPC server running at
address, returning the value. |
void |
onewayCall(NWritable param,
java.net.InetSocketAddress address)
|
void |
setTimeout(int timeout)
Sets the timeout used for network i/o. |
void |
stop()
Stop all threads related to this client. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int READ_TIMEOUT
public static final org.apache.commons.logging.Log LOG
public java.util.Random random
| Constructor Detail |
|---|
public NClient(java.lang.Class valueClass,
NConfiguration conf,
javax.net.SocketFactory factory)
NWritable
class.
public NClient(java.lang.Class<?> valueClass,
NConfiguration conf)
valueClass - conf - | Method Detail |
|---|
public void stop()
public void setTimeout(int timeout)
public NWritable call(NWritable param,
java.net.InetSocketAddress address)
throws java.lang.InterruptedException,
java.io.IOException
param, to the IPC server running at
address, returning the value. Throws exceptions if there are
network problems or if the remote code threw an exception.
java.lang.InterruptedException
java.io.IOException
public void onewayCall(NWritable param,
java.net.InetSocketAddress address)
throws java.lang.InterruptedException,
java.io.IOException
java.lang.InterruptedException
java.io.IOException
public NWritable[] call(NWritable[] params,
java.net.InetSocketAddress[] addresses)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||