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


Java Autowire.BY_TYPE属性代码示例

本文整理汇总了Java中org.springframework.beans.factory.annotation.Autowire.BY_TYPE属性的典型用法代码示例。如果您正苦于以下问题:Java Autowire.BY_TYPE属性的具体用法?Java Autowire.BY_TYPE怎么用?Java Autowire.BY_TYPE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.springframework.beans.factory.annotation.Autowire的用法示例。


在下文中一共展示了Autowire.BY_TYPE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: instance

@Bean(autowire = Autowire.BY_TYPE, name = "ctu.upns.groupRepository")
public GroupRepository instance() {

	if (repository != null) {
		return repository;
	}

	switch (type) {
		case "memory":
			repository = new MemGroupRepository();
		case "mongo":
			repository = new MongoGroupRepository();
	}

	Validate.notNull(repository, "invalid repository type:[%s]", type);
	return repository;
}
 
开发者ID:pippo1980,项目名称:upns,代码行数:17,代码来源:GroupRepositoryConfig.java

示例2: instance

@Bean(autowire = Autowire.BY_TYPE, name = "ctu.upns.deviceRepository")
public DeviceRepository instance() {

	if (repository != null) {
		return repository;
	}

	switch (type) {
		case "memory":
			repository = new MemDeviceRepository();
		case "mongo":
			repository = new MongoDeviceRepository();
	}

	Validate.notNull(repository, "invalid repository type:[%s]", type);
	return repository;
}
 
开发者ID:pippo1980,项目名称:upns,代码行数:17,代码来源:DeviceRepositoryConfig.java

示例3: instance

@Bean(autowire = Autowire.BY_TYPE, name = "ctu.upns.messageRepository")
public MessageRepository instance() {

	if (repository != null) {
		return repository;
	}

	switch (type) {
		case "memory":
			repository = new MemMessageRepository();
		case "mongo":
			repository = new MongoMessageRepository();
	}

	Validate.notNull(repository, "invalid repository type:[%s]", type);
	return repository;
}
 
开发者ID:pippo1980,项目名称:upns,代码行数:17,代码来源:MessageRepositoryConfig.java

示例4: instance

@Bean(autowire = Autowire.BY_TYPE, name = "ctu.upns.subscriberManager")
public SubscriberManager instance() {

    if (subscriberManager != null) {
        return subscriberManager;
    }

    switch (service_type) {
        case "memory":
            subscriberManager = new MemSubscriberManager();
            return subscriberManager;
        case "mongo":
            return null;
        default:
            throw new IllegalArgumentException(String.format("invalid service type", service_type));
    }

}
 
开发者ID:pippo1980,项目名称:upns,代码行数:18,代码来源:SubscriberManagerConfig.java

示例5: mailBean

@Bean(autowire = Autowire.BY_TYPE)
public MailSender mailBean()
{
    JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
    mailSender.setHost(mailHost);
    mailSender.setUsername(mailUserName);
    mailSender.setPassword(mailPassword);
    setUpMailPro(mailSender);

    return mailSender;
}
 
开发者ID:LinuxSuRen,项目名称:phoenix.webui.framework,代码行数:11,代码来源:MailConfig.java

示例6: createSqlBuilder

/**
 * create  a query builder instance per db type
 *
 * @return query builder instance
 */
@Bean(name = "queryBuilder", autowire = Autowire.BY_TYPE)
public IQueryBuilder createSqlBuilder() throws SQLException {
    JdbcHelper jdbcHelper = beanFactory.getBean(JdbcHelper.class);
    StorageProperties storageProperties = beanFactory.getBean(StorageProperties.class);
    String productName = storageProperties.getDbType().toString();
    Connection connection = jdbcHelper.getDataSource().getConnection();
    connection.close();
    IQueryBuilder queryBuilder;
    switch (productName) {
        case "oracle":
            queryBuilder = new OracleQueryBuilder();
            break;
        case "mssql":
            queryBuilder = new SqlServerQueryBuilder();
            break;
        case "derby":
            queryBuilder = new DerbyQueryBuilder();
            break;
        case "postgresql":
            queryBuilder = new PostgresqlQueryBuilder();
            break;
        case "mysql":
            queryBuilder = new MysqlQueryBuilder();
            break;
        default:
            queryBuilder = new DerbyQueryBuilder();
            break;
    }
    return queryBuilder;
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:35,代码来源:DbConfigFactory.java

示例7: databaseBackedPagingProvider

@Override
@Bean(autowire = Autowire.BY_TYPE)
public DatabaseBackedPagingProvider databaseBackedPagingProvider() {
	DatabaseBackedPagingProvider retVal = super.databaseBackedPagingProvider();
	retVal.setDefaultPageSize(20);
	retVal.setMaximumPageSize(500);
	return retVal;
}
 
开发者ID:jamesagnew,项目名称:hapi-fhir,代码行数:8,代码来源:TestR4Config.java

示例8: foo

@Bean(autowire = Autowire.BY_TYPE)
ControllerLinkBuilderFactory foo() {
	return new ControllerLinkBuilderFactory();
}
 
开发者ID:olivergierke,项目名称:sos,代码行数:4,代码来源:RestCatalogApplication.java

示例9: responseHighlighterInterceptor

/**
 * This interceptor adds some pretty syntax highlighting in responses when a browser is detected
 */
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
	ResponseHighlighterInterceptor retVal = new ResponseHighlighterInterceptor();
	return retVal;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:8,代码来源:FhirServerConfigDstu3.java

示例10: subscriptionSecurityInterceptor

@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
	SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
	return retVal;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:5,代码来源:FhirServerConfigDstu3.java

示例11: subscriptionSecurityInterceptor

@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
	SubscriptionsRequireManualActivationInterceptorDstu2 retVal = new SubscriptionsRequireManualActivationInterceptorDstu2();
	return retVal;
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:5,代码来源:FhirServerConfig.java

示例12: responseHighlighterInterceptor

/**
 * This interceptor adds some pretty syntax highlighting in responses when a browser is detected
 */
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
    ResponseHighlighterInterceptor retVal = new ResponseHighlighterInterceptor();
    return retVal;
}
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:8,代码来源:HAPIRestfulConfig.java

示例13: databaseBackedPagingProvider

@Bean(autowire = Autowire.BY_TYPE)
public DatabaseBackedPagingProvider databaseBackedPagingProvider() {
      			DatabaseBackedPagingProvider retVal = new DatabaseBackedPagingProvider();
      			return retVal;
      }
 
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:5,代码来源:Config.java

示例14: subscriptionSecurityInterceptor

@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
    SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
    return retVal;
}
 
开发者ID:daimor,项目名称:isc-hapi-fhir-jpaserver,代码行数:5,代码来源:FhirServerConfig.java

示例15: responseHighlighterInterceptor

@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
    return new ResponseHighlighterInterceptor();
}
 
开发者ID:DBCG,项目名称:cqf-ruler,代码行数:4,代码来源:FhirServerConfigDstu3.java


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