1 16 package com.jdon.container.visitor; 17 18 import com.jdon.container.ContainerWrapper; 19 import com.jdon.container.access.TargetMetaRequest; 20 import com.jdon.container.finder.ContainerCallback; 21 import com.jdon.container.visitor.data.SessionContext; 22 import com.jdon.util.Debug; 23 24 31 public class ComponentOriginalVisitor implements ComponentVisitor{ 32 private final static String module = ComponentOriginalVisitor.class.getName(); 33 34 private ContainerCallback containerCallback; 35 public ComponentOriginalVisitor(ContainerCallback containerCallback) { 36 this.containerCallback = containerCallback; 37 } 38 39 40 41 44 public ContainerWrapper getContainerWrapper() { 45 return containerCallback.getContainerWrapper(); 46 } 47 53 public Object visit(TargetMetaRequest targetMetaRequest){ 54 Object o = null; 55 try{ 56 ContainerWrapper containerWrapper = containerCallback.getContainerWrapper(); 57 Debug.logVerbose("[JdonFramework] ComponentOriginalVisitor active:" + targetMetaRequest.getVisitableName(), module); 58 Visitable vo = (Visitable)containerWrapper.lookup(targetMetaRequest.getVisitableName()); 59 o = vo.accept(targetMetaRequest); 60 }catch(Exception ex){ 61 Debug.logError("[JdonFramework] ComponentOriginalVisitor active error: " + ex); 62 } 63 return o; 64 } 65 66 public SessionContext visitSessionContext(TargetMetaRequest targetMetaRequest){ 67 return (SessionContext)visit(targetMetaRequest); 68 } 69 70 } 71 | Popular Tags |