Package jodd.proxetta

Examples of jodd.proxetta.ProxettaException


  /**
   * Defines the interface of the resulting class.
   */
  public void setTargetInterface(Class targetInterface) {
    if (targetInterface.isInterface() == false) {
      throw new ProxettaException("Not an interface: " + targetInterface.getName());
    }
    this.targetInterface = targetInterface;
  }
View Full Code Here


      ClassReader cr = null;
      try {
        inputStream = ClassLoaderUtil.getClassAsStream(nextSupername, classLoader);
        cr = new ClassReader(inputStream);
      } catch (IOException ioex) {
        throw new ProxettaException("Unable to inspect super class: " + nextSupername, ioex);
      } finally {
        StreamUtil.close(inputStream);
      }
      hierarchyLevel++;
      superList.add(nextSupername);
      superClassReaders.add(cr)// remember the super class reader
      cr.accept(new SuperClassVisitor(), 0);
    }
    superClasses = superList.toArray(new String[superList.size()]);

    // check all interface methods that are not overridden in super-interface
    if (nextInterfaces != null) {
      while (!nextInterfaces.isEmpty()) {
        Iterator<String> iterator = nextInterfaces.iterator();
        String next = iterator.next();
        iterator.remove();

        InputStream inputStream = null;
        ClassReader cr = null;
        try {
          inputStream = ClassLoaderUtil.getClassAsStream(next, classLoader);
          cr = new ClassReader(inputStream);
        } catch (IOException ioex) {
          throw new ProxettaException("Unable to inspect super interface: " + next, ioex);
        } finally {
          StreamUtil.close(inputStream);
        }
        hierarchyLevel++;
        superClassReaders.add(cr);        // remember the super class reader
View Full Code Here

      field.set(advice, targetClass);

      return (T) advice;
    } catch (Exception ex) {
      throw new ProxettaException(ex);
    }
  }
View Full Code Here

    try {
      Field field = proxyClass.getField("$___target$0");

      field.set(proxy, target);
    } catch (Exception ex) {
      throw new ProxettaException(ex);
    }
  }
View Full Code Here

   */
  protected void createFirstChainDelegate_Start() {
    // check invalid access flags
    int access = msign.getAccessFlags();
    if ((access & AsmUtil.ACC_FINAL) != 0) {   // detect final
      throw new ProxettaException("Unable to create proxy for final method: " + msign +". Remove final modifier or change the pointcut definition.");
    }

    // create proxy methods
    tmd = new TargetMethodData(msign, aspectList);

View Full Code Here

  /**
   * Defines the interface of the resulting class.
   */
  public void setTargetInterface(Class targetInterface) {
    if (targetInterface.isInterface() == false) {
      throw new ProxettaException("Not an interface: " + targetInterface.getName());
    }
    this.targetInterface = targetInterface;
  }
View Full Code Here

  /**
   * Validates argument index.
   */
  public static void checkArgumentIndex(MethodInfo methodInfo, int argIndex) {
    if ((argIndex < 1) || (argIndex > methodInfo.getArgumentsCount())) {
      throw new ProxettaException("Invalid argument index: " + argIndex);
    }
  }
View Full Code Here

        return;
      } catch (Exception ignore) {
      }
    }

    throw new ProxettaException("Unsupported annotation type: " + elementValue.getClass());
  }
View Full Code Here

      if (isArray() == true) {
        type = '[';
        typeName = getArrayDepthString() + typeName;
      }
      if (type == 'V') {
        throw new ProxettaException("Method argument can't be void");
      }
      argumentsCount++;
      argumentsOpcodeType.add(type);
      argumentsOffset.add(argumentsWords + 1);
      argumentsTypeNames.add(typeName);
View Full Code Here

    InputStream inputStream = null;
    try {
      inputStream = ClassLoaderUtil.getClassAsStream(advice);
      return new ClassReader(inputStream);
    } catch (IOException ioex) {
      throw new ProxettaException(ioex);
    } finally {
      StreamUtil.close(inputStream);
    }
  }
View Full Code Here

TOP

Related Classes of jodd.proxetta.ProxettaException

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.