public class ClientMsgHandler extends Object
Created by mwei on 7/27/16.
Modifier and Type | Class and Description |
---|---|
static interface |
ClientMsgHandler.Handler<T extends CorfuMsg> |
Constructor and Description |
---|
ClientMsgHandler(IClient client)
Construct a new instance of ClientMsgHandler.
|
Modifier and Type | Method and Description |
---|---|
<T extends CorfuMsg> |
addHandler(CorfuMsgType messageType,
ClientMsgHandler.Handler<T> handler)
Add a handler to this message handler.
|
ClientMsgHandler |
generateHandlers(MethodHandles.Lookup caller,
Object o)
Generate handlers for a particular client.
|
Set<CorfuMsgType> |
getHandledTypes()
Get the types this handler will handle.
|
boolean |
handle(CorfuMsg message,
io.netty.channel.ChannelHandlerContext ctx)
Handle an incoming CorfuMsg.
|
public ClientMsgHandler(IClient client)
public <T extends CorfuMsg> ClientMsgHandler addHandler(CorfuMsgType messageType, ClientMsgHandler.Handler<T> handler)
T
- A CorfuMsg type.messageType
- The type of CorfuMsg this handler will handle.handler
- The handler itself.public boolean handle(CorfuMsg message, io.netty.channel.ChannelHandlerContext ctx)
message
- The message to handle.ctx
- The channel handler context.public ClientMsgHandler generateHandlers(@NonNull MethodHandles.Lookup caller, @NonNull Object o)
caller
- The context that is being used. Call MethodHandles.lookup() to obtain.o
- The object that implements the client.public Set<CorfuMsgType> getHandledTypes()
Copyright © 2019 CorfuDB. All rights reserved.