public abstract class AbstractClient extends AbstractEndpoint implements Client
| Constructor and Description |
|---|
AbstractClient(URL url,
ChannelHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
close the channel.
|
void |
close(int timeout)
Graceful close the channel.
|
void |
disconnect() |
Object |
getAttribute(String key)
get attribute.
|
InetSocketAddress |
getConnectAddress() |
InetSocketAddress |
getLocalAddress()
get local address.
|
InetSocketAddress |
getRemoteAddress()
get remote address.
|
boolean |
hasAttribute(String key)
has attribute.
|
boolean |
isConnected()
is connected.
|
void |
reconnect()
reconnect.
|
void |
removeAttribute(String key)
remove attribute.
|
void |
send(Object message,
boolean sent)
send message.
|
void |
setAttribute(String key,
Object value)
set attribute.
|
String |
toString() |
reset, resetcaught, connected, disconnected, getChannelHandler, getDelegateHandler, getHandler, getUrl, isClosed, isClosing, received, send, sent, startCloseequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChannelHandler, getUrl, isClosed, send, startClosepublic AbstractClient(URL url, ChannelHandler handler) throws RemotingException
RemotingExceptionpublic InetSocketAddress getConnectAddress()
public InetSocketAddress getRemoteAddress()
ChannelgetRemoteAddress in interface Channelpublic InetSocketAddress getLocalAddress()
EndpointgetLocalAddress in interface Endpointpublic boolean isConnected()
ChannelisConnected in interface Channelpublic Object getAttribute(String key)
ChannelgetAttribute in interface Channelkey - key.public void setAttribute(String key, Object value)
ChannelsetAttribute in interface Channelkey - key.value - value.public void removeAttribute(String key)
ChannelremoveAttribute in interface Channelkey - key.public boolean hasAttribute(String key)
ChannelhasAttribute in interface Channelkey - key.public void send(Object message, boolean sent) throws RemotingException
Endpointsend in interface Endpointsent - already sent to socket?RemotingExceptionpublic void disconnect()
public void reconnect()
throws RemotingException
Clientreconnect in interface ClientRemotingExceptionpublic void close()
Endpointclose in interface Endpointclose in class AbstractPeerpublic void close(int timeout)
Endpointclose in interface Endpointclose in class AbstractPeerCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.