public abstract class AbstractPeer extends Object implements Endpoint, ChannelHandler
| Constructor and Description |
|---|
AbstractPeer(URL url,
ChannelHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
caught(Channel ch,
Throwable ex)
on exception caught.
|
void |
close()
close the channel.
|
void |
close(int timeout)
Graceful close the channel.
|
void |
connected(Channel ch)
on channel connected.
|
void |
disconnected(Channel ch)
on channel disconnected.
|
ChannelHandler |
getChannelHandler()
get channel handler.
|
ChannelHandler |
getDelegateHandler()
Return the final handler (which may have been wrapped).
|
ChannelHandler |
getHandler()
Deprecated.
|
URL |
getUrl()
get url.
|
boolean |
isClosed()
is closed.
|
boolean |
isClosing() |
void |
received(Channel ch,
Object msg)
on message received.
|
void |
send(Object message)
send message.
|
void |
sent(Channel ch,
Object msg)
on message sent.
|
void |
startClose() |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLocalAddress, sendpublic AbstractPeer(URL url, ChannelHandler handler)
public void send(Object message) throws RemotingException
Endpointsend in interface EndpointRemotingExceptionpublic void close()
Endpointpublic void close(int timeout)
Endpointpublic void startClose()
startClose in interface Endpointpublic ChannelHandler getChannelHandler()
EndpointgetChannelHandler in interface Endpoint@Deprecated public ChannelHandler getHandler()
public ChannelHandler getDelegateHandler()
public boolean isClosed()
Endpointpublic boolean isClosing()
public void connected(Channel ch) throws RemotingException
ChannelHandlerconnected in interface ChannelHandlerch - channel.RemotingExceptionpublic void disconnected(Channel ch) throws RemotingException
ChannelHandlerdisconnected in interface ChannelHandlerch - channel.RemotingExceptionpublic void sent(Channel ch, Object msg) throws RemotingException
ChannelHandlersent in interface ChannelHandlerch - channel.msg - message.RemotingExceptionpublic void received(Channel ch, Object msg) throws RemotingException
ChannelHandlerreceived in interface ChannelHandlerch - channel.msg - message.RemotingExceptionpublic void caught(Channel ch, Throwable ex) throws RemotingException
ChannelHandlercaught in interface ChannelHandlerch - channel.ex - exception.RemotingExceptionCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.