Java Code Examples for org.aopalliance.intercept.MethodInvocation#getArguments()

The following examples show how to use org.aopalliance.intercept.MethodInvocation#getArguments() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CMISTransactionAwareHolderInterceptor.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
@SuppressWarnings("unchecked")
public Object invoke(MethodInvocation invocation) throws Throwable
{
    Class<?>[] parameterTypes = invocation.getMethod().getParameterTypes();
    Object[] arguments = invocation.getArguments();
    for (int i = 0; i < parameterTypes.length; i++)
    {
        if (Holder.class.isAssignableFrom(parameterTypes[i]) && arguments[i] != null)
        {
            TransactionAwareHolder txnHolder = new TransactionAwareHolder(((Holder) arguments[i]));
            arguments[i] = txnHolder;
        }
    }
    return invocation.proceed();
}
 
Example 2
Source File: ConditionedInterceptor.java    From NoraUi with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
    //
    Method m = invocation.getMethod();

    if (m.isAnnotationPresent(Conditioned.class)) {
        Object[] arg = invocation.getArguments();
        if (arg.length > 0 && arg[arg.length - 1] instanceof List && !((List) arg[arg.length - 1]).isEmpty() && ((List) arg[arg.length - 1]).get(0) instanceof GherkinStepCondition) {
            List<GherkinStepCondition> conditions = (List) arg[arg.length - 1];
            displayMessageAtTheBeginningOfMethod(m.getName(), conditions);
            if (!checkConditions(conditions)) {
                Context.getCurrentScenario().write(Messages.getMessage(SKIPPED_DUE_TO_CONDITIONS));
                Context.goToNextStep();
                return Void.TYPE;
            }
        }
    }

    log.debug("NORAUI ConditionedInterceptor invoke method {}", invocation.getMethod());
    return invocation.proceed();
}
 
Example 3
Source File: ThrowsAdviceInterceptor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
private void invokeHandlerMethod(MethodInvocation mi, Throwable ex, Method method) throws Throwable {
	Object[] handlerArgs;
	if (method.getParameterCount() == 1) {
		handlerArgs = new Object[] {ex};
	}
	else {
		handlerArgs = new Object[] {mi.getMethod(), mi.getArguments(), mi.getThis(), ex};
	}
	try {
		method.invoke(this.throwsAdvice, handlerArgs);
	}
	catch (InvocationTargetException targetEx) {
		throw targetEx.getTargetException();
	}
}
 
Example 4
Source File: DTXInfo.java    From tx-lcn with Apache License 2.0 5 votes vote down vote up
public static DTXInfo getFromCache(MethodInvocation methodInvocation) {
    String signature = methodInvocation.getMethod().toString();
    String unitId = Transactions.unitId(signature);
    DTXInfo dtxInfo = dtxInfoCache.get(unitId);
    if (Objects.isNull(dtxInfo)) {
        dtxInfo = new DTXInfo(methodInvocation.getMethod(),
                methodInvocation.getArguments(), methodInvocation.getThis().getClass());
        dtxInfoCache.put(unitId, dtxInfo);
    }
    dtxInfo.reanalyseMethodArgs(methodInvocation.getArguments());
    return dtxInfo;
}
 
Example 5
Source File: ThrowsAdviceInterceptor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void invokeHandlerMethod(MethodInvocation mi, Throwable ex, Method method) throws Throwable {
	Object[] handlerArgs;
	if (method.getParameterTypes().length == 1) {
		handlerArgs = new Object[] { ex };
	}
	else {
		handlerArgs = new Object[] {mi.getMethod(), mi.getArguments(), mi.getThis(), ex};
	}
	try {
		method.invoke(this.throwsAdvice, handlerArgs);
	}
	catch (InvocationTargetException targetEx) {
		throw targetEx.getTargetException();
	}
}
 
