Search in sources :

Example 1 with GridClientConnectionManagerOsImpl

use of org.apache.ignite.internal.client.impl.connection.GridClientConnectionManagerOsImpl in project ignite by apache.

the class GridClientImpl method createConnectionManager.

/**
     * @param clientId Client ID.
     * @param sslCtx SSL context to enable secured connection or {@code null} to use unsecured one.
     * @param cfg Client configuration.
     * @param routers Routers or empty collection to use endpoints from topology info.
     * @param top Topology.
     * @throws GridClientException In case of error.
     */
private GridClientConnectionManager createConnectionManager(UUID clientId, SSLContext sslCtx, GridClientConfiguration cfg, Collection<InetSocketAddress> routers, GridClientTopology top, @Nullable Byte marshId, boolean routerClient) throws GridClientException {
    GridClientConnectionManager mgr;
    try {
        Class<?> cls = Class.forName(ENT_CONN_MGR_CLS);
        Constructor<?> cons = cls.getConstructor(UUID.class, SSLContext.class, GridClientConfiguration.class, Collection.class, GridClientTopology.class, Byte.class, boolean.class);
        mgr = (GridClientConnectionManager) cons.newInstance(clientId, sslCtx, cfg, routers, top, marshId, routerClient);
    } catch (ClassNotFoundException ignored) {
        mgr = new GridClientConnectionManagerOsImpl(clientId, sslCtx, cfg, routers, top, marshId, routerClient);
    } catch (NoSuchMethodException | IllegalAccessException | InstantiationException | InvocationTargetException e) {
        throw new GridClientException("Failed to create client connection manager.", e);
    }
    return mgr;
}
Also used : GridClientException(org.apache.ignite.internal.client.GridClientException) GridClientConnectionManagerOsImpl(org.apache.ignite.internal.client.impl.connection.GridClientConnectionManagerOsImpl) GridClientConnectionManager(org.apache.ignite.internal.client.impl.connection.GridClientConnectionManager) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 GridClientException (org.apache.ignite.internal.client.GridClientException)1 GridClientConnectionManager (org.apache.ignite.internal.client.impl.connection.GridClientConnectionManager)1 GridClientConnectionManagerOsImpl (org.apache.ignite.internal.client.impl.connection.GridClientConnectionManagerOsImpl)1