当注解遇到spring

            GsztbLiveService service = ContextHelper.getBean(GsztbLiveService.class);
        //    service.getClass().getDeclaredMethods();
            Method[] methods = GsztbLiveService.class.getDeclaredMethods();
            for (Method method : methods) {
                SocketDefault an = method.getAnnotation(SocketDefault.class);
                if (null != an) {

                    Object object = null;
                    try {
                        object = method.invoke(service);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

猜你喜欢

转载自www.cnblogs.com/silyvin/p/10919274.html