Example 6
Source File: DecodeInterceptor.java    From boubei-tss with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
   public Object invoke(MethodInvocation invocation) throws Throwable {
    Object target = invocation.getThis();
    String methodName = invocation.getMethod().getName();
    
    switch (judgeManipulateKind(methodName)) {
       case SAVE:
       case UPDATE:
       	IDao<IEntity> dao = (IDao<IEntity>) target;
   		Object[] args = invocation.getArguments();
   		if(args == null || !( BeanUtil.isImplInterface(dao.getType(), IDecodable.class)) ) {
   		    return invocation.proceed();
   		}
   		
           for (int i = 0; i < args.length; i++) {
               if (args[i] instanceof IDecodable) {
                   IDecodable entity = (IDecodable) args[i];
                   String oldDecode = entity.getDecode();
                   ((ITreeSupportDao<IDecodable>)target).saveDecodeableEntity(entity);
                   
                   /* 移动时维护(修复)所有子节点的decode值。不包括节点自身 
                    * oldDecode == null 说明为新增出来的节点,肯定没有子节点,也就没必要维护子节点了
                    * */
                   if(methodName.startsWith("move") && oldDecode != null) {
                       repairChildrenDecode(entity, oldDecode, dao);
                   }
               }
           }	
       	break;
       }
       
       return invocation.proceed();
}
 
Example 7
Source File: ResourcePermissionInterceptor.java    From boubei-tss with Apache License 2.0 5 votes vote down vote up
public Object invoke(MethodInvocation invocation) throws Throwable {
	Object[] args = invocation.getArguments();
       
       IResource resource = null;
       if(args != null) {
       	for (int i = 0; i < args.length; i++) {
   			if (args[i] instanceof IResource) {
   				resource = (IResource) args[i];
   				break;
   			}
           }
       }
	if( resource == null) {
        return invocation.proceed();			
	}	
	
	String methodName = invocation.getMethod().getName();
	switch (judgeManipulateKind(methodName)) {
		/* 
		 * 新增时注册资源。
         * 注:修改的时候也会被本拦截器拦住,但IResourcePermission.addResource方法会判断节点的权限是否已经补齐了, 如果已经补齐则不再补齐。 
		 */
		case SAVE:
			Object returnObj = invocation.proceed();
            addResource(resource);  //拦截新增资源的权限补齐操作需要在新增保存完成后。
			return returnObj;
		// 移动资源
		case MOVE: 
            returnObj = invocation.proceed();
            moveResource(resource); // 拦截移动资源的权限重新补齐操作需要在整个枝移动保存完成后。
            return returnObj;
        // 删除资源
		case DELETE:
			deleteResource(resource);
			break;
	}

       return invocation.proceed();
}
 
Example 8
Source File: NativeQueryInfo.java    From spring-native-query with MIT License 5 votes vote down vote up
public static void setParameters(NativeQueryInfo info, MethodInvocation invocation) {
    info.sql = null;
    info.sort = null;
    info.parameterList = new ArrayList<>();
    info.pageable = null;
    for (int i = 0; i < invocation.getArguments().length; i++) {
        Object argument = invocation.getArguments()[i];
        Parameter parameter = invocation.getMethod().getParameters()[i];
        if (parameter.getType().isAssignableFrom(Pageable.class)) {
            info.pageable = (Pageable) argument;
            if (info.sort == null) {
                info.sort = info.pageable.getSort();
            }
        } else if (parameter.getType().isAssignableFrom(Sort.class)) {
            info.sort = (Sort) argument;
        } else {
            if (parameter.isAnnotationPresent(NativeQueryParam.class)) {
                NativeQueryParam param = parameter.getAnnotation(NativeQueryParam.class);
                if (param.addChildren()) {
                    info.parameterList.addAll(NativeQueryParameter.ofDeclaredMethods(param.value(), parameter.getType(), argument));
                } else {
                    if (argument instanceof Map) {
                        info.parameterList.addAll(NativeQueryParameter.ofMap((Map) argument, param.value()));
                    } else {
                        info.parameterList.add(new NativeQueryParameter(param.value(), param.operator().getTransformParam().apply(argument)));
                    }
                }
            } else {
                if (argument instanceof Map) {
                    info.parameterList.addAll(NativeQueryParameter.ofMap((Map) argument, parameter.getName()));
                } else {
                    info.parameterList.add(new NativeQueryParameter(parameter.getName(), argument));
                }
            }
        }
    }
}
 
