public abstract class AbstractListenerFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
FactoryBean implementation that builds a listener based on the
various lifecycle methods or annotations that are provided. There are three
possible ways of having a method called as part of a listener lifecycle:
ListenerMetaData value in the metaDataMap.
ListenerMetaData| Constructor and Description |
|---|
AbstractListenerFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected abstract Class<?> |
getDefaultListenerClass() |
protected abstract ListenerMetaData |
getMetaDataFromPropertyName(String propertyName) |
protected abstract ListenerMetaData[] |
getMetaDataValues() |
protected MethodInvoker |
getMethodInvokerByName(String methodName,
Object candidate,
Class<?>... params) |
Object |
getObject() |
static boolean |
isListener(Object target,
Class<?> listenerType,
ListenerMetaData[] metaDataValues)
Convenience method to check whether the given object is or can be made
into a listener.
|
boolean |
isSingleton() |
void |
setDelegate(Object delegate) |
void |
setMetaDataMap(Map<String,String> metaDataMap) |
public Object getObject()
getObject in interface org.springframework.beans.factory.FactoryBeanprotected abstract ListenerMetaData getMetaDataFromPropertyName(String propertyName)
protected abstract ListenerMetaData[] getMetaDataValues()
protected abstract Class<?> getDefaultListenerClass()
protected MethodInvoker getMethodInvokerByName(String methodName, Object candidate, Class<?>... params)
public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBeanpublic void setDelegate(Object delegate)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic static boolean isListener(Object target, Class<?> listenerType, ListenerMetaData[] metaDataValues)
target - the object to checkCopyright © 2013. All Rights Reserved.