com.alibaba.dubbo.remoting.exchange.support.header
Class HeaderExchangeClient

java.lang.Object
  extended by com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeClient
All Implemented Interfaces:
Resetable, Channel, Client, Endpoint, ExchangeChannel, ExchangeClient

public class HeaderExchangeClient
extends Object
implements ExchangeClient

DefaultMessageClient

Author:
william.liangf, chao.liuc

Constructor Summary
HeaderExchangeClient(Client client, boolean needHeartbeat)
           
 
Method Summary
 void close()
          close the channel.
 void close(int timeout)
          Graceful close the channel.
 Object getAttribute(String key)
          get attribute.
 ChannelHandler getChannelHandler()
          get channel handler.
 ExchangeHandler getExchangeHandler()
          get message 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 reconnect()
          reconnect.
 void removeAttribute(String key)
          remove attribute.
 ResponseFuture request(Object request)
          send request.
 ResponseFuture request(Object request, int timeout)
          send request.
 void reset(Parameters parameters)
          Deprecated. 
 void reset(URL url)
          reset.
 void send(Object message)
          send message.
 void send(Object message, boolean sent)
          send message.
 void setAttribute(String key, Object value)
          set attribute.
 void startClose()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HeaderExchangeClient

public HeaderExchangeClient(Client client,
                            boolean needHeartbeat)
Method Detail

request

public ResponseFuture request(Object request)
                       throws RemotingException
Description copied from interface: ExchangeChannel
send request.

Specified by:
request in interface ExchangeChannel
Returns:
response future
Throws:
RemotingException

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.

request

public ResponseFuture request(Object request,
                              int timeout)
                       throws RemotingException
Description copied from interface: ExchangeChannel
send request.

Specified by:
request in interface ExchangeChannel
Returns:
response future
Throws:
RemotingException

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.

getExchangeHandler

public ExchangeHandler getExchangeHandler()
Description copied from interface: ExchangeChannel
get message handler.

Specified by:
getExchangeHandler in interface ExchangeChannel
Returns:
message handler

send

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

Specified by:
send in interface Endpoint
Throws:
RemotingException

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

isClosed

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

Specified by:
isClosed in interface Endpoint
Returns:
closed

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
Specified by:
close in interface ExchangeChannel

startClose

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

reset

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

Specified by:
reset in interface Resetable

reset

@Deprecated
public void reset(Parameters parameters)
Deprecated. 

Specified by:
reset in interface Client

reconnect

public void reconnect()
               throws RemotingException
Description copied from interface: Client
reconnect.

Specified by:
reconnect in interface Client
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.

removeAttribute

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

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

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.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012–2017 Alibaba. All rights reserved.