/** * @param topic User topic. * @param predLsnr Predicate listener. * @throws GridException If failed to inject resources to predicates. */ GridUserMessageListener(@Nullable Object topic, @Nullable GridBiPredicate<UUID, Object> predLsnr) throws GridException { this.topic = topic; this.predLsnr = predLsnr; if (predLsnr != null) ctx.resource().injectGeneric(predLsnr); }
/** * Injects resources into streamer components. * * @throws GridException If failed. */ private void prepareResources() throws GridException { for (GridStreamerStage s : c.getStages()) ctx.resource().injectGeneric(s); if (router == null) router = new GridStreamerLocalEventRouter(); ctx.resource().injectGeneric(router); for (GridStreamerWindow w : c.getWindows()) ctx.resource().injectGeneric(w); }
/** * @param spi SPI whose internal objects need to be injected. * @throws GridException If injection failed. */ private void inject(GridSpi spi) throws GridException { if (spi instanceof GridSpiAdapter) { Collection<Object> injectables = ((GridSpiAdapter)spi).injectables(); if (!F.isEmpty(injectables)) for (Object o : injectables) ctx.resource().injectGeneric(o); } }
/** * @param cfg Cache configuration. * @param rsrc Resource. * @param near Near flag. * @throws GridException If failed. */ private void prepare(GridCacheConfiguration cfg, @Nullable Object rsrc, boolean near) throws GridException { if (rsrc != null) { ctx.resource().injectGeneric(rsrc); ctx.resource().injectCacheName(rsrc, cfg.getName()); registerMbean(rsrc, cfg.getName(), near); } }
ctx.resource().injectGeneric(cb); ctx.resource().injectGeneric(filter);
ctx.resource().injectGeneric(cb); ctx.resource().injectGeneric(filter);
ggfsCtx.kernalContext().resource().injectGeneric(srvEndpoint);
ggfsCtx.kernalContext().resource().injectGeneric(srvEndpoint);