当前位置: 首页>>代码示例>>Java>>正文


Java DependsOn类代码示例

本文整理汇总了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;
}
 
开发者ID:xm-online,项目名称:xm-uaa,代码行数:22,代码来源:DatabaseConfiguration.java

示例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;
}
 
开发者ID:xm-online,项目名称:xm-ms-balance,代码行数:21,代码来源:DatabaseConfiguration.java

示例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;
}
 
开发者ID:wanghongfei,项目名称:shiro-spring-boot-starter,代码行数:22,代码来源:ShiroAutoConfiguration.java

示例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;
}
 
开发者ID:storezhang,项目名称:utils,代码行数:26,代码来源:ShiroAutoConfiguration.java

示例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();
  }
 
开发者ID:amoldavsky,项目名称:restful-api-cxf-spring-java,代码行数:27,代码来源:CxfConfig.java

示例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;
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:17,代码来源:JPAConfig.java

示例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;
}
 
开发者ID:YihuaWanglv,项目名称:spring-boot-jta-atomikos-sample,代码行数:18,代码来源:CustomerConfig.java

示例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);
}
 
开发者ID:ctco,项目名称:cukes,代码行数:24,代码来源:RabbitMQConfiguration.java

示例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;
}
 
开发者ID:connect-group,项目名称:thymeleaf-tdd,代码行数:21,代码来源:ThymesheetConfig.java

示例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");
}
 
开发者ID:jaibeermalik,项目名称:searchanalytics-bigdata,代码行数:19,代码来源:AppConfiguration.java

示例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;
}
 
开发者ID:krizsan,项目名称:message-cowboy,代码行数:25,代码来源:PersistenceConfiguration.java

示例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;
}
 
开发者ID:martinlau,项目名称:unidle-old,代码行数:27,代码来源:DataConfiguration.java


注:本文中的org.springframework.context.annotation.DependsOn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。