Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.myfaces.orchestra.conversation.spring
Class _SpringUtils

    java.lang.Object
      org.apache.myfaces.orchestra.conversation.spring._SpringUtils

    public final class _SpringUtils

extends java.lang.Object

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

### isModifiedBeanName

    public static boolean isModifiedBeanName(java.lang.String beanName)

  Detect the case where a class includes a nested aop:scoped-target tag.

  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.

  Since:
    1.1

### getOriginalBeanName

    public 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).

  Since:
    1.1

### getModifiedBeanName

    public 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.

  Since:
    1.1

### isAlternateBeanName

    public static boolean isAlternateBeanName(java.lang.String beanName)

  Deprecated. use isModifiedBeanName instead.

### getAlternateBeanName

    public static java.lang.String getAlternateBeanName(java.lang.String beanName)

  Deprecated. use getModifiedBeanName instead.

### getRealBeanName

    public static java.lang.String getRealBeanName(java.lang.String beanName)

  Deprecated. use getOriginalBeanName instead.

### newProxy

    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)

  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.

  The proxy returned currently also currently implements the standard Spring ScopedObject interface; this is experimental and may be removed if not useful.

  Since:
    1.1

### getTargetObject

    public static java.lang.Object getTargetObject(java.lang.Object proxy)
                                            throws java.lang.Exception

  Given a proxy object, return the underlying object that it currently refers to.

  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.

  Throws:
    `java.lang.Exception`
  Since:
    1.3

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 The Apache Software Foundation. All Rights Reserved.