Example 9
Source File: AccessLogMethodInterceptor.java    From fast-family-master with Apache License 2.0 5 votes vote down vote up
private AccessLogInfo createAccessLogInfo(MethodInvocation methodInvocation) {
    AccessLogInfo accessLogInfo = new AccessLogInfo();
    HttpServletRequest request = WebUtils.getHttpServletRequest();
    accessLogInfo.setUrl(request.getRequestURI());
    accessLogInfo.setIp(WebUtils.getClientIP(request));
    accessLogInfo.setRequestTime(System.currentTimeMillis());
    accessLogInfo.setHeaderParams(WebUtils.getRequestHeaders(request));
    accessLogInfo.setRequestParams(WebUtils.getRequestParameters(request));
    accessLogInfo.setApplyName(applicationName);
    //获取请求参数
    methodInvocation.getArguments();
    return accessLogInfo;
}
 
Example 10
Source File: TransactionInterceptor.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public Participant buildParticipant(MethodInvocation invocation) {
	Object target = invocation.getThis();
	Class<?> targetClass = target.getClass();
	Method method = invocation.getMethod();
	Object[] arguments = invocation.getArguments();
	
	return ParticipantBuilder.build(null, targetClass, method, arguments);
}
 
Example 11
Source File: ThrowsAdviceInterceptor.java    From java-technology-stack with MIT License 5 votes vote down vote up
private void invokeHandlerMethod(MethodInvocation mi, Throwable ex, Method method) throws Throwable {
	Object[] handlerArgs;
	if (method.getParameterCount() == 1) {
		handlerArgs = new Object[] {ex};
	}
	else {
		handlerArgs = new Object[] {mi.getMethod(), mi.getArguments(), mi.getThis(), ex};
	}
	try {
		method.invoke(this.throwsAdvice, handlerArgs);
	}
	catch (InvocationTargetException targetEx) {
		throw targetEx.getTargetException();
	}
}
 
Example 12
Source File: NettyRpcInterceptor.java    From BootNettyRpc with Apache License 2.0 4 votes vote down vote up
@Override
public Object invoke(MethodInvocation methodInvocation) throws Throwable {

    Method method = methodInvocation.getMethod();
    Object[] args = methodInvocation.getArguments();

    RpcClientEntity entity = getRpcClient( (Class) annotationValues.get( "interfaze" ) );
    NettyRpcRequest request = buildRequest( entity, method, args );
    ConnectionEntity connectionEntity = findCandidateConnection( entity );
    if (connectionEntity != null) {
        //  LOG.info( "run connectionEntity:" + connectionEntity.toString() );
        RequestInterceptor interceptor = (RequestInterceptor) NettyRpcApplication.getBean( "requestInterceptor" );
        if (request.isSyn()) {
            Object object = interceptor.invokeSync( connectionEntity.getChannelFuture(), request );
            if (object instanceof NettyRpcResponse) {
                NettyRpcResponse response = (NettyRpcResponse) object;

                return response.getResult();
            }
        } else {
            interceptor.invokeAsync( connectionEntity.getChannelFuture(), request );
        }
        return null;
    } else {
        AppEntity appEntity = new AppEntity();
        BeanUtils.copyProperties( entity, appEntity );
        ExcutorContainer excutorContainer = (ExcutorContainer) NettyRpcApplication.getBean( "excutorContainer" );
        NettyClientExcutor excutor = (NettyClientExcutor) excutorContainer.getClientExcutor();
        synchronized (NettyRpcInterceptor.class) {
            try {
                if (excutor.started( appEntity )) {
                    return invoke( methodInvocation );
                }
                excutor.start( appEntity );
                while (!excutor.started( appEntity )) {
                }
                return invoke( methodInvocation );
            } catch (Exception e) {
                e.printStackTrace();
                return null;
            }
        }
    }

}
 
