public abstract class RpcProgram
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler
handleInternal(org.jboss.netty.channel.ChannelHandlerContext, org.apache.hadoop.oncrpc.RpcInfo)
to handle the requests received.Modifier and Type | Field and Description |
---|---|
protected boolean |
allowInsecurePorts |
static int |
RPCB_PORT |
Modifier | Constructor and Description |
---|---|
protected |
RpcProgram(String program,
String host,
int port,
int progNumber,
int lowProgVersion,
int highProgVersion,
DatagramSocket registrationSocket,
boolean allowInsecurePorts)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
doPortMonitoring(SocketAddress remoteAddress) |
int |
getPort() |
protected abstract void |
handleInternal(org.jboss.netty.channel.ChannelHandlerContext ctx,
RpcInfo info) |
protected abstract boolean |
isIdempotent(RpcCall call) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
void |
register(int transport,
int boundPort)
Register this program with the local portmapper.
|
protected void |
register(PortmapMapping mapEntry,
boolean set)
Register the program with Portmap or Rpcbind
|
protected static void |
sendRejectedReply(RpcCall call,
SocketAddress remoteAddress,
org.jboss.netty.channel.ChannelHandlerContext ctx) |
void |
startDaemons() |
String |
toString() |
void |
unregister(int transport,
int boundPort)
Unregister this program with the local portmapper.
|
public static final int RPCB_PORT
protected final boolean allowInsecurePorts
protected RpcProgram(String program, String host, int port, int progNumber, int lowProgVersion, int highProgVersion, DatagramSocket registrationSocket, boolean allowInsecurePorts)
program
- program namehost
- host where the Rpc server program is startedport
- port where the Rpc server program is listening toprogNumber
- program number as defined in RFC 1050lowProgVersion
- lowest version of the specification supportedhighProgVersion
- highest version of the specification supportedDatagramSocket
- registrationSocket if not null, use this socket to
register with portmap daemonallowInsecurePorts
- true to allow client connections from
unprivileged ports, false otherwisepublic void register(int transport, int boundPort)
public void unregister(int transport, int boundPort)
protected void register(PortmapMapping mapEntry, boolean set)
public void startDaemons()
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e) throws Exception
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public boolean doPortMonitoring(SocketAddress remoteAddress)
protected static void sendRejectedReply(RpcCall call, SocketAddress remoteAddress, org.jboss.netty.channel.ChannelHandlerContext ctx)
protected abstract void handleInternal(org.jboss.netty.channel.ChannelHandlerContext ctx, RpcInfo info)
protected abstract boolean isIdempotent(RpcCall call)
public int getPort()
Copyright © 2015 Apache Software Foundation. All Rights Reserved.