Package org.aspectj.weaver

Examples of org.aspectj.weaver.AdviceKind


  public BcelWorld(String cp) {
    this(makeDefaultClasspath(cp), IMessageHandler.THROW, null);
  }

  public IRelationship.Kind determineRelKind(ShadowMunger munger) {
    AdviceKind ak = ((Advice) munger).getKind();
    if (ak.getKey() == AdviceKind.Before.getKey()) {
      return IRelationship.Kind.ADVICE_BEFORE;
    } else if (ak.getKey() == AdviceKind.After.getKey()) {
      return IRelationship.Kind.ADVICE_AFTER;
    } else if (ak.getKey() == AdviceKind.AfterThrowing.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERTHROWING;
    } else if (ak.getKey() == AdviceKind.AfterReturning.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERRETURNING;
    } else if (ak.getKey() == AdviceKind.Around.getKey()) {
      return IRelationship.Kind.ADVICE_AROUND;
    } else if (ak.getKey() == AdviceKind.CflowEntry.getKey() || ak.getKey() == AdviceKind.CflowBelowEntry.getKey()
        || ak.getKey() == AdviceKind.InterInitializer.getKey() || ak.getKey() == AdviceKind.PerCflowEntry.getKey()
        || ak.getKey() == AdviceKind.PerCflowBelowEntry.getKey() || ak.getKey() == AdviceKind.PerThisEntry.getKey()
        || ak.getKey() == AdviceKind.PerTargetEntry.getKey() || ak.getKey() == AdviceKind.Softener.getKey()
        || ak.getKey() == AdviceKind.PerTypeWithinEntry.getKey()) {
      // System.err.println("Dont want a message about this: "+ak);
      return null;
    }
    throw new RuntimeException("Shadow.determineRelKind: What the hell is it? " + ak);
  }
