com.alibaba.dubbo.remoting.transport
Class ChannelDelegate

java.lang.Object
  extended by com.alibaba.dubbo.remoting.transport.ChannelDelegate
All Implemented Interfaces:
Channel, Endpoint

public class ChannelDelegate
extends Object
implements Channel

ChannelDelegate

Author:
william.liangf

Constructor Summary
ChannelDelegate()
           
ChannelDelegate(Channel channel)
           
 
Method Summary
 void close()
          close the channel.
 void close(int timeout)
          Graceful close the channel.
 Object getAttribute(String key)
          get attribute.
 Channel getChannel()
           
 ChannelHandler getChannelHandler()
          get channel handler.
 InetSocketAddress getLocalAddress()
          get local address.
 InetSocketAddress getRemoteAddress()
          get remote address.
 URL getUrl()
          get url.
 boolean hasAttribute(String key)
          has attribute.
 boolean isClosed()
          is closed.
 boolean isConnected()
          is connected.
 void removeAttribute(String key)
          remove attribute.
 void send(Object message)
          send message.
 void send(Object message, boolean sent)
          send message.
 void setAttribute(String key, Object value)
          set attribute.
 void setChannel(Channel channel)
           
 void startClose()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelDelegate

public ChannelDelegate()

ChannelDelegate

public ChannelDelegate(Channel channel)
Method Detail

getChannel

public Channel getChannel()

setChannel

public void setChannel(Channel channel)

getUrl

public URL getUrl()
Description copied from interface: Endpoint
get url.

Specified by:
getUrl in interface Endpoint
Returns:
url

getRemoteAddress

public InetSocketAddress getRemoteAddress()
Description copied from interface: Channel
get remote address.

Specified by:
getRemoteAddress in interface Channel
Returns:
remote address.

getChannelHandler

public ChannelHandler getChannelHandler()
Description copied from interface: Endpoint
get channel handler.

Specified by:
getChannelHandler in interface Endpoint
Returns:
channel handler

isConnected

public boolean isConnected()
Description copied from interface: Channel
is connected.

Specified by:
isConnected in interface Channel
Returns:
connected

getLocalAddress

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

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

hasAttribute

public boolean hasAttribute(String key)
Description copied from interface: Channel
has attribute.

Specified by:
hasAttribute in interface Channel
Parameters:
key - key.
Returns:
has or has not.

send

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

Specified by:
send in interface Endpoint
Throws:
RemotingException

getAttribute

public Object getAttribute(String key)
Description copied from interface: Channel
get attribute.

Specified by:
getAttribute in interface Channel
Parameters:
key - key.
Returns:
value.

setAttribute

public void setAttribute(String key,
                         Object value)
Description copied from interface: Channel
set attribute.

Specified by:
setAttribute in interface Channel
Parameters:
key - key.
value - value.

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

removeAttribute

public void removeAttribute(String key)
Description copied from interface: Channel
remove attribute.

Specified by:
removeAttribute in interface Channel
Parameters:
key - key.

close

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

Specified by:
close in interface Endpoint

close

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

Specified by:
close in interface Endpoint

startClose

public void startClose()
Specified by:
startClose in interface Endpoint

isClosed

public boolean isClosed()
Description copied from interface: Endpoint
is closed.

Specified by:
isClosed in interface Endpoint
Returns:
closed


Copyright © 2012–2017 Alibaba. All rights reserved.