/** * Loads all grid configurations specified within given Spring XML configuration file. * <p> * Usually Spring XML configuration file will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration file by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgUrl Spring XML configuration file path or URL. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException If grid could not be started or configuration * read. This exception will be thrown also if grid with given name has already * been started or Spring XML configuration file is invalid. */ public static IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(URL springCfgUrl) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgUrl); }
cmp = IgniteComponentType.HADOOP.create(ctx, true);
/** * Loads all grid configurations specified within given input stream. * <p> * Usually Spring XML input stream will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgStream Input stream contained Spring XML configuration. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException If grid could not be started or configuration * read. This exception will be thrown also if grid with given name has already * been started or Spring XML configuration file is invalid. */ public static IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(InputStream springCfgStream) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgStream); }
cmp = IgniteComponentType.HADOOP.create(ctx, true);
/** * Loads bean from Spring ApplicationContext. * * @param appCtx Application context. * @param beanName Bean name to load. * @return Loaded bean. */ private Object loadSpringContextBean(Object appCtx, String beanName) { try { IgniteSpringHelper spring = IgniteComponentType.SPRING.create(false); return spring.loadBeanFromAppContext(appCtx, beanName); } catch (Exception e) { throw new IgniteException("Failed to load bean in application context [beanName=" + beanName + ", igniteConfig=" + appCtx + ']', e); } } }
/** * Loads spring bean by name. * * @param springXmlUrl Spring XML file URL. * @param beanName Bean name. * @return Bean instance. * @throws IgniteCheckedException In case of error. */ public static <T> T loadSpringBean(URL springXmlUrl, String beanName) throws IgniteCheckedException { A.notNull(springXmlUrl, "springXmlUrl"); A.notNull(beanName, "beanName"); IgniteSpringHelper spring = SPRING.create(false); return spring.loadBean(springXmlUrl, beanName); }
/** * Loads spring bean by name. * * @param springXmlStream Input stream containing Spring XML configuration. * @param beanName Bean name. * @return Bean instance. * @throws IgniteCheckedException In case of error. */ public static <T> T loadSpringBean(InputStream springXmlStream, String beanName) throws IgniteCheckedException { A.notNull(springXmlStream, "springXmlPath"); A.notNull(beanName, "beanName"); IgniteSpringHelper spring = SPRING.create(false); return spring.loadBean(springXmlStream, beanName); }
IgniteSshHelper sshHelper = IgniteComponentType.SSH.create(false);
); IgniteSpringHelper spring = SPRING.create(false);
IgniteSpringHelper spring = IgniteComponentType.SPRING.create(false);
/** {@inheritDoc} */ @Override public CacheJdbcBlobStore<K, V> create() { CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>(); store.setInitSchema(initSchema); store.setConnectionUrl(connUrl); store.setCreateTableQuery(createTblQry); store.setLoadQuery(loadQry); store.setUpdateQuery(updateQry); store.setInsertQuery(insertQry); store.setDeleteQuery(delQry); store.setUser(user); store.setPassword(passwd); if (dataSrc != null) store.setDataSource(dataSrc); else if (dataSrcBean != null) { if (appCtx == null) throw new IgniteException("Spring application context resource is not injected."); IgniteSpringHelper spring; try { spring = IgniteComponentType.SPRING.create(false); DataSource data = spring.loadBeanFromAppContext(appCtx, dataSrcBean); store.setDataSource(data); } catch (IgniteCheckedException ignored) { throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean + ", igniteConfig=" + appCtx + ']'); } } return store; }
spring = IgniteComponentType.SPRING.create(false);
spring = SPRING.create(false);
/** * Loads all grid configurations specified within given input stream. * <p> * Usually Spring XML input stream will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration input stream by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgStream Input stream contained Spring XML configuration. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException If grid could not be started or configuration * read. This exception will be thrown also if grid with given name has already * been started or Spring XML configuration file is invalid. */ public static IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(InputStream springCfgStream) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgStream); }
/** * Loads all grid configurations specified within given Spring XML configuration file. * <p> * Usually Spring XML configuration file will contain only one Grid definition. Note that * Grid configuration bean(s) is retrieved form configuration file by type, so the name of * the Grid configuration bean is ignored. * * @param springCfgUrl Spring XML configuration file path or URL. This cannot be {@code null}. * @return Tuple containing all loaded configurations and Spring context used to load them. * @throws IgniteCheckedException If grid could not be started or configuration * read. This exception will be thrown also if grid with given name has already * been started or Spring XML configuration file is invalid. */ public static IgniteBiTuple<Collection<IgniteConfiguration>, ? extends GridSpringResourceContext> loadConfigurations(URL springCfgUrl) throws IgniteCheckedException { IgniteSpringHelper spring = SPRING.create(false); return spring.loadConfigurations(springCfgUrl); }
/** * Loads spring bean by name. * * @param springXmlUrl Spring XML file URL. * @param beanName Bean name. * @return Bean instance. * @throws IgniteCheckedException In case of error. */ public static <T> T loadSpringBean(URL springXmlUrl, String beanName) throws IgniteCheckedException { A.notNull(springXmlUrl, "springXmlUrl"); A.notNull(beanName, "beanName"); IgniteSpringHelper spring = SPRING.create(false); return spring.loadBean(springXmlUrl, beanName); }
/** * Loads spring bean by name. * * @param springXmlStream Input stream containing Spring XML configuration. * @param beanName Bean name. * @return Bean instance. * @throws IgniteCheckedException In case of error. */ public static <T> T loadSpringBean(InputStream springXmlStream, String beanName) throws IgniteCheckedException { A.notNull(springXmlStream, "springXmlPath"); A.notNull(beanName, "beanName"); IgniteSpringHelper spring = SPRING.create(false); return spring.loadBean(springXmlStream, beanName); }
); IgniteSpringHelper spring = SPRING.create(false);
/** {@inheritDoc} */ @Override public CacheJdbcBlobStore<K, V> create() { CacheJdbcBlobStore<K, V> store = new CacheJdbcBlobStore<>(); store.setInitSchema(initSchema); store.setConnectionUrl(connUrl); store.setCreateTableQuery(createTblQry); store.setLoadQuery(loadQry); store.setUpdateQuery(updateQry); store.setInsertQuery(insertQry); store.setDeleteQuery(delQry); store.setUser(user); store.setPassword(passwd); if (dataSrc != null) store.setDataSource(dataSrc); else if (dataSrcBean != null) { if (appCtx == null) throw new IgniteException("Spring application context resource is not injected."); IgniteSpringHelper spring; try { spring = IgniteComponentType.SPRING.create(false); DataSource data = spring.loadBeanFromAppContext(appCtx, dataSrcBean); store.setDataSource(data); } catch (IgniteCheckedException ignored) { throw new IgniteException("Failed to load bean in application context [beanName=" + dataSrcBean + ", igniteConfig=" + appCtx + ']'); } } return store; }
spring = IgniteComponentType.SPRING.create(false);