View Full Code Here


   * Report a message about the advice weave that has occurred. Some messing about to make it pretty ! This code is just asking
   * for an NPE to occur ...
   */
  private void reportWeavingMessage(ShadowMunger munger, Shadow shadow) {
    Advice advice = (Advice) munger;
    AdviceKind aKind = advice.getKind();
    // Only report on interesting advice kinds ...
    if (aKind == null || advice.getConcreteAspect() == null) {
      // We suspect someone is programmatically driving the weaver
      // (e.g. IdWeaveTestCase in the weaver testcases)
      return;
    }
    if (!(aKind.equals(AdviceKind.Before) || aKind.equals(AdviceKind.After) || aKind.equals(AdviceKind.AfterReturning)
        || aKind.equals(AdviceKind.AfterThrowing) || aKind.equals(AdviceKind.Around) || aKind.equals(AdviceKind.Softener))) {
      return;
    }

    // synchronized blocks are implemented with multiple monitor_exit instructions in the bytecode
    // (one for normal exit from the method, one for abnormal exit), we only want to tell the user
View Full Code Here

   * Report a message about the advice weave that has occurred. Some messing about to make it pretty ! This code is just asking
   * for an NPE to occur ...
   */
  private void reportWeavingMessage(ShadowMunger munger, Shadow shadow) {
    Advice advice = (Advice) munger;
    AdviceKind aKind = advice.getKind();
    // Only report on interesting advice kinds ...
    if (aKind == null || advice.getConcreteAspect() == null) {
      // We suspect someone is programmatically driving the weaver
      // (e.g. IdWeaveTestCase in the weaver testcases)
      return;
    }
    if (!(aKind.equals(AdviceKind.Before) || aKind.equals(AdviceKind.After) || aKind.equals(AdviceKind.AfterReturning)
        || aKind.equals(AdviceKind.AfterThrowing) || aKind.equals(AdviceKind.Around) || aKind.equals(AdviceKind.Softener))) {
      return;
    }

    // synchronized blocks are implemented with multiple monitor_exit instructions in the bytecode
    // (one for normal exit from the method, one for abnormal exit), we only want to tell the user
View Full Code Here

  public BcelWorld(String cp) {
    this(makeDefaultClasspath(cp), IMessageHandler.THROW, null);
  }

  public IRelationship.Kind determineRelKind(ShadowMunger munger) {
    AdviceKind ak = ((Advice) munger).getKind();
    if (ak.getKey() == AdviceKind.Before.getKey()) {
      return IRelationship.Kind.ADVICE_BEFORE;
    } else if (ak.getKey() == AdviceKind.After.getKey()) {
      return IRelationship.Kind.ADVICE_AFTER;
    } else if (ak.getKey() == AdviceKind.AfterThrowing.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERTHROWING;
    } else if (ak.getKey() == AdviceKind.AfterReturning.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERRETURNING;
    } else if (ak.getKey() == AdviceKind.Around.getKey()) {
      return IRelationship.Kind.ADVICE_AROUND;
    } else if (ak.getKey() == AdviceKind.CflowEntry.getKey() || ak.getKey() == AdviceKind.CflowBelowEntry.getKey()
        || ak.getKey() == AdviceKind.InterInitializer.getKey() || ak.getKey() == AdviceKind.PerCflowEntry.getKey()
        || ak.getKey() == AdviceKind.PerCflowBelowEntry.getKey() || ak.getKey() == AdviceKind.PerThisEntry.getKey()
        || ak.getKey() == AdviceKind.PerTargetEntry.getKey() || ak.getKey() == AdviceKind.Softener.getKey()
        || ak.getKey() == AdviceKind.PerTypeWithinEntry.getKey()) {
      // System.err.println("Dont want a message about this: "+ak);
      return null;
    }
    throw new RuntimeException("Shadow.determineRelKind: What the hell is it? " + ak);
  }
View Full Code Here

   * Report a message about the advice weave that has occurred. Some messing about to make it pretty ! This code is just asking
   * for an NPE to occur ...
   */
  private void reportWeavingMessage(ShadowMunger munger, Shadow shadow) {
    Advice advice = (Advice) munger;
    AdviceKind aKind = advice.getKind();
    // Only report on interesting advice kinds ...
    if (aKind == null || advice.getConcreteAspect() == null) {
      // We suspect someone is programmatically driving the weaver
      // (e.g. IdWeaveTestCase in the weaver testcases)
      return;
    }
    if (!(aKind.equals(AdviceKind.Before) || aKind.equals(AdviceKind.After) || aKind.equals(AdviceKind.AfterReturning)
        || aKind.equals(AdviceKind.AfterThrowing) || aKind.equals(AdviceKind.Around) || aKind.equals(AdviceKind.Softener))) {
      return;
    }

    // synchronized blocks are implemented with multiple monitor_exit instructions in the bytecode
    // (one for normal exit from the method, one for abnormal exit), we only want to tell the user
View Full Code Here

  public BcelWorld(String cp) {
    this(makeDefaultClasspath(cp), IMessageHandler.THROW, null);
  }

  public IRelationship.Kind determineRelKind(ShadowMunger munger) {
    AdviceKind ak = ((Advice) munger).getKind();
    if (ak.getKey() == AdviceKind.Before.getKey()) {
      return IRelationship.Kind.ADVICE_BEFORE;
    } else if (ak.getKey() == AdviceKind.After.getKey()) {
      return IRelationship.Kind.ADVICE_AFTER;
    } else if (ak.getKey() == AdviceKind.AfterThrowing.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERTHROWING;
    } else if (ak.getKey() == AdviceKind.AfterReturning.getKey()) {
      return IRelationship.Kind.ADVICE_AFTERRETURNING;
    } else if (ak.getKey() == AdviceKind.Around.getKey()) {
      return IRelationship.Kind.ADVICE_AROUND;
    } else if (ak.getKey() == AdviceKind.CflowEntry.getKey() || ak.getKey() == AdviceKind.CflowBelowEntry.getKey()
        || ak.getKey() == AdviceKind.InterInitializer.getKey() || ak.getKey() == AdviceKind.PerCflowEntry.getKey()
        || ak.getKey() == AdviceKind.PerCflowBelowEntry.getKey() || ak.getKey() == AdviceKind.PerThisEntry.getKey()
        || ak.getKey() == AdviceKind.PerTargetEntry.getKey() || ak.getKey() == AdviceKind.Softener.getKey()
        || ak.getKey() == AdviceKind.PerTypeWithinEntry.getKey()) {
      // System.err.println("Dont want a message about this: "+ak);
      return null;
    }
    throw new RuntimeException("Shadow.determineRelKind: What the hell is it? " + ak);
  }
View Full Code Here

     */
    public Advice shadowMunger(String str, int extraFlag) {
        str = str.trim();
        int start = 0;
        int i = str.indexOf('(');
        AdviceKind kind =
            AdviceKind.stringToKind(str.substring(start, i));
        start = ++i;
        i = str.indexOf(')', i);
        String[] ids = parseIds(str.substring(start, i).trim());
        //start = ++i;
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.AdviceKind

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.