com.alipay.remoting.rpc
Class RpcClient

java.lang.Object
  extended by com.alipay.remoting.rpc.RpcClient

public class RpcClient
extends Object

Client for Rpc.


Field Summary
protected  RpcRemoting rpcRemoting
          rpc remoting
 
Constructor Summary
RpcClient()
           
 
Method Summary
 void addConnectionEventProcessor(ConnectionEventType type, ConnectionEventProcessor processor)
          Add processor to process connection event.
 boolean checkConnection(String addr)
          check connection, the address format example - 127.0.0.1:12200?
 void closeConnection(String addr)
          Close all connections of a address
 void closeConnection(Url url)
          Close all connections of a Url
 void closeStandaloneConnection(Connection conn)
          Close a standalone connection
 Connection createStandaloneConnection(String addr, int connectTimeout)
          Create a stand alone connection using address, address format example - 127.0.0.1:12200
Notice:
Each time you can this method, will create a new connection.
 Connection createStandaloneConnection(String ip, int port, int connectTimeout)
          Create a stand alone connection using ip and port.
 void disableConnHeartbeat(String addr)
          Disable heart beat for a certain connection.
 void disableConnHeartbeat(Url url)
          Disable heart beat for a certain connection.
 void enableConnectionMonitorSwitch()
          enable connection monitor switch on
 void enableConnHeartbeat(String addr)
          Enable heart beat for a certain connection.
 void enableConnHeartbeat(Url url)
          Enable heart beat for a certain connection.
 void enableReconnectSwitch()
          enable connection reconnect switch on Notice: This api should be called before init()
 RemotingAddressParser getAddressParser()
          Getter method for property addressParser.
 Map<String,List<Connection>> getAllManagedConnections()
          get all connections managed by rpc client
 Connection getConnection(String addr, int connectTimeout)
          Get a connection using address, address format example - 127.0.0.1:12200?
 Connection getConnection(Url url, int connectTimeout)
          Get a connection using a Url.
protected  DefaultConnectionManager getConnectionManager()
           
 void init()
          Initialization.
 Object invokeSync(Connection conn, Object request, int timeoutMillis)
          Synchronous invocation using a Connection
Notice:
DO NOT modify the request object concurrently when this method is called.
 Object invokeSync(Connection conn, Object request, InvokeContext invokeContext, int timeoutMillis)
          Synchronous invocation with a InvokeContext, common api notice please see invokeSync(Connection, Object, int)
 Object invokeSync(String addr, Object request, int timeoutMillis)
          Synchronous invocation using a string address, address format example - 127.0.0.1:12200?
 Object invokeSync(String addr, Object request, InvokeContext invokeContext, int timeoutMillis)
          Synchronous invocation with a InvokeContext, common api notice please see invokeSync(String, Object, int)
 Object invokeSync(Url url, Object request, int timeoutMillis)
          Synchronous invocation using a parsed Url
