Skip to content

Instantly share code, notes, and snippets.

@mjedynak
Created August 6, 2016 11:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjedynak/4f5b5f4bc8977c22c8f4fad8eb051d36 to your computer and use it in GitHub Desktop.
Save mjedynak/4f5b5f4bc8977c22c8f4fad8eb051d36 to your computer and use it in GitHub Desktop.
public class App {
private static final Logger logger = LoggerFactory.getLogger(App.class.getName());
public static void main(String[] args) {
invoke(new DefaultService());
logger.debug("----------------------\n");
invoke(new LazyInitService());
logger.debug("----------------------\n");
invoke(LazyInitWithProxyServiceFactory.createService());
logger.debug("----------------------\n");
invoke(LazyInitWithProxyThreadSafeServiceFactory.createService());
}
private static void invoke(Service service) {
logger.debug("Invoking method");
logger.debug("Current time:" + service.getTime().toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment