Package org.aspectj.lang.reflect

Examples of org.aspectj.lang.reflect.MethodSignature


        "@MonitoredWork target must be subclass of IWorkMonitorProvider");
    ValidationUtils.assertTrue(joinPoint.getSignature() instanceof MethodSignature,
        "@MonitoredWork signature must be a method");
   
        final WorkMonitor workMonitor = ((IWorkMonitorProvider) joinPoint.getTarget()).getWorkMonitor();
    MethodSignature signature = (MethodSignature) joinPoint.getSignature();
    MonitoredWork annotation = signature.getMethod().getAnnotation(MonitoredWork.class);
   
    final String workName = annotation != null && !annotation.value().isEmpty() ? annotation.value() : signature.getName();

        long start = System.currentTimeMillis();
        try {
            Object ret = joinPoint.proceed();
            workMonitor.recordWorkOk(workName, System.currentTimeMillis() - start);
View Full Code Here


        return monitoredMethodCall.call(pjp, (PassiveMethodMonitor) monitor);
    }

    private MonitorMethod getAnnotation(final ProceedingJoinPoint pjp) {
        MethodSignature signature = (MethodSignature) pjp.getSignature();
        MonitorMethod fromSignature = signature.getMethod().getAnnotation(MonitorMethod.class);
        if (fromSignature != null) {
            return fromSignature;
        }
        // right, couldn't find it on the method signature, but we might be looking at an implementation of an interface
        // so now look at the target object/class
        try {
            Method m = pjp.getTarget().getClass().getDeclaredMethod(signature.getName(), signature.getParameterTypes());
            return m.getAnnotation(MonitorMethod.class);
        } catch (NoSuchMethodException e) {
            // hmm, not sure we should ever see this
            throw new IllegalStateException("Couldn't find method that was called on the object it was called on");
        }
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

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

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

        String methodName = method.getName();

        //
        // Field名
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.