Guest User

Untitled

a guest
Jun 22nd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. public abstract AbstractClass {
  2. private Logger logger = LoggerFactory.getLogger(getClass());
  3.  
  4. public AbstractClass() {}
  5.  
  6. public void execute(ContextObject context) {
  7. if (logger.debuggingEnabled()) {
  8. String invokingClassName = ""; // <-- how do I get this?
  9. logger.debug("Executing {}", invokingClassName);
  10. }
  11. // shared application logic is here...
  12. }
  13. }
  14.  
  15. public MyClass extends AbstractClass {
  16. public MyClass() {}
  17.  
  18. @Override
  19. public void execute(ContextObject context) {
  20. super.execute(context);
  21. // application logic...
  22. }
  23. }
  24.  
  25. public void execute(ContextObject context) {
  26. if (logger.debuggingEnabled()) {
  27. String invokingClassName = ""; // <-- how do I get this?
  28. logger.debug("Executing {}", this.getClass().getName());
  29. }
  30. // shared application logic is here...
  31. }
  32.  
  33. private Logger logger = LoggerFactory.getLogger(getClass());
Add Comment
Please, Sign In to add comment