當註解遇到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();
                    }
相關文章
相關標籤/搜索