Package org.aspectj.lang

Examples of org.aspectj.lang.Signature


    return _cacheableMethodKeyFactoryManager.getCacheableMethodKeyFactoryForJoinPoint(
        pjp, method);
  }

  protected String getCacheName(ProceedingJoinPoint pjp) {
    Signature sig = pjp.getSignature();
    StringBuilder b = new StringBuilder();
    if (_cacheNamePrefix != null)
      b.append(_cacheNamePrefix).append("-");
    b.append(sig.getDeclaringTypeName()).append('.').append(sig.getName());
    return b.toString();
  }
View Full Code Here


            }
        }
    }

    private Method getMethod(JoinPoint joinPoint) {
        Signature signature = joinPoint.getSignature();
        String key = signature.getDeclaringTypeName() + "." + signature.getName();
        //
        Method target = methodCache.get(key);
        if (target == null) {
            Object[] args = joinPoint.getArgs();
            String methodName = signature.getName();
            Class<?> classType = joinPoint.getTarget().getClass();
            for (Method method : classType.getMethods()) {
                if (isSameMethod(method, methodName, args)) {
                    // cache and return
                    methodCache.put(key, method);
View Full Code Here

    Logger logger = extractLogger(call);
    severity.logException(logger, message, exception);
  }

  private Logger extractLogger(JoinPoint call) {
    Signature signature = call.getSignature();
    Class<?> declaringType = signature.getDeclaringType();
    Logger logger = LoggerFactory.getLogger(declaringType);
    return logger;
  }
View Full Code Here

                return (Promise) pjp.proceed();
            }
        };
       
        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;
        }
       
View Full Code Here

        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

    public void check( JoinPoint jp ) {
        /* this might get some authentication/authorization info from the request
         * and throw a WebApplicationException with a response with status 401 (unauthorized)
         * if the request is not authorized.
         */
        final Signature signature = jp.getSignature();
        LOGGER.info( "Authorized execution of " + signature.getDeclaringTypeName() + "." + signature.getName() );
    }
View Full Code Here

  @Pointcut("execution(public * rewards.internal.*.*Repository+.*(..))")
  public void anyRepositoryMethod() {
  }

  private String createJoinPointTraceName(JoinPoint joinPoint) {
    Signature signature = joinPoint.getSignature();
    StringBuilder sb = new StringBuilder();
    sb.append(signature.getDeclaringType().getSimpleName());
    sb.append('.').append(signature.getName());
    return sb.toString();
  }
View Full Code Here

  @Test
  public void testMonitor() throws Throwable {
    JamonMonitorFactory monitorFactory = new JamonMonitorFactory();
    RepositoryPerformanceMonitor performanceMonitor = new RepositoryPerformanceMonitor(monitorFactory);
    Signature signature = EasyMock.createMock(Signature.class);
    ProceedingJoinPoint targetMethod = EasyMock.createMock(ProceedingJoinPoint.class);

    EasyMock.expect(targetMethod.getSignature()).andReturn(signature);
    EasyMock.expect(signature.getDeclaringType()).andReturn(Object.class);
    EasyMock.expect(signature.getName()).andReturn("hashCode");
    EasyMock.expect(targetMethod.proceed()).andReturn(new Object());

    EasyMock.replay(signature, targetMethod);
    performanceMonitor.monitor(targetMethod);
    EasyMock.verify(signature, targetMethod);
View Full Code Here

  @Pointcut("execution(public * rewards.internal.reward.RewardRepository+.*(..))")
  public void anyRewardRepositoryMethod() {
  }

  private String createJoinPointTraceName(JoinPoint joinPoint) {
    Signature signature = joinPoint.getSignature();
    StringBuilder sb = new StringBuilder();
    sb.append(signature.getDeclaringType().getSimpleName());
    sb.append('.').append(signature.getName());
    return sb.toString();
  }
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.