|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.mindmatters.faces.spring.AbstractScope
Wraps and enables JSF specific scope definition and management for a bean declared in any spring context.
AbstractScope can scope beans declared as prototype. If the bean to scope is
declared in a parent context, the name of the bean and the name of the scope
should be defined identically. If the bean to scope is declared in the same
context as the scope, the names of the beans should differ - the property
targetBeanName
should be set to the name of the bean to scope.
Furthermore it is possible to set the bean to scope directly - the property
targetBean
should be set with the bean to scope. With
jsf-spring's ability to interpret the jsf-ExpressionLanguage,
sophisticated bean scoping is possible.
Field Summary | |
protected org.apache.commons.logging.Log |
logger
For logging. |
Constructor Summary | |
AbstractScope()
|
Method Summary | |
void |
afterPropertiesSet()
Check the name of this bean and the targetBeanName . |
java.lang.Object |
getObject()
Returns the cached or newly created bean which is scoped by this factory. |
java.lang.Class |
getObjectType()
|
protected abstract java.util.Map |
getScopeMap()
Returns the appropriate scope from the external context of the faces implementation. |
protected void |
initScope()
Hook for initialization purposes. |
boolean |
isSingleton()
|
void |
refresh()
Refreshs this scope, removing the scoped bean from the specific faces scope. |
void |
setApplicationContext(ApplicationContext applicationContext)
. |
void |
setBeanName(java.lang.String beanName)
. |
void |
setTargetBean(java.lang.Object targetBean)
Sets the created bean targetBean to scope.
|
void |
setTargetBeanName(java.lang.String targetBeanName)
Sets the name of a bean to scope. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final org.apache.commons.logging.Log logger
Constructor Detail |
public AbstractScope()
Method Detail |
public final void afterPropertiesSet()
targetBeanName
.
afterPropertiesSet
in interface InitializingBean
java.lang.IllegalArgumentException
- if properties are not configured properlyInitializingBean.afterPropertiesSet()
protected void initScope()
java.lang.IllegalArgumentException
- if properties are not configured properlypublic final void refresh()
java.lang.IllegalArgumentException
- if properties are not configured properlypublic final void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext
in interface ApplicationContextAware
public final void setBeanName(java.lang.String beanName)
setBeanName
in interface BeanNameAware
protected abstract java.util.Map getScopeMap()
java.lang.IllegalStateException
- if scope could not be created (e.g. the FacesContext is
null
)public final java.lang.Object getObject()
getObject
in interface FactoryBean
java.lang.IllegalArgumentException
java.lang.IllegalStateException
BeanCreationException
getScopeMap()
,
FactoryBean.getObject()
public final java.lang.Class getObjectType()
getObjectType
in interface FactoryBean
public final boolean isSingleton()
isSingleton
in interface FactoryBean
public final void setTargetBeanName(java.lang.String targetBeanName)
targetBean
must not be
set.
targetBeanName
- The targetBeanName to set.public final void setTargetBean(java.lang.Object targetBean)
targetBean
to scope.
targetBeanName
must not be set.
targetBean
- The bean to scope.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |