Package org.drasyl.handler.rmi
Class RmiClientHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,SocketAddress>>
org.drasyl.handler.rmi.RmiClientHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class RmiClientHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,SocketAddress>>
A
ChannelHandler that can invoke methods on remote objects that are
served on other nodes by RmiServerHandler.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newRmiClientHandler.RmiClientHandler(Map<UUID, org.drasyl.handler.rmi.RmiInvocationHandler> requests) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<RmiMessage, SocketAddress> msg) voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx) <T> Tlookup(String name, Class<T> clazz, SocketAddress address) Returns a stub class that will pass all method invocation to the bindingnameserved byaddress.Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
RmiClientHandler
-
RmiClientHandler
public RmiClientHandler()Creates a newRmiClientHandler.
-
-
Method Details
-
handlerAdded
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter
-
handlerRemoved
public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactivein interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classio.netty.channel.ChannelInboundHandlerAdapter
-
acceptInboundMessage
- Overrides:
acceptInboundMessagein classio.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,SocketAddress>> - Throws:
Exception
-
channelRead0
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<RmiMessage, SocketAddress> msg) - Specified by:
channelRead0in classio.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,SocketAddress>>
-
lookup
Returns a stub class that will pass all method invocation to the bindingnameserved byaddress.- Parameters:
name- the name of the binding at the remote nodeaddress- the address where the remote object is served- Returns:
- a reference to a remote object
- Throws:
NullPointerException- ifname,clazz, oraddressisnullIllegalArgumentException- ifclazzis not an java interface
-