Example 13
Source File: QueryCacheInterceptor.java    From boubei-tss with Apache License 2.0 4 votes vote down vote up
public Object invoke(MethodInvocation invocation) throws Throwable {
      Method targetMethod = invocation.getMethod(); /* 获取目标方法 */
      Object[] args = invocation.getArguments();    /* 获取目标方法的参数 */
      
      QueryCached annotation = targetMethod.getAnnotation(QueryCached.class); // 取得注释对象
      if (annotation == null) {
      	return invocation.proceed(); /* 如果没有配置缓存,则直接执行方法并返回结果 */
      }
 
      int limit = annotation.limit();
AbstractPool qCache = (AbstractPool) CacheHelper.getShortCache(); /* 使用10分钟Cache */

// 检查当前等待线程数(执行中 + 等待中)
int V = EasyUtils.obj2Int( ParamManager.getValue(PX.MAX_QUERY_REQUEST, "" + MAX_QUERY_REQUEST) );
int X = countThread(qCache, V);
if( X > V ) {
	if( !IS_BUSY ) { // 第一次出现时,已经紧张了无需提醒
		IS_BUSY = true;
		String qCacheInfo = qCache.getUsing().toString();
		log.info( EX.CACHE_1 + ": " + qCacheInfo);
		MailUtil.send(EX.CACHE_1, qCacheInfo);
	}
	throw new BusinessException(EX.CACHE_1 + X + ">" + V);
} 
else {
	IS_BUSY = false;
}

/* 检查当前查询服务(报表服务等)在等待队列中是否超过了阈值(X)25%,超过则不再接受新的查询请求,以防止单个服务耗尽队列。
 * 注:如果数据源出现异常,请求长时间处于等待获取连接的状态,还是会出现耗尽线程的情形,此时需做的是:关闭该异常数据源。
 */
if( limit >= 0) {
	Object limitArg = (args.length > limit ? args[limit] : "" );
	int count = countService(qCache, targetMethod.getName(), limitArg);
	if(count > V*0.25) {
		throw new BusinessException(EX.parse(EX.CACHE_4, limitArg, count));
	}
}
      
      String qKey = "QC_" + CacheInterceptor.cacheKey(targetMethod, args);
      Cacheable qcItem = qCache.getObject(qKey); // item.hit++

Object returnVal;
long currentThread = Environment.threadID();
String visitor = Environment.getUserName();

if (qcItem != null) {
	String _visitors = EasyUtils.obj2String(qcItem.getValue());
	if( Arrays.asList( _visitors.split(",") ).contains(visitor) ) {
		throw new BusinessException(EX.CACHE_2 + Arrays.asList(args));
	}
	
	qcItem.update( _visitors + "," + visitor ); // 记录是哪几个人、及第几个到访
	log.debug( currentThread + " QueryCache["+qKey+"]= " + qcItem.getHit() );
	
	// 等待执行中的上一次请求先执行完成; 
	long start = System.currentTimeMillis();
	while( qCache.contains(qKey) ) { // 说明NO.1 Query还在执行中
		log.debug(currentThread + " QueryCache waiting...");
		Thread.sleep( 3000 * Math.min(Math.max(1, qcItem.getHit()), 10) ); //等待的线程越多,则sleep时间越长
		
		// 超过10分钟,说明执行非常缓慢,则不再继续等待,同时抛错提示用户。
		if(System.currentTimeMillis() - start > MAX_QUERY_TIME) {
			throw new BusinessException(EX.CACHE_3);
		}
	}
	
	// QC_cache 已经被destroy
	returnVal = invocation.proceed(); // 此时去执行查询,结果已经在3分钟的cache中
} 
else {
	Cacheable item = qCache.putObject(qKey, visitor); // 缓存访问用户作为[执行中标记]
	
	/* 放到using池中,以免出现以下情形:
	 * 如果一次报表查询超过了10分钟,其QC_对象已经被清除,但SQL还在继续执行,此时将捕捉不到是哪个Report异常 */
	qCache.getFree().remove(qKey);
	qCache.getUsing().put(qKey, item);
	
	log.debug(currentThread + " QueryCache["+qKey+"] first time executing...");
	
	/* 执行方法,进入CacheInterceptor,查询成功后结果将被缓存3分钟  */
	try {
		returnVal = invocation.proceed();
	} catch(Exception e) {
		throw e;
	} finally {
		qCache.destroyByKey(qKey); // 移除销毁缓存的执行信息(出现异常时也要移除)
	}
}

      return returnVal;
  }
 
Example 14
Source File: RemoteInvocation.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a new RemoteInvocation for the given AOP method invocation.
 * @param methodInvocation the AOP invocation to convert
 */
public RemoteInvocation(MethodInvocation methodInvocation) {
	this.methodName = methodInvocation.getMethod().getName();
	this.parameterTypes = methodInvocation.getMethod().getParameterTypes();
	this.arguments = methodInvocation.getArguments();
}
 
