|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.alipay.remoting.Connection
public class Connection
An abstraction of socket channel.
| Field Summary | |
|---|---|
static io.netty.util.AttributeKey<Connection> |
CONNECTION
Attribute key for connection |
static io.netty.util.AttributeKey<Integer> |
HEARTBEAT_COUNT
Attribute key for heartbeat count |
static io.netty.util.AttributeKey<Boolean> |
HEARTBEAT_SWITCH
Attribute key for heartbeat switch for each connection |
static io.netty.util.AttributeKey<ProtocolCode> |
PROTOCOL
Attribute key for protocol |
static io.netty.util.AttributeKey<Byte> |
VERSION
Attribute key for version |
| Constructor Summary | |
|---|---|
Connection(io.netty.channel.Channel channel)
Constructor |
|
Connection(io.netty.channel.Channel channel,
ProtocolCode protocolCode,
byte version,
Url url)
Constructor |
|
Connection(io.netty.channel.Channel channel,
ProtocolCode protocolCode,
Url url)
Constructor |
|
Connection(io.netty.channel.Channel channel,
Url url)
Constructor |
|
| Method Summary | |
|---|---|
void |
addIdPoolKeyMapping(Integer id,
String poolKey)
add Id to group Mapping |
InvokeFuture |
addInvokeFuture(InvokeFuture future)
Add an InvokeFuture |
void |
addPoolKey(String poolKey)
add a pool key to list |
void |
clearAttributes()
Clear attribute. |
void |
close()
Close the connection. |
void |
decreaseRef()
decrease the reference count |
Object |
getAttribute(String key)
Get attribute. |
io.netty.channel.Channel |
getChannel()
Get the netty channel of the connection. |
InvokeFuture |
getInvokeFuture(int id)
Get the InvokeFuture with invokeId of id. |
ConcurrentHashMap<Integer,InvokeFuture> |
getInvokeFutureMap()
Getter method for property invokeFutureMap. |
InetSocketAddress |
getLocalAddress()
Get the address of the local peer. |
String |
getLocalIP()
Get the local IP. |
int |
getLocalPort()
Get the local port. |
Set<String> |
getPoolKeys()
get all pool keys |
InetSocketAddress |
getRemoteAddress()
Get the address of the remote peer. |
String |
getRemoteIP()
Get the remote IP. |
int |
getRemotePort()
Get the remote port. |
Url |
getUrl()
Getter method for property url. |
void |
increaseRef()
increase the reference count |
boolean |
isFine()
to check whether the connection is fine to use |
boolean |
isInvokeFutureMapFinish()
Whether invokeFutures is completed |
boolean |
noRef()
to check whether the reference count is 0 |
void |
onClose()
Do something when closing. |
void |
removeAttribute(String key)
Remove attribute. |
String |
removeIdPoolKeyMapping(Integer id)
remove id to group Mapping |
InvokeFuture |
removeInvokeFuture(int id)
Remove InvokeFuture who's invokeId is id |
void |
removePoolKey(String poolKey)
remove pool key |
void |
setAttribute(String key,
Object value)
Set attribute key=value. |
Object |
setAttributeIfAbsent(String key,
Object value)
set attribute if key absent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final io.netty.util.AttributeKey<Connection> CONNECTION
public static final io.netty.util.AttributeKey<Integer> HEARTBEAT_COUNT
public static final io.netty.util.AttributeKey<Boolean> HEARTBEAT_SWITCH
public static final io.netty.util.AttributeKey<ProtocolCode> PROTOCOL
public static final io.netty.util.AttributeKey<Byte> VERSION
| Constructor Detail |
|---|
public Connection(io.netty.channel.Channel channel)
channel -
public Connection(io.netty.channel.Channel channel,
Url url)
channel - url -
public Connection(io.netty.channel.Channel channel,
ProtocolCode protocolCode,
Url url)
channel - protocolCode - url -
public Connection(io.netty.channel.Channel channel,
ProtocolCode protocolCode,
byte version,
Url url)
channel - protocolCode - url - | Method Detail |
|---|
public boolean isFine()
public void increaseRef()
public void decreaseRef()
public boolean noRef()
public InetSocketAddress getRemoteAddress()
public String getRemoteIP()
public int getRemotePort()
public InetSocketAddress getLocalAddress()
public String getLocalIP()
public int getLocalPort()
public io.netty.channel.Channel getChannel()
public InvokeFuture getInvokeFuture(int id)
id -
public InvokeFuture addInvokeFuture(InvokeFuture future)
future -
public InvokeFuture removeInvokeFuture(int id)
id -
public void onClose()
public void close()
public boolean isInvokeFutureMapFinish()
public void addPoolKey(String poolKey)
poolKey - public Set<String> getPoolKeys()
public void removePoolKey(String poolKey)
poolKey - public Url getUrl()
public void addIdPoolKeyMapping(Integer id,
String poolKey)
id - poolKey - public String removeIdPoolKeyMapping(Integer id)
id -
public void setAttribute(String key,
Object value)
key - value -
public Object setAttributeIfAbsent(String key,
Object value)
key - value -
public void removeAttribute(String key)
key - public Object getAttribute(String key)
key -
public void clearAttributes()
public ConcurrentHashMap<Integer,InvokeFuture> getInvokeFutureMap()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||