@IocBean
public class TokenAnnotationProcessor implements IocEventListener {
@Override
public Object afterBorn(Object obj, String s) {
try {
Mirror mirror = Mirror.me(obj);
Field[] fields = obj.getClass().getDeclaredFields();
for (Method method : mirror.getMethods()) {
boolean is = method.isAnnotationPresent(TokenVerify.class);
if (!is){
continue;
}
TokenVerify tokenVerify = method.getAnnotation(TokenVerify.class);
boolean tokenFlag = tokenVerify.flag();
if (!tokenFlag){
continue;
}
Object param = Mvcs.getActionContext().getRequest().getParameter("sign_token");
System.out.println(param);
}
} catch (Throwable e) {
throw new RuntimeException(e);
}
return obj;
}
@Override
public Object afterCreate(Object o, String s) {
return null;
}
@Override
public int getOrder() {
return 0;
}
}
问答
nutzboot里使用IocEventListener中afterBorn只能执行一次么?
标签:
无
7 回复
添加回复
请先登陆