public class XXThread implements Callable<Object>{
private Object obj;
private OperationResult operationResult = new OperationResult();
public OperationResult getOperationResult(){
return operationResult;
}
public XXThread(Object obj){
this.obj = obj;
}
@Override
public Object call() throws Exception{
callXX();
return null;
}
private void callXX(){
try{
operationResult.setName("");
//此处执行业务代码
}
catch (Exception e){
operationResult.setSuccess(false);
}
}
}