com.alipay.remoting.rpc
Class RpcConnectionFactory

java.lang.Object
  extended by com.alipay.remoting.rpc.RpcConnectionFactory
All Implemented Interfaces:
ConnectionFactory

public class RpcConnectionFactory
extends Object
implements ConnectionFactory

Rpc connection factory, create rpc connections. And generate user triggered event.


Constructor Summary
RpcConnectionFactory()
           
 
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
protected  io.netty.channel.ChannelFuture doCreateConnection(String targetIP, int targetPort, int connectTimeout)
           
 void init(ConnectionEventHandler connectionEventHandler)
          Initialize the factory.
 void registerUserProcessor(UserProcessor<?> processor)
          Register User processor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcConnectionFactory

public RpcConnectionFactory()
Method Detail

init

public void init(ConnectionEventHandler connectionEventHandler)
Description copied from interface: ConnectionFactory
Initialize the factory.

Specified by:
init in interface ConnectionFactory
See Also:
ConnectionFactory.init(ConnectionEventHandler)

createConnection

public Connection createConnection(Url url)
                            throws Exception
Description copied from interface: ConnectionFactory
Create a connection use #BoltUrl

Specified by:
createConnection in interface ConnectionFactory
Returns:
Throws:
Exception
See Also:
ConnectionFactory.createConnection(com.alipay.remoting.Url)

createConnection

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

Specified by:
createConnection in interface ConnectionFactory
Returns:
Throws:
Exception
See Also:
ConnectionFactory.createConnection(java.lang.String, int, int)

createConnection

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

Specified by:
createConnection in interface ConnectionFactory
Returns:
Throws:
Exception
See Also:
ConnectionFactory.createConnection(String, int, byte, int)

doCreateConnection

protected io.netty.channel.ChannelFuture doCreateConnection(String targetIP,
                                                            int targetPort,
                                                            int connectTimeout)
                                                     throws Exception
Parameters:
targetIP -
targetPort -
connectTimeout -
Returns:
Throws:
Exception

registerUserProcessor

public void registerUserProcessor(UserProcessor<?> processor)
Description copied from interface: ConnectionFactory
Register User processor

Specified by:
registerUserProcessor in interface ConnectionFactory
See Also:
ConnectionFactory.registerUserProcessor(com.alipay.remoting.rpc.protocol.UserProcessor)


Copyright © 2018. All rights reserved.