org.apache.nutch.ipc
Class RPC

java.lang.Object
  extended byorg.apache.nutch.ipc.RPC

public class RPC
extends Object

A simple RPC mechanism. A protocol is a Java interface. All parameters and return types must be one of:

All methods in the protocol should throw only IOException. No field data of the protocol instance is transmitted.


Method Summary
static Object[] call(Method method, Object[][] params, InetSocketAddress[] addrs)
          Expert: Make multiple, parallel calls to a set of servers.
static Object getProxy(Class protocol, InetSocketAddress addr)
          Construct a client-side proxy object that implements the named protocol, talking to a server at the named address.
static Server getServer(Object instance, int port)
          Construct a server for a protocol implementation instance listening on a port.
static Server getServer(Object instance, int port, int numHandlers, boolean verbose)
          Construct a server for a protocol implementation instance listening on a port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProxy

public static Object getProxy(Class protocol,
                              InetSocketAddress addr)
Construct a client-side proxy object that implements the named protocol, talking to a server at the named address.


call

public static Object[] call(Method method,
                            Object[][] params,
                            InetSocketAddress[] addrs)
                     throws IOException
Expert: Make multiple, parallel calls to a set of servers.

Throws:
IOException

getServer

public static Server getServer(Object instance,
                               int port)
Construct a server for a protocol implementation instance listening on a port.


getServer

public static Server getServer(Object instance,
                               int port,
                               int numHandlers,
                               boolean verbose)
Construct a server for a protocol implementation instance listening on a port.



Copyright © 2006 The Apache Software Foundation