Notice:
DO NOT modify the request object concurrently when this method is called.
 Object invokeSync(Url url, Object request, InvokeContext invokeContext, int timeoutMillis)
          Synchronous invocation with a InvokeContext, common api notice please see invokeSync(Url, Object, int)
 void invokeWithCallback(Connection conn, Object request, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation using a Connection
You can specify an implementation of InvokeCallback to get the result.
 void invokeWithCallback(Connection conn, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(Connection, Object, InvokeCallback, int)
 void invokeWithCallback(String addr, Object request, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation using a string address, address format example - 127.0.0.1:12200?
 void invokeWithCallback(String addr, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(String, Object, InvokeCallback, int)
 void invokeWithCallback(Url url, Object request, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation using a parsed Url
You can specify an implementation of InvokeCallback to get the result.
 void invokeWithCallback(Url url, Object request, InvokeContext invokeContext, InvokeCallback invokeCallback, int timeoutMillis)
          Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(Url, Object, InvokeCallback, int)
 RpcResponseFuture invokeWithFuture(Connection conn, Object request, int timeoutMillis)
          Future invocation using a Connection
You can get result use the returned RpcResponseFuture.
 RpcResponseFuture invokeWithFuture(Connection conn, Object request, InvokeContext invokeContext, int timeoutMillis)
          Future invocation with a InvokeContext, common api notice please see invokeWithFuture(Connection, Object, int)
 RpcResponseFuture invokeWithFuture(String addr, Object request, int timeoutMillis)
          Future invocation using a string address, address format example - 127.0.0.1:12200?
 RpcResponseFuture invokeWithFuture(String addr, Object request, InvokeContext invokeContext, int timeoutMillis)
          Future invocation with a InvokeContext, common api notice please see invokeWithFuture(String, Object, int)
 RpcResponseFuture invokeWithFuture(Url url, Object request, int timeoutMillis)
          Future invocation using a parsed Url
You can get result use the returned RpcResponseFuture.
 RpcResponseFuture invokeWithFuture(Url url, Object request, InvokeContext invokeContext, int timeoutMillis)
          Future invocation with a InvokeContext, common api notice please see invokeWithFuture(Url, Object, int)
 boolean isConnectionMonitorSwitchOn()
          is connection monitor switch on
 boolean isReconnectSwitchOn()
          is reconnect switch on
 void oneway(Connection conn, Object request)
          One way invocation using a Connection
Notice:
DO NOT modify the request object concurrently when this method is called.
 void oneway(Connection conn, Object request, InvokeContext invokeContext)
          Oneway invocation with a InvokeContext, common api notice please see oneway(Connection, Object)
 void oneway(String addr, Object request)
          One way invocation using a string address, address format example - 127.0.0.1:12200?
 void oneway(String addr, Object request, InvokeContext invokeContext)
          Oneway invocation with a InvokeContext, common api notice please see oneway(Connection, Object)
 void oneway(Url url, Object request)
          One way invocation using a parsed Url
Notice:
DO NOT modify the request object concurrently when this method is called.
 void oneway(Url url, Object request, InvokeContext invokeContext)
          Oneway invocation with a InvokeContext, common api notice please see oneway(Url, Object)
 void registerUserProcessor(UserProcessor<?> processor)
          Register user processor for client side.
 void setAddressParser(RemotingAddressParser addressParser)
          Setter method for property addressParser.
 void setMonitorStrategy(ConnectionMonitorStrategy monitorStrategy)
          Setter method for property monitorStrategy.
 void shutdown()
          Shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rpcRemoting

protected RpcRemoting rpcRemoting
rpc remoting

Constructor Detail

RpcClient

public RpcClient()
Method Detail

init

public void init()
Initialization.


shutdown

public void shutdown()
Shutdown.

Notice:

  • Rpc client can not be used any more after shutdown.
  • If you need, you should destroy it, and instantiate another one.


  • oneway

    public void oneway(String addr,
                       Object request)
                throws RemotingException,
                       InterruptedException
    One way invocation using a string address, address format example - 127.0.0.1:12200?key1=value1&key2=value2

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the string address to find a available connection, if none then create one.
      • You can use RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
      • You can use RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
      • You can use RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
    3. You should use closeConnection(String addr) to close it if you want.

    Parameters:
    addr -
    request -
    Throws:
    RemotingException
    InterruptedException

    oneway

    public void oneway(String addr,
                       Object request,
                       InvokeContext invokeContext)
                throws RemotingException,
                       InterruptedException
    Oneway invocation with a InvokeContext, common api notice please see oneway(Connection, Object)

    Parameters:
    addr -
    request -
    invokeContext -
    Throws:
    RemotingException
    InterruptedException

    oneway

    public void oneway(Url url,
                       Object request)
                throws RemotingException,
                       InterruptedException
    One way invocation using a parsed Url

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the parsed Url to find a available connection, if none then create one.
    3. You should use closeConnection(Url url) to close it if you want.

    Parameters:
    url -
    request -
    Throws:
    RemotingException
    InterruptedException

    oneway

    public void oneway(Url url,
                       Object request,
                       InvokeContext invokeContext)
                throws RemotingException,
                       InterruptedException
    Oneway invocation with a InvokeContext, common api notice please see oneway(Url, Object)

    Parameters:
    url -
    request -
    invokeContext -
    Throws:
    RemotingException
    InterruptedException

    oneway

    public void oneway(Connection conn,
                       Object request)
                throws RemotingException
    One way invocation using a Connection

    Notice:
    DO NOT modify the request object concurrently when this method is called.

    Parameters:
    conn -
    request -
    Throws:
    RemotingException

    oneway

    public void oneway(Connection conn,
                       Object request,
                       InvokeContext invokeContext)
                throws RemotingException
    Oneway invocation with a InvokeContext, common api notice please see oneway(Connection, Object)

    Parameters:
    conn -
    request -
    invokeContext -
    Throws:
    RemotingException

    invokeSync

    public Object invokeSync(String addr,
                             Object request,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation using a string address, address format example - 127.0.0.1:12200?key1=value1&key2=value2

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the string address to find a available connection, if none then create one.
      • You can use RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
      • You can use RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
      • You can use RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
    3. You should use closeConnection(String addr) to close it if you want.

    Parameters:
    addr -
    request -
    timeoutMillis -
    Returns:
    Object
    Throws:
    RemotingException
    InterruptedException

    invokeSync

    public Object invokeSync(String addr,
                             Object request,
                             InvokeContext invokeContext,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation with a InvokeContext, common api notice please see invokeSync(String, Object, int)

    Parameters:
    addr -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException
    InterruptedException

    invokeSync

    public Object invokeSync(Url url,
                             Object request,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation using a parsed Url

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the parsed Url to find a available connection, if none then create one.
    3. You should use closeConnection(Url url) to close it if you want.

    Parameters:
    url -
    request -
    timeoutMillis -
    Returns:
    Object
    Throws:
    RemotingException
    InterruptedException

    invokeSync

    public Object invokeSync(Url url,
                             Object request,
                             InvokeContext invokeContext,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation with a InvokeContext, common api notice please see invokeSync(Url, Object, int)

    Parameters:
    url -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException
    InterruptedException

    invokeSync

    public Object invokeSync(Connection conn,
                             Object request,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation using a Connection

    Notice:
    DO NOT modify the request object concurrently when this method is called.

    Parameters:
    conn -
    request -
    timeoutMillis -
    Returns:
    Object
    Throws:
    RemotingException
    InterruptedException

    invokeSync

    public Object invokeSync(Connection conn,
                             Object request,
                             InvokeContext invokeContext,
                             int timeoutMillis)
                      throws RemotingException,
                             InterruptedException
    Synchronous invocation with a InvokeContext, common api notice please see invokeSync(Connection, Object, int)

    Parameters:
    conn -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    Object
    Throws:
    RemotingException
    InterruptedException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(String addr,
                                              Object request,
                                              int timeoutMillis)
                                       throws RemotingException,
                                              InterruptedException
    Future invocation using a string address, address format example - 127.0.0.1:12200?key1=value1&key2=value2
    You can get result use the returned RpcResponseFuture.

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the string address to find a available connection, if none then create one.
      • You can use RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
      • You can use RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
      • You can use RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
    3. You should use closeConnection(String addr) to close it if you want.

    Parameters:
    addr -
    request -
    timeoutMillis -
    Returns:
    RpcResponseFuture
    Throws:
    RemotingException
    InterruptedException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(String addr,
                                              Object request,
                                              InvokeContext invokeContext,
                                              int timeoutMillis)
                                       throws RemotingException,
                                              InterruptedException
    Future invocation with a InvokeContext, common api notice please see invokeWithFuture(String, Object, int)

    Parameters:
    addr -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    RpcResponseFuture
    Throws:
    RemotingException
    InterruptedException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(Url url,
                                              Object request,
                                              int timeoutMillis)
                                       throws RemotingException,
                                              InterruptedException
    Future invocation using a parsed Url
    You can get result use the returned RpcResponseFuture.

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the parsed Url to find a available connection, if none then create one.
    3. You should use closeConnection(Url url) to close it if you want.

    Parameters:
    url -
    request -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException
    InterruptedException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(Url url,
                                              Object request,
                                              InvokeContext invokeContext,
                                              int timeoutMillis)
                                       throws RemotingException,
                                              InterruptedException
    Future invocation with a InvokeContext, common api notice please see invokeWithFuture(Url, Object, int)

    Parameters:
    url -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException
    InterruptedException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(Connection conn,
                                              Object request,
                                              int timeoutMillis)
                                       throws RemotingException
    Future invocation using a Connection
    You can get result use the returned RpcResponseFuture.

    Notice:
    DO NOT modify the request object concurrently when this method is called.

    Parameters:
    conn -
    request -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException

    invokeWithFuture

    public RpcResponseFuture invokeWithFuture(Connection conn,
                                              Object request,
                                              InvokeContext invokeContext,
                                              int timeoutMillis)
                                       throws RemotingException
    Future invocation with a InvokeContext, common api notice please see invokeWithFuture(Connection, Object, int)

    Parameters:
    conn -
    request -
    invokeContext -
    timeoutMillis -
    Returns:
    Throws:
    RemotingException

    invokeWithCallback

    public void invokeWithCallback(String addr,
                                   Object request,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException,
                                   InterruptedException
    Callback invocation using a string address, address format example - 127.0.0.1:12200?key1=value1&key2=value2
    You can specify an implementation of InvokeCallback to get the result.

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the string address to find a available connection, if none then create one.
      • You can use RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
      • You can use RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
      • You can use RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
    3. You should use closeConnection(String addr) to close it if you want.

    Parameters:
    addr -
    request -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException
    InterruptedException

    invokeWithCallback

    public void invokeWithCallback(String addr,
                                   Object request,
                                   InvokeContext invokeContext,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException,
                                   InterruptedException
    Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(String, Object, InvokeCallback, int)

    Parameters:
    addr -
    request -
    invokeContext -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException
    InterruptedException

    invokeWithCallback

    public void invokeWithCallback(Url url,
                                   Object request,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException,
                                   InterruptedException
    Callback invocation using a parsed Url
    You can specify an implementation of InvokeCallback to get the result.

    Notice:

    1. DO NOT modify the request object concurrently when this method is called.
    2. When do invocation, use the parsed Url to find a available connection, if none then create one.
    3. You should use closeConnection(Url url) to close it if you want.

    Parameters:
    url -
    request -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException
    InterruptedException

    invokeWithCallback

    public void invokeWithCallback(Url url,
                                   Object request,
                                   InvokeContext invokeContext,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException,
                                   InterruptedException
    Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(Url, Object, InvokeCallback, int)

    Parameters:
    url -
    request -
    invokeContext -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException
    InterruptedException

    invokeWithCallback

    public void invokeWithCallback(Connection conn,
                                   Object request,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException
    Callback invocation using a Connection
    You can specify an implementation of InvokeCallback to get the result.

    Notice:
    DO NOT modify the request object concurrently when this method is called.

    Parameters:
    conn -
    request -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException

    invokeWithCallback

    public void invokeWithCallback(Connection conn,
                                   Object request,
                                   InvokeContext invokeContext,
                                   InvokeCallback invokeCallback,
                                   int timeoutMillis)
                            throws RemotingException
    Callback invocation with a InvokeContext, common api notice please see invokeWithCallback(Connection, Object, InvokeCallback, int)

    Parameters:
    conn -
    request -
    invokeContext -
    invokeCallback -
    timeoutMillis -
    Throws:
    RemotingException

    addConnectionEventProcessor

    public void addConnectionEventProcessor(ConnectionEventType type,
                                            ConnectionEventProcessor processor)
    Add processor to process connection event.

    Parameters:
    type -
    processor -

    registerUserProcessor

    public void registerUserProcessor(UserProcessor<?> processor)
    Register user processor for client side.

    Parameters:
    processor -
    Throws:
    RemotingException

    createStandaloneConnection

    public Connection createStandaloneConnection(String ip,
                                                 int port,
                                                 int connectTimeout)
                                          throws RemotingException
    Create a stand alone connection using ip and port.

    Notice:

  • Each time you call this method, will create a new connection.
  • Bolt will not control this connection.
  • You should use closeStandaloneConnection(com.alipay.remoting.Connection) to close it.

    Parameters:
    ip -
    port -
    connectTimeout -
    Returns:
    Throws:
    RemotingException

  • createStandaloneConnection

    public Connection createStandaloneConnection(String addr,
                                                 int connectTimeout)
                                          throws RemotingException
    Create a stand alone connection using address, address format example - 127.0.0.1:12200

    Notice:

    1. Each time you can this method, will create a new connection.
    2. Bolt will not control this connection.
    3. You should use closeStandaloneConnection(com.alipay.remoting.Connection) to close it.

    Parameters:
    addr -
    connectTimeout -
    Returns:
    Throws:
    RemotingException

    closeStandaloneConnection

    public void closeStandaloneConnection(Connection conn)
    Close a standalone connection

    Parameters:
    conn -

    getConnection

    public Connection getConnection(String addr,
                                    int connectTimeout)
                             throws RemotingException,
                                    InterruptedException
    Get a connection using address, address format example - 127.0.0.1:12200?key1=value1&key2=value2

    Notice:

    1. Get a connection, if none then create.
      • You can use RpcConfigs.CONNECT_TIMEOUT_KEY to specify connection timeout, time unit is milliseconds, e.g [127.0.0.1:12200?_CONNECTTIMEOUT=3000]
      • You can use RpcConfigs.CONNECTION_NUM_KEY to specify connection number for each ip and port, e.g [127.0.0.1:12200?_CONNECTIONNUM=30]
      • You can use RpcConfigs.CONNECTION_WARMUP_KEY to specify whether need warmup all connections for the first time you call this method, e.g [127.0.0.1:12200?_CONNECTIONWARMUP=false]
    2. Bolt will control this connection in ConnectionPool
    3. You should use closeConnection(String addr) to close it.

    Parameters:
    addr -
    connectTimeout - this is prior to url args RpcConfigs.CONNECT_TIMEOUT_KEY
    Returns:
    Throws:
    RemotingException
    InterruptedException

    getConnection

    public Connection getConnection(Url url,
                                    int connectTimeout)
                             throws RemotingException,
                                    InterruptedException
    Get a connection using a Url.

    Notice:

    1. Get a connection, if none then create.
    2. Bolt will control this connection in ConnectionPool
    3. You should use closeConnection(Url url) to close it.

    Parameters:
    url -
    connectTimeout - this is prior to url args RpcConfigs.CONNECT_TIMEOUT_KEY
    Returns:
    Throws:
    RemotingException
    InterruptedException

    getAllManagedConnections

    public Map<String,List<Connection>> getAllManagedConnections()
    get all connections managed by rpc client

    Returns:
    map key is ip+port, value is a list of connections of this key.

    checkConnection

    public boolean checkConnection(String addr)
    check connection, the address format example - 127.0.0.1:12200?key1=value1&key2=value2

    Parameters:
    addr -
    Returns:
    true if and only if there is a connection, and the connection is active and writable;else return false
    Throws:
    RemotingException

    closeConnection

    public void closeConnection(String addr)
    Close all connections of a address

    Parameters:
    addr -

    closeConnection

    public void closeConnection(Url url)
    Close all connections of a Url

    Parameters:
    url -

    enableConnHeartbeat

    public void enableConnHeartbeat(String addr)
    Enable heart beat for a certain connection. If this address not connected, then do nothing.

    Notice: this method takes no effect on a stand alone connection.

    Parameters:
    addr -

    enableConnHeartbeat

    public void enableConnHeartbeat(Url url)
    Enable heart beat for a certain connection. If this Url not connected, then do nothing.

    Notice: this method takes no effect on a stand alone connection.

    Parameters:
    url -

    disableConnHeartbeat

    public void disableConnHeartbeat(String addr)
    Disable heart beat for a certain connection. If this addr not connected, then do nothing.

    Notice: this method takes no effect on a stand alone connection.

    Parameters:
    addr -

    disableConnHeartbeat

    public void disableConnHeartbeat(Url url)
    Disable heart beat for a certain connection. If this Url not connected, then do nothing.

    Notice: this method takes no effect on a stand alone connection.

    Parameters:
    url -

    enableReconnectSwitch

    public void enableReconnectSwitch()
    enable connection reconnect switch on

    Notice: This api should be called before init()


    isReconnectSwitchOn

    public boolean isReconnectSwitchOn()
    is reconnect switch on

    Returns:

    enableConnectionMonitorSwitch

    public void enableConnectionMonitorSwitch()
    enable connection monitor switch on


    isConnectionMonitorSwitchOn

    public boolean isConnectionMonitorSwitchOn()
    is connection monitor switch on

    Returns:

    getConnectionManager

    protected DefaultConnectionManager getConnectionManager()

    getAddressParser

    public RemotingAddressParser getAddressParser()
    Getter method for property addressParser.

    Returns:
    property value of addressParser

    setAddressParser

    public void setAddressParser(RemotingAddressParser addressParser)
    Setter method for property addressParser.

    Parameters:
    addressParser - value to be assigned to property addressParser

    setMonitorStrategy

    public void setMonitorStrategy(ConnectionMonitorStrategy monitorStrategy)
    Setter method for property monitorStrategy.

    Parameters:
    monitorStrategy - value to be assigned to property monitorStrategy


    Copyright © 2018. All rights reserved.