我想在我的流程执行生命周期中将 spring 方面用于我的横切流程,例如之前或之后的处理程序。例如
在我想要执行我的处理程序的方法之前我想要什么,并且由于它的响应,我想要完成 myprocess 并返回自定义响应。
例如在停止条件下我应该抛出自定义异常以停止进程那个时候我如何处理我的返回响应,我想在客户端提供有意义的对象。最好的方法是什么?
@Before
MyHandler()
{
bool stop=checkvalue();
if(stop==false)
continue...
else
{
//break all process
and return custom response to client
//throw exception but meaningfullresponse??
}
}