.map(fn -> fn.apply(conf, binder, registryRef)) .collect(Collectors.toList()); securityRoutes.forEach(it -> clientList.add(it.client));
conf.getString("couchbase.cluster.username"), conf.getString("couchbase.cluster.password")); bind.apply(ClusterManager.class, dbname, clusterManager); log.debug(" bucket opened: {}", name); bind.apply(Bucket.class, name, bucket); AsyncBucket async = bucket.async(); bind.apply(AsyncBucket.class, name, async); bind.apply(Repository.class, name, repo); bind.apply(AsyncRepository.class, name, asyncrepo); bind.apply(AsyncDatastore.class, name, asyncds); bind.apply(Datastore.class, name, new DatastoreImpl(asyncds)); bind.apply(Bucket.class, "session", cluster.openBucket(session, password.apply(session)));
LocalTimeCodec.instance); hierarchy(cluster.getClass(), type -> bind.apply(type, cstr.keyspace(), cluster)); hierarchy(session.getClass(), type -> bind.apply(type, cstr.keyspace(), session)); bind.apply(MappingManager.class, cstr.keyspace(), manager); bind.apply(Datastore.class, cstr.keyspace(), new Datastore(manager));
public <V> Value<V> apply(Throwing.Function3<R1, R2, R3, V> fn) { return Try.apply(() -> { try (R1 r1 = this.r1.get(); R2 r2 = this.r2.get(); R3 r3 = this.r3.get()) { return fn.apply(r1, r2, r3); } }); }
@Override public void handle(final Request req, final Response rsp, final Chain chain) throws Throwable { Object input = supplier.apply(req, rsp, chain); Object output = Try .apply(() -> mapper.map(input)) .recover(ClassCastException.class, input) .get(); rsp.send(output); chain.next(req, rsp); }
LocalTimeCodec.instance); hierarchy(cluster.getClass(), type -> bind.apply(type, cstr.keyspace(), cluster)); hierarchy(session.getClass(), type -> bind.apply(type, cstr.keyspace(), session)); bind.apply(MappingManager.class, cstr.keyspace(), manager); bind.apply(Datastore.class, cstr.keyspace(), new Datastore(manager));
@Override public void handle(final Request req, final Response rsp, final Chain chain) throws Throwable { Object input = supplier.apply(req, rsp, chain); Object output = Try .apply(() -> mapper.map(input)) .recover(ClassCastException.class, input) .get(); rsp.send(output); chain.next(req, rsp); }