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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
Binds aobject
to the specifiedname
and makes it therefore available for remote method invocation.protected void
channelRead0
(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.AddressedEnvelope<RmiMessage, SocketAddress> msg) void
Replaces the binding (if any) for the specifiedname
and makesobject
available for remote method invocation.void
Removes the binding (if any) for the specifiedname
.Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
channelRead
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
RmiServerHandler
-
RmiServerHandler
public RmiServerHandler()
-
-
Method Details
-
acceptInboundMessage
- Overrides:
acceptInboundMessage
in 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:
channelRead0
in classio.netty.channel.SimpleChannelInboundHandler<io.netty.channel.AddressedEnvelope<RmiMessage,
SocketAddress>>
-
bind
Binds aobject
to the specifiedname
and 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
- ifname
is already bound orobject
does not implement any interfacesNullPointerException
- ifname
orobject
isnull
-
unbind
Removes the binding (if any) for the specifiedname
.- Parameters:
name
- name of the binding to delete- Throws:
NullPointerException
- ifname
isnull
-
rebind
Replaces the binding (if any) for the specifiedname
and makesobject
available for remote method invocation.- Parameters:
name
- name of the binding to replaceobject
- (new) object to be made available for remote invocations- Throws:
NullPointerException
- ifname
orobject
isnull
-