Skip to content

Instantly share code, notes, and snippets.

@ereshzealous
Last active January 14, 2020 14:23
Show Gist options
  • Select an option

  • Save ereshzealous/7c0c0e584318b219ad7237c35d0606b6 to your computer and use it in GitHub Desktop.

Select an option

Save ereshzealous/7c0c0e584318b219ad7237c35d0606b6 to your computer and use it in GitHub Desktop.
package com.minikube.sample.rest.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
/**
* Created By Gorantla, Eresh on 13/Jan/2020
**/
@Component
@Scope("singleton")
public class SingletonBean {
private Logger logger = LoggerFactory.getLogger(this.getClass());
public void printData() {
logger.info("From Singleton class............");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment