Class AbstractConnectionClient
java.lang.Object
org.apache.dubbo.remoting.transport.AbstractPeer
org.apache.dubbo.remoting.transport.AbstractEndpoint
org.apache.dubbo.remoting.transport.AbstractClient
org.apache.dubbo.remoting.api.connection.AbstractConnectionClient
- All Implemented Interfaces:
Resetable,Channel,ChannelHandler,Client,Endpoint,IdleSensible
-
Method Summary
Modifier and TypeMethodDescriptionabstract voidaddCloseListener(Runnable func) add the listener of close connection event.abstract voidcreate connecting promise.abstract voiddestroy()This method will be invoked when counter reaches 0, override this method to destroy materials related to the specific resource.abstract ObjectgetChannel(Boolean generalizable) if generalizable, return NIOChannel else return Dubbo ChannellongGet counterfinal voidincrease()abstract booleanconnection is available.abstract voidonConnected(Object channel) when connected, callback.abstract voidwhen goaway, callback.final booleanrelease()Decreases the reference count by 1 and calls} if the reference count reaches 0.invalid @link
{@link this#destroyfinal AbstractConnectionClientretain()Increments the reference count by 1.Methods inherited from class org.apache.dubbo.remoting.transport.AbstractClient
close, close, disconnect, getAttribute, getConnectAddress, getLocalAddress, getRemoteAddress, hasAttribute, isConnected, reconnect, removeAttribute, send, setAttribute, toStringMethods inherited from class org.apache.dubbo.remoting.transport.AbstractEndpoint
reset, resetMethods inherited from class org.apache.dubbo.remoting.transport.AbstractPeer
caught, connected, disconnected, getChannelHandler, getDelegateHandler, getHandler, getUrl, isClosed, isClosing, received, send, sent, startCloseMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.dubbo.remoting.Endpoint
getChannelHandler, getUrl, isClosed, send, startCloseMethods inherited from interface org.apache.dubbo.remoting.IdleSensible
canHandleIdle
-
Method Details
-
increase
public final void increase() -
retain
Increments the reference count by 1. -
release
public final boolean release()Decreases the reference count by 1 and calls} if the reference count reaches 0.invalid @link
{@link this#destroy -
isAvailable
public abstract boolean isAvailable()connection is available.- Returns:
- boolean
-
createConnectingPromise
public abstract void createConnectingPromise()create connecting promise. -
addCloseListener
add the listener of close connection event.- Parameters:
func- execute function
-
onConnected
when connected, callback.- Parameters:
channel- Channel
-
onGoaway
when goaway, callback.- Parameters:
channel- Channel
-
destroy
public abstract void destroy()This method will be invoked when counter reaches 0, override this method to destroy materials related to the specific resource. -
getChannel
if generalizable, return NIOChannel else return Dubbo Channel- Parameters:
generalizable- generalizable- Returns:
- Dubbo Channel or NIOChannel such as NettyChannel
-
getCounter
public long getCounter()Get counter
-