本文整理匯總了Java中org.springframework.context.annotation.DependsOn類的典型用法代碼示例。如果您正苦於以下問題:Java DependsOn類的具體用法?Java DependsOn怎麽用?Java DependsOn使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DependsOn類屬於org.springframework.context.annotation包,在下文中一共展示了DependsOn類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: multiTenantLiquibase
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn("liquibase")
public MultiTenantSpringLiquibase multiTenantLiquibase(
DataSource dataSource,
LiquibaseProperties liquibaseProperties) {
MultiTenantSpringLiquibase liquibase = new XmMultiTenantSpringLiquibase();
liquibase.setDataSource(dataSource);
liquibase.setChangeLog(CHANGE_LOG_PATH);
liquibase.setContexts(liquibaseProperties.getContexts());
liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema());
liquibase.setDropFirst(liquibaseProperties.isDropFirst());
liquibase.setSchemas(getSchemas());
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) {
liquibase.setShouldRun(false);
} else {
liquibase.setShouldRun(liquibaseProperties.isEnabled());
log.debug("Configuring Liquibase");
}
liquibase.setParameters(DatabaseUtil.defaultParams(liquibaseProperties.getDefaultSchema()));
return liquibase;
}
示例2: multiTenantLiquibase
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn("liquibase")
public MultiTenantSpringLiquibase multiTenantLiquibase(
DataSource dataSource,
LiquibaseProperties liquibaseProperties) {
MultiTenantSpringLiquibase liquibase = new XmMultiTenantSpringLiquibase();
liquibase.setDataSource(dataSource);
liquibase.setChangeLog(CHANGE_LOG_PATH);
liquibase.setContexts(liquibaseProperties.getContexts());
liquibase.setDefaultSchema(liquibaseProperties.getDefaultSchema());
liquibase.setDropFirst(liquibaseProperties.isDropFirst());
liquibase.setSchemas(getSchemas());
if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_NO_LIQUIBASE)) {
liquibase.setShouldRun(false);
} else {
liquibase.setShouldRun(liquibaseProperties.isEnabled());
log.debug("Configuring Liquibase");
}
return liquibase;
}
示例3: organizationId
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(initMethod = "block")
@DependsOn("cloudFoundryCleaner")
Mono<String> organizationId(CloudFoundryClient cloudFoundryClient, String organizationName) throws InterruptedException {
return PaginationUtils
.requestClientV2Resources(page -> cloudFoundryClient.organizations()
.list(ListOrganizationsRequest.builder()
.name(organizationName)
.page(page)
.build()))
.map(ResourceUtils::getId)
.single()
.doOnSubscribe(s -> this.logger.debug(">> ORGANIZATION name({}) <<", organizationName))
.doOnError(Throwable::printStackTrace)
.doOnSuccess(id -> this.logger.debug("<< ORGANIZATION id({}) >>", id))
.cache();
}
開發者ID:orange-cloudfoundry,項目名稱:sec-group-broker-filter,代碼行數:17,代碼來源:IntegrationTestConfiguration.java
示例4: spaceId
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(initMethod = "block")
@DependsOn("cloudFoundryCleaner")
Mono<String> spaceId(CloudFoundryClient cloudFoundryClient, Mono<String> organizationId, String spaceName, String userName) throws InterruptedException {
return organizationId
.then(orgId -> cloudFoundryClient.spaces()
.create(CreateSpaceRequest.builder()
.name(spaceName)
.organizationId(orgId)
.build()))
.map(ResourceUtils::getId)
.as(thenKeep(spaceId1 -> cloudFoundryClient.spaces()
.associateDeveloperByUsername(AssociateSpaceDeveloperByUsernameRequest.builder()
.username(userName)
.spaceId(spaceId1)
.build())))
.doOnSubscribe(s -> this.logger.debug(">> SPACE name({}) <<", spaceName))
.doOnError(Throwable::printStackTrace)
.doOnSuccess(id -> this.logger.debug("<< SPACE id({}) >>", id))
.cache();
}
開發者ID:orange-cloudfoundry,項目名稱:sec-group-broker-filter,代碼行數:21,代碼來源:IntegrationTestConfiguration.java
示例5: getShiroFilterFactoryBean
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(name = "shiroFilter")
@DependsOn("securityManager")
@ConditionalOnMissingBean
public ShiroFilterFactoryBean getShiroFilterFactoryBean(DefaultSecurityManager securityManager, Realm realm, ShiroFilterRegistry registry) {
securityManager.setRealm(realm);
Map<String, String> filterDef = swapKeyValue(properties.getFilterChainDefinitions());
log.info("過慮器配置: {}", filterDef);
log.info("自定義過慮器: {}", registry.getFilterMap());
ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean();
shiroFilter.setSecurityManager(securityManager);
shiroFilter.setLoginUrl(properties.getLoginUrl());
shiroFilter.setSuccessUrl(properties.getSuccessUrl());
shiroFilter.setUnauthorizedUrl(properties.getUnauthorizedUrl());
shiroFilter.setFilterChainDefinitionMap(filterDef);
shiroFilter.getFilters().putAll(registry.getFilterMap());
return shiroFilter;
}
示例6: jdbcRealm
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(name = "mainRealm")
@ConditionalOnMissingBean(name = "mainRealm")
@ConditionalOnProperty(prefix = "shiro.realm.jdbc", name = "enabled", havingValue = "true")
@DependsOn(value = {"dataSource", "lifecycleBeanPostProcessor", "credentialsMatcher"})
public Realm jdbcRealm(DataSource dataSource, CredentialsMatcher credentialsMatcher) {
JdbcRealm realm = new JdbcRealm();
if (shiroJdbcRealmProperties.getAuthenticationQuery() != null) {
realm.setAuthenticationQuery(shiroJdbcRealmProperties.getAuthenticationQuery());
}
if (shiroJdbcRealmProperties.getUserRolesQuery() != null) {
realm.setUserRolesQuery(shiroJdbcRealmProperties.getUserRolesQuery());
}
if (shiroJdbcRealmProperties.getPermissionsQuery() != null) {
realm.setPermissionsQuery(shiroJdbcRealmProperties.getPermissionsQuery());
}
if (shiroJdbcRealmProperties.getSalt() != null) {
realm.setSaltStyle(shiroJdbcRealmProperties.getSalt());
}
realm.setPermissionsLookupEnabled(shiroJdbcRealmProperties.isPermissionsLookupEnabled());
realm.setDataSource(dataSource);
realm.setCredentialsMatcher(credentialsMatcher);
return realm;
}
示例7: jaxRsServer
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn("cxf")
public Server jaxRsServer() {
JAXRSServerFactoryBean serverFactory = RuntimeDelegate.getInstance().createEndpoint(jaxRsApiApplication(), JAXRSServerFactoryBean.class);
//factory.setServiceBean(new DenialCategoryRest());
// get all the class annotated with @JaxrsService
List<Object> beans = configUtil.findBeans( JaxrsService.class );
if (beans.size() > 0) {
// add all the CXF service classes into the CXF stack
serverFactory.setServiceBeans( beans );
serverFactory.setAddress("/"+ serverFactory.getAddress());
serverFactory.setBus(springBus);
serverFactory.setStart(true);
// set JSON as the response serializer
JacksonJsonProvider provider = new JacksonJsonProvider();
serverFactory.setProvider(provider);
}
return serverFactory.create();
}
示例8: serverEntityManagerFactory
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(name = "entityManagerFactory")
@DependsOn("flyway")
@Profile("sqlDb")
public LocalContainerEntityManagerFactoryBean serverEntityManagerFactory(DataSource dataSource,
JpaVendorAdapter vendorAdapter,
LoadTimeWeaver loadTimeWeaver,
Properties hibernateProperties) {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource);
em.setJpaVendorAdapter(vendorAdapter);
em.setLoadTimeWeaver(loadTimeWeaver);
em.setJpaProperties(hibernateProperties);
em.setPackagesToScan(ENTITIES_PACKAGE);
return em;
}
示例9: customerEntityManager
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Primary
@Bean(name = "customerEntityManager")
@DependsOn("transactionManager")
public LocalContainerEntityManagerFactoryBean customerEntityManager() throws Throwable {
HashMap<String, Object> properties = new HashMap<String, Object>();
properties.put("hibernate.transaction.jta.platform", AtomikosJtaPlatform.class.getName());
properties.put("javax.persistence.transactionType", "JTA");
LocalContainerEntityManagerFactoryBean entityManager = new LocalContainerEntityManagerFactoryBean();
entityManager.setJtaDataSource(customerDataSource());
entityManager.setJpaVendorAdapter(jpaVendorAdapter);
entityManager.setPackagesToScan("com.iyihua.sample.domain.customer");
entityManager.setPersistenceUnitName("customerPersistenceUnit");
entityManager.setJpaPropertyMap(properties);
return entityManager;
}
示例10: connectionFactory
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn("amqpBroker")
CachingConnectionFactory connectionFactory() {
log.info("Creating connection factory for MQ broker...");
ConnectionFactory cf = new ConnectionFactory();
cf.setHost(hostname);
cf.setPort(port);
cf.setUsername(userName);
cf.setPassword(password);
cf.setVirtualHost(virtualHost);
cf.setAutomaticRecoveryEnabled(false);
if (useSSL) {
try {
cf.useSslProtocol();
} catch (NoSuchAlgorithmException | KeyManagementException e) {
//TODO don't throw raw exceptions
throw new RuntimeException(e);
}
}
log.info("Connection factory created.");
return new CachingConnectionFactory(cf);
}
示例11: kickOff
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn(OUTBOUND_ID)
public CommandLineRunner kickOff(@Qualifier(OUTBOUND_ID + ".input") MessageChannel in) {
return args -> {
for (int i = 0; i < 100; i++) {
Address address = new Address(Locale.GERMANY.getDisplayCountry(), "Colonge", "50667", "Domkloster", "4");
Recipient recipient = new Recipient("Alexander", "Mustermann", address, address);
int amount = ThreadLocalRandom.current().nextInt(1, 15);
Order bestellung = new Order(amount, "movieId-" + i, recipient);
String bestellungAsJson = ow.writeValueAsString(bestellung);
in.send(new GenericMessage<String>(bestellungAsJson));
log.info("ordering movie with movieId-" + i + " " + bestellungAsJson);
Thread.sleep(5000);
}
};
}
開發者ID:codecentric,項目名稱:event-based-shopping-system,代碼行數:17,代碼來源:OrderEntryProducerConfiguration.java
示例12: testEngine
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn("propertyConfigurer")
public ThymeleafTestEngine testEngine() {
ThymeleafTestEngine engine = new ThymeleafTestEngine();
engine.setCacheManager(thymeleafCacheManager());
engine.setTemplateModeHandlers(templateModeHandlers());
engine.setAdditionalDialects(additionalDialects());
Set<ITemplateResolver> templateResolvers = new HashSet<ITemplateResolver>();
templateResolvers.add(servletContextTemplateResolver());
templateResolvers.add(fileTemplateResolver());
engine.setTemplateResolvers(templateResolvers);
engine.setServletContext(servletContext);
engine.setApplicationContext(applicationContext);
return engine;
}
示例13: setupIndexMasterActor
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean(autowire = Autowire.BY_NAME, name = "setupIndexMasterActor")
// @Scope("prototype")
@DependsOn(value = { "actorSystem" })
public ActorRef setupIndexMasterActor() {
final ActorSystem system = applicationContext
.getBean(ActorSystem.class);
final SetupIndexService setupIndexService = applicationContext
.getBean(SetupIndexService.class);
final SampleDataGeneratorService sampleDataGeneratorService = applicationContext
.getBean(SampleDataGeneratorService.class);
final IndexProductDataService indexProductData = applicationContext
.getBean(IndexProductDataService.class);
return system.actorOf(
Props.create(SetupIndexMasterActor.class, setupIndexService,
sampleDataGeneratorService, indexProductData)
.withDispatcher("setupIndexMasterActorDispatch"),
"setupIndexMasterActor");
}
示例14: entityManagerFactory
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
/**
* JPA entity manager factory bean.
* Depends on the hsqlDbServer bean, in order to create the embedded
* database, if one is to be used, before the entity manager factory.
*/
@Bean
@DependsOn("hsqlDbServer")
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
/* JPA entity manager factory. */
final LocalContainerEntityManagerFactoryBean theJpaEntityManagerFactory =
new LocalContainerEntityManagerFactoryBean();
theJpaEntityManagerFactory.setDataSource(dataSource());
theJpaEntityManagerFactory.setPersistenceUnitName("message-cowboy");
theJpaEntityManagerFactory.setJpaProperties(jpaProperties());
/* JPA vendor adapter. */
final EclipseLinkJpaVendorAdapter theJpaVendorAdapter =
new EclipseLinkJpaVendorAdapter();
theJpaVendorAdapter.setShowSql(true);
theJpaEntityManagerFactory.setJpaVendorAdapter(theJpaVendorAdapter);
return theJpaEntityManagerFactory;
}
示例15: entityManagerFactory
import org.springframework.context.annotation.DependsOn; //導入依賴的package包/類
@Bean
@DependsOn({"cacheManager",
"springLiquibase"})
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
jpaVendorAdapter.setDatabase(jpaVendorDatabase);
final Map<String, Object> jpaProperties = new LinkedHashMap<>();
jpaProperties.put("hibernate.cache.region.factory_class", hibernateEhcacheRegionFactoryClass);
jpaProperties.put("hibernate.cache.use_query_cache", hibernateUseQueryCache);
jpaProperties.put("hibernate.cache.use_second_level_cache", hibernateUseSecondLevelCache);
jpaProperties.put("hibernate.hbm2ddl.auto", hibernateHbm2ddl);
final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource());
entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);
entityManagerFactoryBean.setPackagesToScan("org.unidle.domain");
entityManagerFactoryBean.setJpaPropertyMap(jpaProperties);
entityManagerFactoryBean.setMappingResources("jpa/orm.xml");
return entityManagerFactoryBean;
}