com.alipay.remoting
Class RemotingContext

java.lang.Object
  extended by com.alipay.remoting.RemotingContext

public class RemotingContext
extends Object

Wrap the ChannelHandlerContext.


Constructor Summary
RemotingContext(io.netty.channel.ChannelHandlerContext ctx)
          Constructor.
RemotingContext(io.netty.channel.ChannelHandlerContext ctx, boolean serverSide)
          Constructor.
RemotingContext(io.netty.channel.ChannelHandlerContext ctx, boolean serverSide, ConcurrentHashMap<String,UserProcessor<?>> userProcessors)
          Constructor.
RemotingContext(io.netty.channel.ChannelHandlerContext ctx, InvokeContext invokeContext, boolean serverSide, ConcurrentHashMap<String,UserProcessor<?>> userProcessors)
          Constructor.
 
Method Summary
 long getArriveTimestamp()
          Getter method for property arriveTimestamp.
 io.netty.channel.ChannelHandlerContext getChannelContext()
          Get the channel handler context.
 Connection getConnection()
          Get connection from channel
 InvokeContext getInvokeContext()
          Getter method for property invokeContext.
 int getTimeout()
          Getter method for property timeout.
 UserProcessor<?> getUserProcessor(String className)
          Get user processor for class name.
 boolean isRequestTimeout()
          whether this request already timeout
 boolean isServerSide()
          The server side
 boolean isTimeoutDiscard()
           
 void setArriveTimestamp(long arriveTimestamp)
          Setter method for property arriveTimestamp.
 void setChannelContext(io.netty.channel.ChannelHandlerContext ctx)
          Set the channel handler context.
 void setRpcCommandType(int rpcCommandType)
          Setter method for property rpcCommandType.
 void setTimeout(int timeout)
          Setter method for property timeout.
 RemotingContext setTimeoutDiscard(boolean failFastEnabled)
           
 io.netty.channel.ChannelFuture writeAndFlush(RemotingCommand msg)
          Wrap the writeAndFlush method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemotingContext

public RemotingContext(io.netty.channel.ChannelHandlerContext ctx)
Constructor.

Parameters:
ctx -

RemotingContext

public RemotingContext(io.netty.channel.ChannelHandlerContext ctx,
                       boolean serverSide)
Constructor.

Parameters:
ctx -
serverSide -

RemotingContext

public RemotingContext(io.netty.channel.ChannelHandlerContext ctx,
                       boolean serverSide,
                       ConcurrentHashMap<String,UserProcessor<?>> userProcessors)
Constructor.

Parameters:
ctx -
serverSide -
userProcessors -

RemotingContext

public RemotingContext(io.netty.channel.ChannelHandlerContext ctx,
                       InvokeContext invokeContext,
                       boolean serverSide,
                       ConcurrentHashMap<String,UserProcessor<?>> userProcessors)
Constructor.

Parameters:
ctx -
invokeContext -
serverSide -
userProcessors -
Method Detail

writeAndFlush

public io.netty.channel.ChannelFuture writeAndFlush(RemotingCommand msg)
Wrap the writeAndFlush method.

Parameters:
msg -
Returns:

isRequestTimeout

public boolean isRequestTimeout()
whether this request already timeout

Returns:

isServerSide

public boolean isServerSide()
The server side

Returns:

getUserProcessor

public UserProcessor<?> getUserProcessor(String className)
Get user processor for class name.

Parameters:
className -
Returns:

getConnection

public Connection getConnection()
Get connection from channel

Returns:

getChannelContext

public io.netty.channel.ChannelHandlerContext getChannelContext()
Get the channel handler context.

Returns:

setChannelContext

public void setChannelContext(io.netty.channel.ChannelHandlerContext ctx)
Set the channel handler context.

Parameters:
ctx -

getInvokeContext

public InvokeContext getInvokeContext()
Getter method for property invokeContext.

Returns:
property value of invokeContext

setArriveTimestamp

public void setArriveTimestamp(long arriveTimestamp)
Setter method for property arriveTimestamp.

Parameters:
arriveTimestamp - value to be assigned to property arriveTimestamp

getArriveTimestamp

public long getArriveTimestamp()
Getter method for property arriveTimestamp.

Returns:
property value of arriveTimestamp

setTimeout

public void setTimeout(int timeout)
Setter method for property timeout.

Parameters:
timeout - value to be assigned to property timeout

getTimeout

public int getTimeout()
Getter method for property timeout.

Returns:
property value of timeout

setRpcCommandType

public void setRpcCommandType(int rpcCommandType)
Setter method for property rpcCommandType.

Parameters:
rpcCommandType - value to be assigned to property rpcCommandType

isTimeoutDiscard

public boolean isTimeoutDiscard()

setTimeoutDiscard

public RemotingContext setTimeoutDiscard(boolean failFastEnabled)


Copyright © 2018. All rights reserved.