當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。