Package org.aspectj.lang

Examples of org.aspectj.lang.Signature


        return result;
    }

    private boolean isVoidReturnType(final ProceedingJoinPoint pjp) {
        boolean isVoidReturnType = false;
        final Signature signature = pjp.getStaticPart().getSignature();
        if (signature instanceof MethodSignature) {
            final MethodSignature methodSignature = (MethodSignature) signature;
            isVoidReturnType = (methodSignature != null) ? Void.TYPE.equals(methodSignature.getReturnType()) : false;
        }
        return isVoidReturnType;
View Full Code Here


public class AsynchronousAspect {

    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Around("call(@com.amazonaws.services.simpleworkflow.flow.annotations.Asynchronous * *(..)) && @annotation(asynchronousAnnotation)")
    public Object makeAsynchronous(ProceedingJoinPoint pjp, Asynchronous asynchronousAnnotation) throws Throwable {
        final Signature signature = pjp.getStaticPart().getSignature();
        if (signature instanceof MethodSignature) {
            final MethodSignature methodSignature = (MethodSignature) signature;
            int i = 0;
            Object[] methodArguments = pjp.getArgs();
            Annotation[][] parameterAnnotations = methodSignature.getMethod().getParameterAnnotations();
View Full Code Here

   *
   * @since 1.6.10
   */
  public JoinPoint.StaticPart makeSJP(String kind, String modifiers, String methodName, String declaringType, String paramTypes,
      String paramNames, String exceptionTypes, String returnType, int l) {
    Signature sig = this.makeMethodSig(modifiers, methodName, declaringType, paramTypes, paramNames, exceptionTypes, returnType);
    return new JoinPointImpl.StaticPartImpl(count++, kind, sig, makeSourceLoc(l, -1));
  }
View Full Code Here

   *
   * @since 1.6.10
   */
  public JoinPoint.StaticPart makeSJP(String kind, String modifiers, String methodName, String declaringType, String paramTypes,
      String paramNames, String returnType, int l) {
    Signature sig = this.makeMethodSig(modifiers, methodName, declaringType, paramTypes, paramNames, "", returnType);
    return new JoinPointImpl.StaticPartImpl(count++, kind, sig, makeSourceLoc(l, -1));
  }
View Full Code Here

  public JoinPoint.EnclosingStaticPart makeESJP(String kind, Signature sig, int l) {
    return new JoinPointImpl.EnclosingStaticPartImpl(count++, kind, sig, makeSourceLoc(l, -1));
  }

  public static JoinPoint.StaticPart makeEncSJP(Member member) {
    Signature sig = null;
    String kind = null;
    if (member instanceof Method) {
      Method method = (Method) member;
      sig = new MethodSignatureImpl(method.getModifiers(), method.getName(), method.getDeclaringClass(), method
          .getParameterTypes(), new String[method.getParameterTypes().length], method.getExceptionTypes(), method
View Full Code Here

    protected void registerMbean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
        this.mBeanExportOperations.registerManagedResource(object, name);
    }
   
    protected final CacheStatistics getCacheStatistics(ProceedingJoinPoint pjp, RequestCache requestCache) {
        final Signature signature = pjp.getSignature();
        final String signatureString = signature.toString();
       
        CacheStatistics cacheStatistics = this.methodStats.get(signatureString);
        if (cacheStatistics == null) {
            final CacheStatistics newStats = new CacheStatistics();
            cacheStatistics = ConcurrentMapUtils.putIfAbsent(this.methodStats, signatureString, newStats);
View Full Code Here

       
        return cacheStatistics;
    }
   
    protected CacheKey createCacheKey(ProceedingJoinPoint pjp, RequestCache requestCache) {
        final Signature signature = pjp.getSignature();
        final Class<?> declaringType = signature.getDeclaringType();
        final String signatureLongString = signature.toLongString();
       
        final boolean[] keyMask = requestCache.keyMask();
        final Object[] args = pjp.getArgs();
       
        final Object[] keyArgs;
        if (keyMask.length == 0) {
            keyArgs = args;
        }
        else if (keyMask.length != args.length) {
            throw new AnnotationFormatError("RequestCache.keyMask has an invalid length on: " + signature.toLongString());
        }
        else {
            keyArgs = new Object[args.length];
            for (int i = 0; i < args.length; i++) {
                if (keyMask[i]) {
View Full Code Here

        return TrackerFactory.DEFAULT_TRACKER_NAME;
    }

    private Method getMethod(ProceedingJoinPoint pjp) {
        Signature signature = pjp.getSignature();
        if (signature instanceof MethodSignature) {
            MethodSignature mSignature = (MethodSignature) signature;
            Class targetClass = pjp.getTarget().getClass();
            try {
                return targetClass.getMethod(mSignature.getMethod().getName(), mSignature.getParameterTypes());
View Full Code Here

                call.logArgs = annotation.logArgs();
                call.setMsg(annotation.message());
            }
        } else {
            //todo:Dima need to be refined
            Signature signature = pjp.getSignature();
            call = new MonitoredCall(signature.getDeclaringType().getSimpleName(), signature.getName(), pjp.getArgs());
        }
        return call;
    }
View Full Code Here

    }
  }

  public List<Method> getMatchingMethodsForJoinPoint(ProceedingJoinPoint pjp) {

    Signature sig = pjp.getSignature();

    Object target = pjp.getTarget();
    Class<?> type = target.getClass();

    List<Method> matches = new ArrayList<Method>();

    for (Method m : type.getDeclaredMethods()) {
      if (!m.getName().equals(sig.getName()))
        continue;

      // if (m.getModifiers() != sig.getModifiers())
      // continue;
      Object[] args = pjp.getArgs();
View Full Code Here

TOP

Related Classes of org.aspectj.lang.Signature

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.