Search in sources :

Example 6 with App

use of rpc.turbo.transport.client.App in project turbo-rpc by hank-whu.

the class TurboClient method addConnect.

/**
 * 手动建立连接
 *
 * @param group
 * @param hostPorts
 */
public void addConnect(String group, String app, HostPort... hostPorts) {
    Objects.requireNonNull(group, "group");
    Objects.requireNonNull(app, "app");
    Objects.requireNonNull(hostPorts, "hostPorts");
    try {
        AppConfig appConfig = new AppConfig();
        appConfig.setGroup(group);
        appConfig.setApp(app);
        App _app = new App(eventLoopGroup, appConfig, filters);
        _app.setConnect(hostPorts);
        appMap.put(_app, Boolean.TRUE);
    } catch (Exception e) {
        throw new RemoteException(e);
    }
}
Also used : App(rpc.turbo.transport.client.App) AppConfig(rpc.turbo.config.client.AppConfig) RemoteException(rpc.turbo.remote.RemoteException) IOException(java.io.IOException) RemoteException(rpc.turbo.remote.RemoteException)

Aggregations

IOException (java.io.IOException)6 App (rpc.turbo.transport.client.App)6 RemoteException (rpc.turbo.remote.RemoteException)5 Closeable (java.io.Closeable)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 Log (org.apache.commons.logging.Log)3 LogFactory (org.apache.commons.logging.LogFactory)3 AppConfig (rpc.turbo.config.client.AppConfig)3 FailoverInvokerFactory (rpc.turbo.invoke.FailoverInvokerFactory)3 InvokerUtils (rpc.turbo.invoke.InvokerUtils)3 RemoteInterface (rpc.turbo.remote.RemoteInterface)3 EventLoopGroup (io.netty.channel.EventLoopGroup)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 EventLoopGroupHolder (rpc.turbo.common.EventLoopGroupHolder)2 HostPort (rpc.turbo.config.HostPort)2 ClientConfig (rpc.turbo.config.client.ClientConfig)2 RpcClientFilter (rpc.turbo.filter.RpcClientFilter)2 RemoteServiceFactory (rpc.turbo.remote.RemoteServiceFactory)2