Slide 25
Slide 25 text
Spring 4 @Conditionals
# one of: filesystem,s3,mongo
storage=filesystem
@ConditionalOnProperty(name = "storage", havingValue = "s3")
class S3StorageService implements StorageService {
}
@ConditionalOnProperty(name = "storage", havingValue = "mongo")
class MongoStorageService implements StorageService {
}
@ConditionalOnProperty(name = "storage", havingValue = "filesystem",
matchIfMissing = true)
class FileSystemStorageService implements StorageService {
}