com.alibaba.dubbo.remoting.transport
Class AbstractServer

java.lang.Object
  extended by com.alibaba.dubbo.remoting.transport.AbstractPeer
      extended by com.alibaba.dubbo.remoting.transport.AbstractEndpoint
          extended by com.alibaba.dubbo.remoting.transport.AbstractServer
All Implemented Interfaces:
Resetable, ChannelHandler, Endpoint, Server
Direct Known Subclasses:
GrizzlyServer, MinaServer, NettyServer, NettyServer

public abstract class AbstractServer
extends AbstractEndpoint
implements Server

AbstractServer

Author:
qian.lei, ding.lid

Constructor Summary
AbstractServer(URL url, ChannelHandler handler)
           
 
Method Summary
 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.
 int getAccepts()
           
 InetSocketAddress getBindAddress()
           
 int getIdleTimeout()
           
 InetSocketAddress getLocalAddress()
          get local address.
 void reset(URL url)
          reset.
 void send(Object message, boolean sent)
          send message.
 
Methods inherited from class com.alibaba.dubbo.remoting.transport.AbstractEndpoint
reset
 
Methods inherited from class com.alibaba.dubbo.remoting.transport.AbstractPeer
caught, getChannelHandler, getDelegateHandler, getHandler, getUrl, isClosed, isClosing, received, send, sent, startClose
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.alibaba.dubbo.remoting.Server
getChannel, getChannels, isBound, reset
 
Methods inherited from interface com.alibaba.dubbo.remoting.Endpoint
getChannelHandler, getUrl, isClosed, send, startClose
 

Constructor Detail

AbstractServer

public AbstractServer(URL url,
                      ChannelHandler handler)
               throws RemotingException
Throws:
RemotingException
Method Detail

reset

public void reset(URL url)
Description copied from interface: Resetable
reset.

Specified by:
reset in interface Resetable
Overrides:
reset in class AbstractEndpoint

send

public void send(Object message,
                 boolean sent)
          throws RemotingException
Description copied from interface: Endpoint
send message.

Specified by:
send in interface Endpoint
sent - 是否已发送完成
Throws:
RemotingException

close

public void close()
Description copied from interface: Endpoint
close the channel.

Specified by:
close in interface Endpoint
Overrides:
close in class AbstractPeer

close

public void close(int timeout)
Description copied from interface: Endpoint
Graceful close the channel.

Specified by:
close in interface Endpoint
Overrides:
close in class AbstractPeer

getLocalAddress

public InetSocketAddress getLocalAddress()
Description copied from interface: Endpoint
get local address.

Specified by:
getLocalAddress in interface Endpoint
Returns:
local address.

getBindAddress

public InetSocketAddress getBindAddress()

getAccepts

public int getAccepts()

getIdleTimeout

public int getIdleTimeout()

connected

public void connected(Channel ch)
               throws RemotingException
Description copied from interface: ChannelHandler
on channel connected.

Specified by:
connected in interface ChannelHandler
Overrides:
connected in class AbstractPeer
Parameters:
ch - channel.
Throws:
RemotingException

disconnected

public void disconnected(Channel ch)
                  throws RemotingException
Description copied from interface: ChannelHandler
on channel disconnected.

Specified by:
disconnected in interface ChannelHandler
Overrides:
disconnected in class AbstractPeer
Parameters:
ch - channel.
Throws:
RemotingException


Copyright © 2012–2017 Alibaba. All rights reserved.