title: Pointcut for classes inside different package or sub-packages marked Deprecated and at the time whenever they used or instantiated?
body: <p>I want to write a point cut for class instantiation in various packages,like classes inside the subpackages inside com.kepler.xenon (eg.com.kepler.xenon.modules.ticklers.pojo.Tickler,
  com.kepler.xenon.modules.product.pojo.Product etc).</p>
  
  <pre class="lang-java prettyprint-override"><code>//This is my advice
  @Aspect
  @Component
  public class OxAspect {
  @After("execution(* com.oxane.xenon..*new(..)) &amp;&amp; @within(java.lang.Deprecated)")
  public void myAdvice(final JoinPoint jp){
      System.out.println(jp.getSignature().getName()+""+jp.getTarget().getClass());
   }
  }
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>//This is my class
  package com.kepler.xenon.modules.ticklers.pojo;
  @Deprecated
  public Class Ticklers{
  @Id
  @TableGenerator(name = "TICKLERS_ID", table = "ID_GENERATOR", pkColumnName = "GEN_KEY", valueColumnName = "GEN_VALUE", pkColumnValue = "TICKLERS_ID", allocationSize = 1, initialValue = 1)
  @GeneratedValue(strategy = GenerationType.TABLE, generator = "TICKLERS_ID")
  @Column(name = "TICKLERS_ID", unique = true, nullable = false)
  private int ticklersId;
  
  @Column(name = "TASK", nullable = false, length = 256)
  private String taskName;
  
  public int getTicklersId() {
      return ticklersId;
  }
  
  public void setTicklersId(int ticklersId) {
      this.ticklersId = ticklersId;
  }
  
  public String getTaskName() {
      return taskName;
  }
  
  public void setTaskName(String taskName) {
      this.taskName = taskName;
  }
  
  }
  </code></pre>
  
  <p>What i want is that if anyone tries to access the class which is deprecated,then pointcut filters that call and triggers advice.
  I have done it for methods but i am failing to do it for classes.</p>
  
  <p>I am adding aspect which works for methods,controller and Dao</p>
  
  <pre><code>@Aspect
  @Component
  public class OxAspect {
  
  private final OxAspectService oxAspectService;
  
  public OxAspect(OxAspectService oxAspectService) {
      this.oxAspectService=oxAspectService;
  }
  
  @Pointcut("execution(@java.lang.Deprecated * com.oxane.xenon..*(..))"
          + " || execution(* com.oxane.xenon..*.*(..)) &amp;&amp; @within(java.lang.Deprecated)")
  public void deprecated() {
  }
  
  @Before("deprecated()")
  public void log(final JoinPoint jp) {
      oxAspectService.logDeprecatedMethod(jp);
  }
  
  }
  </code></pre>
  
  <p>Edit:
  I have done some research on spring io and found that it can't be done using spring aop. I have to use load time weaving or compile time weaving to achieve what i want. For that i have to use pure aspect j implementation. Correct me if i am wrong.</p>