use of com.pamirs.attach.plugin.mongodb.obj.BusinessDelegateOperationExecutor in project LinkAgent by shulieTech.
the class MongoDBMongoClientDelegateConstructorInterceptor method getParameter0.
@Override
public Object[] getParameter0(Advice advice) {
Object[] args = advice.getParameterArray();
Object target = advice.getTarget();
if (MongoClientPtCreate.createPtMongoClient.get()) {
BusinessDelegateOperationExecutor businessDelegateOperationExecutor = new BusinessDelegateOperationExecutor((MongoClientDelegate) target, args[2]);
args[3] = businessDelegateOperationExecutor;
if (MongoClientHolder.mongoHolder.get() == null) {
throw new PressureMeasureError("mongo 业务数据源找不到");
}
// 存放业务数据源对象和影子对象的关系
MongoClientHolder.mongoOperationExecutorMap.put(MongoClientHolder.mongoHolder.get(), businessDelegateOperationExecutor);
MongoClientHolder.mongoHolder.remove();
return args;
}
check(args[0], (Mongo) args[2]);
BusinessDelegateOperationExecutor ptDelegateOperationExecutor = new BusinessDelegateOperationExecutor((MongoClientDelegate) target, args[2]);
DelegateOperationExecutorWrapper delegateOperationExecutorWrapper = new DelegateOperationExecutorWrapper((MongoClientDelegate) target, args[2], ptDelegateOperationExecutor);
args[3] = delegateOperationExecutorWrapper;
return args;
}
Aggregations