Search in sources :

Example 1 with BusinessDelegateOperationExecutor

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;
}
Also used : DelegateOperationExecutorWrapper(com.pamirs.attach.plugin.mongodb.obj.DelegateOperationExecutorWrapper) PressureMeasureError(com.pamirs.pradar.exception.PressureMeasureError) BusinessDelegateOperationExecutor(com.pamirs.attach.plugin.mongodb.obj.BusinessDelegateOperationExecutor)

Aggregations

BusinessDelegateOperationExecutor (com.pamirs.attach.plugin.mongodb.obj.BusinessDelegateOperationExecutor)1 DelegateOperationExecutorWrapper (com.pamirs.attach.plugin.mongodb.obj.DelegateOperationExecutorWrapper)1 PressureMeasureError (com.pamirs.pradar.exception.PressureMeasureError)1