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(); }