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:
- 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 |
Methods inherited from class org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource |
copyFrom, equals, getBeanFactory, getTargetBeanName, getTargetClass, hashCode, isStatic, releaseTarget, setBeanFactory, setTargetBeanName, setTargetClass, toString, writeReplace |
ScopedBeanTargetSource
public ScopedBeanTargetSource(AbstractSpringOrchestraScope scope,
String conversationName,
String targetBeanName,
org.springframework.beans.factory.ObjectFactory objectFactory,
org.springframework.beans.factory.BeanFactory beanFactory)
getTarget
public Object getTarget()
throws Exception
- Throws:
Exception
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.