Package org.aspectj.lang.reflect

Examples of org.aspectj.lang.reflect.MethodSignature


  public Object handleDynamicQuery(DynamicQuery dynamicQuery, MethodInvocation invocation){
    return handleDynamicQueryNative(dynamicQuery, invocation.getThis(), invocation.getMethod(), invocation.getArguments());
  }

  public Object handleDynamicQuery(DynamicQuery dynamicQuery, ProceedingJoinPoint pjp){
    MethodSignature ms = (MethodSignature)pjp.getSignature();
    return handleDynamicQueryNative(dynamicQuery, pjp.getThis(), ms.getMethod(), pjp.getArgs());
  }
View Full Code Here


     * @return the processed value of the method depending from feature state.
     * @throws Throwable
     */
    @Around(value="anyMethod() && @annotation(flip)", argNames="flip")
    public Object aroundFlippableMethods(ProceedingJoinPoint pjp, Flippable flip) throws Throwable {
        MethodSignature methodSignature = (MethodSignature)pjp.getSignature();
        Method method = methodSignature.getMethod();
       
        if (isFeatureEnabled(flip.feature())) {
            Annotation[][] paramAnnotations = method.getParameterAnnotations();
            Object[] params = pjp.getArgs();
            Class[] paramTypes = method.getParameterTypes();
View Full Code Here

        assertSame(target, raw);
       
        assertSame(method.getName(), AbstractAspectJAdvice.currentJoinPoint().getSignature().getName());
        assertEquals(method.getModifiers(), AbstractAspectJAdvice.currentJoinPoint().getSignature().getModifiers());
       
        MethodSignature msig = (MethodSignature) AbstractAspectJAdvice.currentJoinPoint().getSignature();
        assertSame("Return same MethodSignature repeatedly", msig, AbstractAspectJAdvice.currentJoinPoint().getSignature());
        assertSame("Return same JoinPoint repeatedly", AbstractAspectJAdvice.currentJoinPoint(), AbstractAspectJAdvice.currentJoinPoint());
        assertEquals(method.getDeclaringClass(), msig.getDeclaringType());
        assertTrue(Arrays.equals(method.getParameterTypes(), msig.getParameterTypes()));
        assertEquals(method.getReturnType(), msig.getReturnType());
        assertTrue(Arrays.equals(method.getExceptionTypes(), msig.getExceptionTypes()));
        try {
          msig.getParameterNames();
          fail("Can't determine parameter names");
        }
        catch (UnsupportedOperationException ex) {
          // Expected
        }
        msig.toLongString();
        msig.toShortString();
      }
    });
    ITestBean itb = (ITestBean) pf.getProxy();
    // Any call will do
    assertEquals("Advice reentrantly set age", newAge, itb.getAge());
View Full Code Here

        final Object[] input = joinPoint.getArgs();

        final String category = clazz.getSimpleName();

        final MethodSignature ms = (MethodSignature) joinPoint.getSignature();
        Method method = ms.getMethod();

        final String event = joinPoint.getSignature().getName();

        AuditElements.Result result = null;
        Object output = null;
View Full Code Here

    private EhCacheCacheManager ehCacheCacheManager;

    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        Object returnObject = null;
        try {
            MethodSignature signature = (MethodSignature) joinPoint.getSignature();
            Class classTarget = signature.getReturnType();
            Object[] args = joinPoint.getArgs();
            String suffix = "";
            List<SpecificFetchMode> askedFetchModes = null;
            List<SpecificFetchMode> loadedFetchModes = null;
            String cacheType = CACHE_TYPE_MISC;
View Full Code Here

    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

    @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();
            List<Promise> valueParams = new ArrayList<Promise>();
            for (final Class<?> parameterType : methodSignature.getParameterTypes()) {
                if ((isPromise(parameterType) || isPromiseArray(parameterType) || (isCollection(parameterType) && hasWaitAnnotation(parameterAnnotations[i])))
                        && !hasNoWaitAnnotation(parameterAnnotations[i])) {
                    Object param = methodArguments[i];
                    if (isPromise(parameterType)) {
                        valueParams.add((Promise) param);
View Full Code Here

    }

    private ProceedingJoinPoint prepareJoinPoint(String expectedDiscriminator, String expectedId, TestService service,
                                                 Method expectedMethod, TestObject argument, Object[] joinPointArgs)
            throws Throwable {
        MethodSignature methodSignature = createMock(MethodSignature.class);
        expect(methodSignature.getMethod()).andReturn(expectedMethod);
        replay(methodSignature);

        ProceedingJoinPoint joinPoint = createMock(ProceedingJoinPoint.class);
        expect(joinPoint.getSignature()).andReturn(methodSignature);
        expect(joinPoint.getTarget()).andReturn(service);
View Full Code Here

    LOGGER.log(Level.INFO, "Adding new Cache to cacheTable with name: " + name);
    cache.put(name, internalCache);
  }*/
 
  protected Method getInterceptedMethod(ProceedingJoinPoint pjp) throws SecurityException, NoSuchMethodException {
    MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
      Method method = methodSignature.getMethod();
      Object target = pjp.getTarget();
    Class clazz = target.getClass();
    Method m = clazz.getMethod(method.getName(), method.getParameterTypes());
   
    return m;
View Full Code Here

     */
    @Around("anyPublicMethod() && @annotation(disconfFileItem)")
    public Object decideAccess(ProceedingJoinPoint pjp,
            DisconfFileItem disconfFileItem) throws Throwable {

        MethodSignature ms = (MethodSignature) pjp.getSignature();
        Method method = ms.getMethod();

        //
        // 文件名
        //
        Class<?> cls = method.getDeclaringClass();
View Full Code Here

TOP

Related Classes of org.aspectj.lang.reflect.MethodSignature

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.