Example 15
Source File: XssResolveAdviceInterceptor.java    From super-cloudops with Apache License 2.0 4 votes vote down vote up
@Override
public Object invoke(MethodInvocation invc) throws Throwable {
	Object controller = invc.getThis();
	Method md = invc.getMethod();
	try {
		// Type or method exist @UnsafeXss ignore?
		if (controller.getClass().isAnnotationPresent(UnsafeXss.class) || md.isAnnotationPresent(UnsafeXss.class)) {
			return invc.proceed();
		}

		Object[] args = invc.getArguments();
		if (!isNull(args)) {
			next: for (int i = 0; i < args.length; i++) {
				if (args[i] == null)
					continue;

				// Parameter ignore?
				for (Annotation[] anns : md.getParameterAnnotations()) {
					for (Annotation an : anns) {
						if (an.annotationType() == UnsafeXss.class) {
							continue next;
						}
					}
				}

				// Parameter declared type ignore?
				if (args[i].getClass().isAnnotationPresent(UnsafeXss.class)) {
					continue next;
				}

				// Processing HttpServlet request(if necessary)
				args[i] = processHttpRequestIfNecessary(args[i]);

				if (args[i] instanceof String) {
					args[i] = stringXssEncode(controller, md, i, (String) args[i]);
				} else {
					objectXssEnode(controller, md, i, args[i]);
				}
			}
		}
	} catch (Throwable e) {
		log.error("XSS resolving failure. causes at: ", e);
	}

	// Sets XSS protection headers.
	setXssProtectionHeadersIfNecessary(controller, md);

	return invc.proceed();
}
 
Example 16
Source File: RemoteInvocation.java    From java-technology-stack with MIT License 4 votes vote down vote up
/**
 * Create a new RemoteInvocation for the given AOP method invocation.
 * @param methodInvocation the AOP invocation to convert
 */
public RemoteInvocation(MethodInvocation methodInvocation) {
	this.methodName = methodInvocation.getMethod().getName();
	this.parameterTypes = methodInvocation.getMethod().getParameterTypes();
	this.arguments = methodInvocation.getArguments();
}
 
Example 17
Source File: BusinessLogInterceptor.java    From boubei-tss with Apache License 2.0 4 votes vote down vote up
public Object invoke(MethodInvocation invocation) throws Throwable {
     Method targetMethod = invocation.getMethod(); /* 获取目标方法 */
     Object[] args = invocation.getArguments(); /* 获取目标方法的参数 */
     
     Long preTime = System.currentTimeMillis();
     Object returnVal = invocation.proceed(); /* 调用目标方法的返回值 */
     
     int methodExcuteTime = (int) (System.currentTimeMillis() - preTime);

     Logable annotation = targetMethod.getAnnotation(Logable.class); // 取得注释对象
     if (annotation != null) {

         String operateTable = annotation.operateObject();
         String operateInfo = annotation.operateInfo();
         
         String operateMethod = targetMethod.getName();
         
         returnVal = EasyUtils.checkNull(returnVal, "_null_");
         Map<String, Object> data = new HashMap<String, Object>();
         data.put("returnVal", returnVal);
         
         Class<? extends Object> rvClazz = returnVal.getClass();
Table table = rvClazz.getAnnotation(Table.class);
         if( table != null ) {
         	// 检测数据表是否配置了忽略日志,eg:取号器等
         	LogDisable logDisable = rvClazz.getAnnotation(LogDisable.class);
         	if( logDisable != null ) {
         		return returnVal;
         	}
         	
         	if( "${table}".equals(operateTable) ) {
         		operateTable = table.name();
         	}
         	data.put("tableName", operateTable);
         }
         if( returnVal instanceof IEntity ) {
         	operateMethod += ", " + ((IEntity)returnVal).getPK();
         }

         Log log = new Log(operateMethod, parseMacro(operateInfo, args, data));
         log.setOperateTable(operateTable);
         log.setMethodExcuteTime(methodExcuteTime);

         businessLogger.output(log);
     }

     return returnVal;
 }
 
Example 18
Source File: RemoteInvocation.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Create a new RemoteInvocation for the given AOP method invocation.
 * @param methodInvocation the AOP invocation to convert
 */
