com.jdon.container.visitor
Class HttpSessionProxyVisitor

java.lang.Object
  extended by com.jdon.container.visitor.HttpSessionProxyVisitor
All Implemented Interfaces:
ComponentVisitor, java.util.EventListener, javax.servlet.http.HttpSessionBindingListener

public class HttpSessionProxyVisitor
extends java.lang.Object
implements ComponentVisitor, javax.servlet.http.HttpSessionBindingListener

using HttpSession as those components that need be cached now there are three kinds type: ComponentKeys.PROXYINSTANCE_FACTORY ComponentKeys.TARGETSERVICE_FACTORY; ComponentKeys.SESSIONCONTEXT_FACTORY; PROXYINSTANCE_FACTORY and TARGETSERVICE_FACTORY are the factorys that create components that need be optimized, if every time create these components, it will cost performance. ComponentKeys.SESSIONCONTEXT_FACTORY is the factory of the state data from the web container. Decorator patterns. Decoratee is ComponentOriginVisitor Decorator is this class;

See Also:
container.xml

Constructor Summary
HttpSessionProxyVisitor(ComponentVisitor componentVisitor)
           
 
Method Summary
 ContainerWrapper getContainerWrapper()
           
 void removeObjects()
          remove all ejb references
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
           
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
          session destroyed.
 java.lang.Object visit(TargetMetaRequest targetMetaRequest)
          the object type saved in componentsboxs is decided by the method" visitableFactory.createVisitable.
 SessionContext visitSessionContext(TargetMetaRequest targetMetaRequest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpSessionProxyVisitor

public HttpSessionProxyVisitor(ComponentVisitor componentVisitor)
Method Detail

getContainerWrapper

public ContainerWrapper getContainerWrapper()
Specified by:
getContainerWrapper in interface ComponentVisitor

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
session destroyed. remove all references;

Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

visit

public java.lang.Object visit(TargetMetaRequest targetMetaRequest)
the object type saved in componentsboxs is decided by the method" visitableFactory.createVisitable. only ejb service need cached, pojo service not need.

Specified by:
visit in interface ComponentVisitor
Parameters:
targetMetaDef - TargetMetaDef
Returns:
Object

visitSessionContext

public SessionContext visitSessionContext(TargetMetaRequest targetMetaRequest)
Specified by:
visitSessionContext in interface ComponentVisitor

removeObjects

public void removeObjects()
remove all ejb references