com.alipay.remoting
Interface ConnectionFactory

All Known Implementing Classes:
RpcConnectionFactory

public interface ConnectionFactory

Factory that creates connections.


Method Summary
 Connection createConnection(String targetIP, int targetPort, byte version, int connectTimeout)
          Create a connection according to the IP and port.
 Connection createConnection(String targetIP, int targetPort, int connectTimeout)
          Create a connection according to the IP and port.
 Connection createConnection(Url url)
          Create a connection use #BoltUrl
 void init(ConnectionEventHandler connectionEventHandler)
          Initialize the factory.
 void registerUserProcessor(UserProcessor<?> processor)
          Register User processor
 

Method Detail

init

void init(ConnectionEventHandler connectionEventHandler)
Initialize the factory.


createConnection

Connection createConnection(Url url)
                            throws Exception
Create a connection use #BoltUrl

Parameters:
url -
Returns:
Throws:
Exception

createConnection

Connection createConnection(String targetIP,
                            int targetPort,
                            int connectTimeout)
                            throws Exception
Create a connection according to the IP and port. Note: The default protocol is RpcProtocol.

Parameters:
targetIP -
targetPort -
connectTimeout -
Returns:
Throws:
Exception

createConnection

Connection createConnection(String targetIP,
                            int targetPort,
                            byte version,
                            int connectTimeout)
                            throws Exception
Create a connection according to the IP and port. Note: The default protocol is RpcProtocolV2, and you can specify the version

Parameters:
targetIP -
targetPort -
version -
connectTimeout -
Returns:
Throws:
Exception

registerUserProcessor

void registerUserProcessor(UserProcessor<?> processor)
Register User processor

Parameters:
processor -


Copyright © 2018. All rights reserved.