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) |
protected |
RpcProgram(String program,
String host,
int port,
int progNumber,
int lowProgVersion,
int highProgVersion,
DatagramSocket registrationSocket,
boolean allowInsecurePorts,
int portmapUdpTimeoutMillis)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
doPortMonitoring(SocketAddress remoteAddress) |
int |
getPort() |
int |
getPortmapUdpTimeoutMillis() |
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() |
void |
stopDaemons() |
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)
protected RpcProgram(String program, String host, int port, int progNumber, int lowProgVersion, int highProgVersion, DatagramSocket registrationSocket, boolean allowInsecurePorts, int portmapUdpTimeoutMillis)
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 supportedregistrationSocket - if not null, use this socket to register
with portmap daemonallowInsecurePorts - true to allow client connections from
unprivileged ports, false otherwiseportmapUdpTimeoutMillis - timeout in milliseconds for RPC connectionpublic void register(int transport,
int boundPort)
transport - transport layer for port mapboundPort - port number of bounded RPC programpublic void unregister(int transport,
int boundPort)
transport - transport layer for port mapboundPort - port number of bounded RPC programprotected void register(PortmapMapping mapEntry, boolean set)
mapEntry - port map entriesset - specifies registration or notpublic void startDaemons()
public void stopDaemons()
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e)
throws Exception
messageReceived in class org.jboss.netty.channel.SimpleChannelUpstreamHandlerExceptionpublic 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()
public int getPortmapUdpTimeoutMillis()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.