本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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));
}
}
示例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;
}
示例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;
}
示例7: databaseBackedPagingProvider
@Override
@Bean(autowire = Autowire.BY_TYPE)
public DatabaseBackedPagingProvider databaseBackedPagingProvider() {
DatabaseBackedPagingProvider retVal = super.databaseBackedPagingProvider();
retVal.setDefaultPageSize(20);
retVal.setMaximumPageSize(500);
return retVal;
}
示例8: foo
@Bean(autowire = Autowire.BY_TYPE)
ControllerLinkBuilderFactory foo() {
return new ControllerLinkBuilderFactory();
}
示例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;
}
示例10: subscriptionSecurityInterceptor
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
return retVal;
}
示例11: subscriptionSecurityInterceptor
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
SubscriptionsRequireManualActivationInterceptorDstu2 retVal = new SubscriptionsRequireManualActivationInterceptorDstu2();
return retVal;
}
示例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;
}
示例13: databaseBackedPagingProvider
@Bean(autowire = Autowire.BY_TYPE)
public DatabaseBackedPagingProvider databaseBackedPagingProvider() {
DatabaseBackedPagingProvider retVal = new DatabaseBackedPagingProvider();
return retVal;
}
示例14: subscriptionSecurityInterceptor
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor subscriptionSecurityInterceptor() {
SubscriptionsRequireManualActivationInterceptorDstu3 retVal = new SubscriptionsRequireManualActivationInterceptorDstu3();
return retVal;
}
示例15: responseHighlighterInterceptor
@Bean(autowire = Autowire.BY_TYPE)
public IServerInterceptor responseHighlighterInterceptor() {
return new ResponseHighlighterInterceptor();
}