title: Third party library method call not trigger calling respect AOP method
body: <p>I make my telegram bot using java library TelegramBots, Spring Boot and AspectJ in my application. </p>
  
  <p>I have next class that extend third party library class <code>TelegramLongPollingBot</code> with class <code>TelegramBotPolling</code>. </p>
  
  <pre><code> @Component
   public class TelegramBotPolling extends TelegramLongPollingBot {
      static {
         ApiContextInitializer.init();
      }
  
      @PostConstruct
      public void registerBot(){
         TelegramBotsApi telegramBotsApi = new TelegramBotsApi();
         try {
            telegramBotsApi.registerBot(this);
         } catch (TelegramApiException e) {
            logger.error(e);
         }
      }
  
      @Override
      public void onUpdateReceived(Update update) {   
         ...
      }   
  }
  </code></pre>
  
  <p>This libraries class has abstract method <code>onUpdateReceived</code> that I implement in my class <code>TelegramBotPolling</code>. </p>
  
  <p>I want to keep track when method <code>onUpdateReceived</code> is called and will log this method using Spring AOP:</p>
  
  <pre><code>@Aspect
  @Component
  public class TelegramBotPollingLogger {
  
     @Around("execution(* ru.cheb.intercity.bus.telegrambot.TelegramBotPolling.onUpdateReceived(..))")
     public Object onUpdateReceivedMethodLogger(ProceedingJoinPoint joinPoint)
     {
          Object returnVal = commonLogHandler.handle(joinPoint);
          return returnVal;
     }
  }
  </code></pre>
  
  <p>But AOP method <code>onUpdateReceivedMethodLogger</code> doesn't called when <code>onUpdateReceived</code> is called. I think I have a problem because <code>onUpdateReceived</code> relate with third party library. Because my own class methods work well with AOP. </p>
  
  <p>How can I call AOP method <code>onUpdateReceivedMethodLogger</code> when method <code>onUpdateReceived</code>is called ?</p>
  
  <p>============================================</p>
  
  <p>Trying to inject <code>TelegramBotPolling</code> class in other class:</p>
  
  <pre><code>  @Component
   public class TelegramBotPolling extends TelegramLongPollingBot implements  TelegramBotUpdater{
      static {
         ApiContextInitializer.init();
      }
  
      @Override
      public String getBotToken() {...}
  
      @Override  
      public String getBotUsername() {...}
  
      @Override
      public void onUpdateReceived(Update update) {   
         ...
      }   
  }
  </code></pre>
  
  <p>I define interface <code>TelegramBotUpdater</code> for <code>TelegramBotPolling</code></p>
  
  <pre><code>  public interface TelegramBotUpdater {
  
       String getBotToken();
  
       String getBotUsername();
  
       void onUpdateReceived(Update update);
  
   }
  </code></pre>
  
  <p>Other class that inject this interface <code>TelegramBotUpdater</code>:</p>
  
  <pre><code>@Component
  public class BotRegistrator {
  
  
  
     @Autowired
     TelegramBotUpdater telegramBotUpdater;
  
     public void register(){
        TelegramBotsApi telegramBotsApi = new TelegramBotsApi();
        try {
            telegramBotsApi.registerBot((TelegramBotPolling)telegramBotUpdater);
        } catch (TelegramApiException e) {
            logger.error(e);
        }
     }
  
  }
  </code></pre>
  
  <p>And <code>Application</code> class that start spring boot application inject other class:</p>
  
  <pre><code>@SpringBootApplication
  public class Application {
  
       @Autowired
       BotRegistrator botRegistrator;
  
      public static void main(String[] args) throws Throwable {
  
          SpringApplication.run(Application.class, args);
  
          botRegistrator.register();
     }
  }
  </code></pre>
  
  <p>When calling <code>botRegistrator.register();</code> I get NPE exception.</p>