Skip to content

Instantly share code, notes, and snippets.

@malinduDeAlwis90
Created March 5, 2023 15:33
Show Gist options
  • Save malinduDeAlwis90/782e609690176e73ef7f77423dd1d323 to your computer and use it in GitHub Desktop.
Save malinduDeAlwis90/782e609690176e73ef7f77423dd1d323 to your computer and use it in GitHub Desktop.
package com.example.springconditionalbeans;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Conditional;
import org.springframework.stereotype.Component;
import java.io.File;
@Component
@Conditional(CloudCondition.class)
class CloudFileServiceImpl extends FileServiceImpl {
private static final Logger logger = LoggerFactory.getLogger(CloudFileServiceImpl.class);
public CloudFileServiceImpl() {
logger.info("CloudFileServiceImpl constructed.");
}
public File loadFile() {
// This method was added to implement cloud specific functionality.
return null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment