Code example for Method

Methods: getAnnotation

0
    private static final long serialVersionUID = 1L;
 
    @AroundInvoke 
    public Object aroundInvoke(final InvocationContext invocation) throws Exception {
        Method method = invocation.getMethod();
        Proxying proxying = method.getAnnotation(Proxying.class);
        if (proxying == null) {
            Class<?> clazz = invocation.getTarget().getClass();
            proxying = clazz.getAnnotation(Proxying.class);
        } 
 
        if (proxying != null) {
            ProxyingEnum pe = proxying.value();
            pe.begin();
            try { 
                return invocation.proceed();
            } finally { 
                pe.end();
            } 
        } else { 
            return invocation.proceed();