org.apache.myfaces.orchestra.conversation.spring
Class ScopedBeanTargetSource
java.lang.Object
org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
org.apache.myfaces.orchestra.conversation.spring.ScopedBeanTargetSource
- All Implemented Interfaces:
- java.io.Serializable, org.springframework.aop.TargetClassAware, org.springframework.aop.TargetSource, org.springframework.beans.factory.BeanFactoryAware
public class ScopedBeanTargetSource
- extends org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
Used with a "scoping proxy" object as generated by _SpringUtils.newProxy.
When user code invokes any method on the proxy, it invokes getTarget on its
source object to get the "real" object, then invokes the same method on the
returned object.
Here the getTarget method is implemented by using an AbstractSpringOrchestraScope
object to look up the ConversationContext for the user, then a particular
Conversation instance (by name), then a bean within that Conversation.
TODO: deal with serialization issues here. When an http session containing
conversation-scoped beans is serialized, instances of this type will of course
be serialized too. But the "scope" and "objectFactory" members here are not
serializable. Somehow instances of this class need enough information to
relocate the appropriate objects on deserialization.
- Since:
- 1.1
- See Also:
- Serialized Form
Fields inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
logger |
Constructor Summary |
ScopedBeanTargetSource(AbstractSpringOrchestraScope scope,
java.lang.String conversationName,
java.lang.String targetBeanName,
org.springframework.beans.factory.ObjectFactory objectFactory,
org.springframework.beans.factory.BeanFactory beanFactory)
|
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setBeanFactory, setTargetBeanName, setTargetClass, toString, writeReplace |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ScopedBeanTargetSource
public ScopedBeanTargetSource(AbstractSpringOrchestraScope scope,
java.lang.String conversationName,
java.lang.String targetBeanName,
org.springframework.beans.factory.ObjectFactory objectFactory,
org.springframework.beans.factory.BeanFactory beanFactory)
getTarget
public java.lang.Object getTarget()
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2009 The Apache Software Foundation. All Rights Reserved.