public RemoteInvocation(MethodInvocation methodInvocation) {
	this.methodName = methodInvocation.getMethod().getName();
	this.parameterTypes = methodInvocation.getMethod().getParameterTypes();
	this.arguments = methodInvocation.getArguments();
}
 
Example 19
Source File: AccessLogInterceptor.java    From boubei-tss with Apache License 2.0 4 votes vote down vote up
public Object invoke(MethodInvocation invocation) throws Throwable {
    Method targetMethod = invocation.getMethod(); /* 获取目标方法 */
    Object[] args = invocation.getArguments(); /* 获取目标方法的参数 */
    String methodName = targetMethod.getName();

    Access annotation = targetMethod.getAnnotation(Access.class); // 取得注释对象
    if (annotation == null) {
        return invocation.proceed(); /* 如果没有配置分析,则直接执行方法并返回结果 */
    }
    
    // 在方法被正式执行前,先把参数转成字符串记录下来(以防在方法里把参数给修改了)
    StringBuffer buffer = new StringBuffer();
    for (Object arg : args) {
    	if(buffer.length() > 0) {
    		buffer.append(",");
    	}
    	
    	if(arg instanceof String || arg instanceof Number) {
    		buffer.append(arg);
    	}
    	else if(arg instanceof Date) {
   		 	buffer.append( DateUtil.formatCare2Second((Date) arg) );
    	}
    	else {
    		String argString = ToStringBuilder.reflectionToString(arg, ToStringStyle.SHORT_PREFIX_STYLE);
buffer.append(argString);
    	}
    }

    String params = DMUtil.cutParams( buffer.toString() );

    // 执行方法
    long start = System.currentTimeMillis();
    Object returnVal = invocation.proceed();

    // 方法的访问日志记录成败不影响方法的正常访问,所以对记录日志过程中各种可能异常进行try catch
    try {
        AccessLog log = new AccessLog( start, params );
        log.setClassName(targetMethod.getDeclaringClass().getName());
		log.setMethodName(methodName);
		log.setMethodCnName(annotation.methodName());

        AccessLogRecorder.getInstanse().output(log);
    } 
    catch(Exception e) {
    	// log.error("记录方法【" + methodName + "】的访问日志时出错了。错误信息:" + e.getMessage());
    }

    return returnVal;
}
 
Example 20
Source File: OperateInfoInterceptor.java    From boubei-tss with Apache License 2.0 4 votes vote down vote up
public Object invoke(MethodInvocation invocation) throws Throwable {
	Object target = invocation.getThis();
	Object[] args = invocation.getArguments();
	args = (Object[]) EasyUtils.checkNull(args, new Object[]{});
	
       for (int i = 0; i < args.length; i++) {
           int manipulateKind = judgeManipulateKind(invocation.getMethod().getName());
           if (args[i] instanceof IOperatable 
           		&& (manipulateKind == SAVE || manipulateKind == UPDATE)) {
              
               IOperatable opObj = (IOperatable) args[i];
               Serializable pk = ((IEntity)opObj).getPK();
               
			if( pk == null ) { // ID为null,说明是新建
                   opObj.setCreateTime(new Date());
                   opObj.setCreatorId(Environment.getUserId());
                   opObj.setCreatorName(Environment.getUserName());  
                   
                   // 定时器写数据时,域信息已经指定
                   String domain = (String) EasyUtils.checkNull( opObj.getDomain(), Environment.getDomainOrign() );
                   opObj.setDomain(domain);
               } 
               else {
                   opObj.setUpdateTime(new Date());
                   opObj.setUpdatorId(Environment.getUserId());
                   opObj.setUpdatorName(Environment.getUserName());  
                   
                   /* 修改后,createTime的时分秒没了(日期传递到前台时截去了时分秒,保存后就没有了),
                    * update时不要前台传入的createTime,而是从DB查出来复制回去
                    */
                   @SuppressWarnings("unchecked")
                   IDao<IEntity> dao = (IDao<IEntity>) target;
                   IOperatable old = (IOperatable) dao.getEntity( opObj.getClass(), pk);
                   old = (IOperatable) EasyUtils.checkNull(old, opObj); // 可能修改时记录已被其它人[删除]
                   opObj.setCreateTime(old.getCreateTime());
               }
           }
       }
		
       return invocation.proceed();
}