Search in sources :

Example 6 with RemoteException

use of rpc.turbo.remote.RemoteException in project turbo-rpc by hank-whu.

the class TurboClient method addConnect.

public void addConnect(AppConfig appConfig) {
    Objects.requireNonNull(appConfig, "appConfig");
    try {
        App _app = new App(eventLoopGroup, appConfig, filters);
        appMap.put(_app, Boolean.TRUE);
    } catch (Exception e) {
        throw new RemoteException(e);
    }
}
Also used : App(rpc.turbo.transport.client.App) RemoteException(rpc.turbo.remote.RemoteException) IOException(java.io.IOException) RemoteException(rpc.turbo.remote.RemoteException)

Example 7 with RemoteException

use of rpc.turbo.remote.RemoteException 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)7 RemoteException (rpc.turbo.remote.RemoteException)7 App (rpc.turbo.transport.client.App)5 AppConfig (rpc.turbo.config.client.AppConfig)3 RemoteInterface (rpc.turbo.remote.RemoteInterface)3 EventLoopGroup (io.netty.channel.EventLoopGroup)2 Closeable (java.io.Closeable)2 Objects (java.util.Objects)2 Optional (java.util.Optional)2 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 Log (org.apache.commons.logging.Log)2 LogFactory (org.apache.commons.logging.LogFactory)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 FailoverInvokerFactory (rpc.turbo.invoke.FailoverInvokerFactory)2 InvokerUtils (rpc.turbo.invoke.InvokerUtils)2 RemoteServiceFactory (rpc.turbo.remote.RemoteServiceFactory)2