關於TargetServiceFactoryVisitable的疑問

javabill發表於2006-03-23
1。com.jdon.bussinessproxy.target.TargetServiceFactoryVisitable的實現在com.jdon.aop.reflection.MethodInvokerUtil.createTargetObject呼叫時得以實現,該方法程式碼如下

public Object createTargetObject(TargetServiceFactory targetServiceFactory, TargetMetaRequest targetMetaRequest) {
        Debug.logVerbose("[JdonFramework] now getTargetObject by visitor ", module);
        Object targetObjRef = null;
        try {

            if (targetMetaRequest.getTargetMetaDef().isEJB()) { //cache the ejb object
                ComponentVisitor cm = targetMetaRequest.getComponentVisitor();
                targetMetaRequest.setVisitableName(ComponentKeys.TARGETSERVICE_FACTORY);
                Debug.logVerbose(ComponentKeys.TARGETSERVICE_FACTORY + " in action (cache)", module);
                targetObjRef = cm.visit(targetMetaRequest);
            } else {
                Debug.logVerbose("[JdonFramework] not active targer service instance cache !!!!", module);

                targetObjRef = targetServiceFactory.create(targetMetaRequest.getTargetMetaDef());
            }
        } catch (Exception e) {
            Debug.logError("[JdonFramework]createTargetObject error: " + e, module);
        }
        return targetObjRef;
    }


TargetServiceFactoryVisitable 最終呼叫的還是targetServiceFactory.create(targetMetaRequest.getTargetMetaDef());不知道 “if (targetMetaRequest.getTargetMetaDef().isEJB()) { //cache the ejb object”有什麼作用
2。快取ejb,pojo物件好像都是在HttpSessionProxyVisitor來實現,不知道這個我理解對嗎

懇請闆闆橋老師給以解答,深表感謝。不會再象上次的回答了無音訊吧。

相關文章