Package org.drasyl.handler.rmi
Class RmiServerHandler
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.RmiServerHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class RmiServerHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,SocketAddress>>
A
ChannelHandler that can serve local object whose methods then can be
invoked by remote nodes using RmiClientHandler.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidBinds aobjectto the specifiednameand makes it therefore available for remote method invocation.protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<RmiMessage, SocketAddress> msg) voidReplaces the binding (if any) for the specifiednameand makesobjectavailable for remote method invocation.voidRemoves the binding (if any) for the specifiedname.Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
RmiServerHandler
-
RmiServerHandler
public RmiServerHandler()
-
-
Method Details
-
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>>
-
bind
Binds aobjectto the specifiednameand makes it therefore available for remote method invocation.- Parameters:
name- name to bind the given object toobject- an object to be made available for remote invocations- Throws:
IllegalArgumentException- ifnameis already bound orobjectdoes not implement any interfacesNullPointerException- ifnameorobjectisnull
-
unbind
Removes the binding (if any) for the specifiedname.- Parameters:
name- name of the binding to delete- Throws:
NullPointerException- ifnameisnull
-
rebind
Replaces the binding (if any) for the specifiednameand makesobjectavailable for remote method invocation.- Parameters:
name- name of the binding to replaceobject- (new) object to be made available for remote invocations- Throws:
NullPointerException- ifnameorobjectisnull
-