|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.myfaces.orchestra.conversation.spring._SpringUtils
public final class _SpringUtils
Various Spring utilities used by the conversation framework
Notice: this class is not meant to be used outside of this library
Method Summary | |
---|---|
static java.lang.String |
getAlternateBeanName(java.lang.String beanName)
Deprecated. use getModifiedBeanName instead. |
static java.lang.String |
getModifiedBeanName(java.lang.String beanName)
Given a bean name "foo", if it refers to a scoped proxy then the bean definition that holds the original settings is now under another name, so return that other name so the original BeanDefinition can be found. |
static java.lang.String |
getOriginalBeanName(java.lang.String beanName)
Given the name of a BeanDefinition, if this is a fake name created by spring because an aop:scoped-proxy is now wrapping this object, then return the name of that scoped-proxy bean (ie the name that the user accesses this bean by). |
static java.lang.String |
getRealBeanName(java.lang.String beanName)
Deprecated. use getOriginalBeanName instead. |
static java.lang.Object |
getTargetObject(java.lang.Object proxy)
Given a proxy object, return the underlying object that it currently refers to. |
static boolean |
isAlternateBeanName(java.lang.String beanName)
Deprecated. use isModifiedBeanName instead. |
static boolean |
isModifiedBeanName(java.lang.String beanName)
Detect the case where a class includes a nested aop:scoped-target tag. |
static java.lang.Object |
newProxy(AbstractSpringOrchestraScope scope,
java.lang.String conversationName,
java.lang.String targetBeanName,
org.springframework.beans.factory.ObjectFactory objectFactory,
org.springframework.beans.factory.BeanFactory beanFactory)
Create an object that subclasses the concrete class of the BeanDefinition for the specified targetBeanName, and when invoked delegates to an instance of that type fetched from a scope object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isModifiedBeanName(java.lang.String beanName)
When a definition is present in the config file like this:
<bean name="foo" class="example.Foo" orchestra:foo="foo"> <....> <aop:scopedProxy/> </bean>then what Spring actually does is create two BeanDefinition objects, one with name "foo" that creates a proxy object, and one with name "scopedTarget.foo" that actually defines the bean of type example.Foo (see Spring class ScopedProxyUtils for details.
Using this pattern is very common with Orchestra, so we need to detect it and look for orchestra settings on the renamed bean definition rather than the one with the original name.
public static java.lang.String getOriginalBeanName(java.lang.String beanName)
public static java.lang.String getModifiedBeanName(java.lang.String beanName)
public static boolean isAlternateBeanName(java.lang.String beanName)
public static java.lang.String getAlternateBeanName(java.lang.String beanName)
public static java.lang.String getRealBeanName(java.lang.String beanName)
public static java.lang.Object newProxy(AbstractSpringOrchestraScope scope, java.lang.String conversationName, java.lang.String targetBeanName, org.springframework.beans.factory.ObjectFactory objectFactory, org.springframework.beans.factory.BeanFactory beanFactory)
The proxy returned currently also currently implements the standard Spring ScopedObject interface; this is experimental and may be removed if not useful.
public static java.lang.Object getTargetObject(java.lang.Object proxy) throws java.lang.Exception
This method is currently experimental; it works for the current Spring implementation of Orchestra but at the current time it is not known whether this functionality can be implemented for all dependency-injection frameworks. If it does, then it might later make sense to promote this up to the public Orchestra API.
Note that invoking this method will create the "target object" if it does not yet exist. There is currently no way of testing whether this will happen, ie null will never be returned from this method.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |