com.alipay.remoting
Class DefaultBizContext

java.lang.Object
  extended by com.alipay.remoting.DefaultBizContext
All Implemented Interfaces:
BizContext

public class DefaultBizContext
extends Object
implements BizContext

default biz context


Constructor Summary
DefaultBizContext(RemotingContext remotingCtx)
          Constructor with RemotingContext
 
Method Summary
 String get(String key)
          get value
 long getArriveTimestamp()
          get the arrive time stamp
 int getClientTimeout()
          get the timeout value from rpc client.
 Connection getConnection()
          get the connection of this request
 InvokeContext getInvokeContext()
          get invoke context.
 String getRemoteAddress()
          get remote address
 String getRemoteHost()
          get remote host ip
 int getRemotePort()
          get remote port
protected  RemotingContext getRemotingCtx()
          get remoting context
 boolean isRequestTimeout()
          check whether request already timeout
 void put(String key, String value)
          put a key and value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBizContext

public DefaultBizContext(RemotingContext remotingCtx)
Constructor with RemotingContext

Parameters:
remotingCtx -
Method Detail

getRemotingCtx

protected RemotingContext getRemotingCtx()
get remoting context

Returns:
RemotingContext

getRemoteAddress

public String getRemoteAddress()
Description copied from interface: BizContext
get remote address

Specified by:
getRemoteAddress in interface BizContext
Returns:
See Also:
BizContext.getRemoteAddress()

getRemoteHost

public String getRemoteHost()
Description copied from interface: BizContext
get remote host ip

Specified by:
getRemoteHost in interface BizContext
Returns:
See Also:
BizContext.getRemoteHost()

getRemotePort

public int getRemotePort()
Description copied from interface: BizContext
get remote port

Specified by:
getRemotePort in interface BizContext
Returns:
See Also:
BizContext.getRemotePort()

getConnection

public Connection getConnection()
Description copied from interface: BizContext
get the connection of this request

Specified by:
getConnection in interface BizContext
Returns:
See Also:
BizContext.getConnection()

isRequestTimeout

public boolean isRequestTimeout()
Description copied from interface: BizContext
check whether request already timeout

Specified by:
isRequestTimeout in interface BizContext
Returns:
true if already timeout, you can log some useful info and then discard this request.
See Also:
BizContext.isRequestTimeout()

getClientTimeout

public int getClientTimeout()
get the timeout value from rpc client.

Specified by:
getClientTimeout in interface BizContext
Returns:

getArriveTimestamp

public long getArriveTimestamp()
get the arrive time stamp

Specified by:
getArriveTimestamp in interface BizContext
Returns:

put

public void put(String key,
                String value)
Description copied from interface: BizContext
put a key and value

Specified by:
put in interface BizContext
See Also:
BizContext.put(java.lang.String, java.lang.String)

get

public String get(String key)
Description copied from interface: BizContext
get value

Specified by:
get in interface BizContext
Returns:
See Also:
BizContext.get(java.lang.String)

getInvokeContext

public InvokeContext getInvokeContext()
Description copied from interface: BizContext
get invoke context.

Specified by:
getInvokeContext in interface BizContext
Returns:
See Also:
BizContext.getInvokeContext()


Copyright © 2018. All rights reserved.