/** * Calls given {@code side-effect only} closure over the each element of the provided array. * * @param c Array to call closure over. * @param f Side-effect only closure to call over the array. * @param p Optional set of predicates. Only if collection element evaluates * to {@code true} for given predicates the closure will be applied to it. * If no predicates provided - closure will be applied to all collection * elements. * @param <X> Type of the free variable for the closure and type of the array * elements. */ @SuppressWarnings("RedundantTypeArguments") public static <X> void forEach(X[] c, GridInClosure<? super X> f, @Nullable GridPredicate<? super X>... p) { A.notNull(c, "c", f, "f"); F.<X>forEach(asList(c), f, p); }
/** {@inheritDoc} */ @Override public void undeploy(GridDeployment dep) { lock.writeLock().lock(); try { GridInClosure<Map<Class<?>, Map<String, CachedResource>>> x = new CI1<Map<Class<?>, Map<String, CachedResource>>>() { @Override public void apply(Map<Class<?>, Map<String, CachedResource>> map) { if (map != null) { for (Map<String, CachedResource> m : map.values()) { if (m != null) undeploy(m.values()); } } } }; Map<Class<?>, Map<String, CachedResource>> map = dep.removeMeta(CLS_LDR_RSRC_CACHE); x.apply(map); Map<Class<?>, Map<Class<?>, Map<String, CachedResource>>> clsRsrcs = dep.removeMeta(CLS_RSRC_CACHE); if (clsRsrcs != null) F.forEach(clsRsrcs.values(), x); } finally { lock.writeLock().unlock(); } }
F.forEach(gridCfg.getCacheConfiguration(), new CI1<GridCacheConfiguration>() { @Override public void apply(GridCacheConfiguration c) { cacheCfgs.put(c.getName(), c);
F.forEach(gridCfg.getCacheConfiguration(), new CI1<GridCacheConfiguration>() { @Override public void apply(GridCacheConfiguration c) { cacheCfgs.put(c.getName(), c);