|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.jee.inject.Jsr250Metadata
org.springframework.jee.intercept.InterceptionMetadata
public class InterceptionMetadata
Class representing metadata for a component that may have interceptors as per the JEE (EJB 3.0) interception specification. Attached to a Spring singleton definition.
Nested Class Summary | |
---|---|
static class |
InterceptionMetadata.InterceptorExclusion
Class representing the exclusion of class or default interceptors from a particular method |
Field Summary |
---|
Fields inherited from class org.springframework.jee.inject.Jsr250Metadata |
---|
KEY |
Constructor Summary | |
---|---|
InterceptionMetadata(DeploymentUnitMetadataI dum,
String name,
Class<?> componentClass)
|
Method Summary | |
---|---|
protected int |
addAspectJAdvisors(Advised advised,
Object bean)
|
void |
addBeanControlInterfaceMethod(Method method)
|
void |
addBusinessInterface(Class<?> businessInterface)
Add a business interface for the singleton. |
protected void |
addComponentContractInterceptors(ProxyFactory pf,
Object target,
Map<Class,Object> interceptorInstancesForClass)
Add interceptors that apply the component contract--such as EJB transaction behaviour. |
protected void |
addJeeInterceptors(Advised advised,
List<InterceptorMetadataI> interceptorMetadata,
Map<Class,Object> interceptorInstancesForClass,
boolean isInterceptorOrder)
Parses the interceptor metadata list, creates Spring pointcut advisors based on it and adds it to the given advised object. |
protected void |
addJeeInterceptors(Advised advised,
Object bean,
Map<Class,Object> interceptorInstancesForClass)
Add EJB3 style interceptors to this singleton instance |
protected void |
addSelfInterceptor(Advised advised,
Object bean)
Add an interceptor definition for the singleton/bean itself. |
protected int |
addSpringAopAdvisors(Advised pf,
Object bean)
|
protected void |
addSuperInterceptors(Advised advised,
Object baseInterceptorInstance,
List<Method> superAroundInvokeMethods,
JeeInterceptorPointcutAdvisor baseInterceptorPointcutAdvisor)
|
Object |
createProxyIfNecessary(Object target)
Use Spring AOP to create a proxy invoking the JEE-style interceptors and any Spring-style interceptors. |
Object |
createProxyIfNecessary(Object target,
Map<Class,Object> interceptorInstancesForClass)
Use Spring AOP to create a proxy invoking the JEE-style interceptors and any Spring-style interceptors. |
protected void |
customizeProxyConfig(ProxyFactory pf)
Perform optional customization of ProxyFactory before use |
List<Class<?>> |
findBusinessInterfacesFromClassOrAnnotation(Class<?> clazz)
|
Class |
getBeanControlInterface()
|
Set<Method> |
getBeanControlInterfaceMethods()
|
List<Class<?>> |
getBusinessInterfaces()
|
Map<Object,InterceptionMetadata.InterceptorExclusion> |
getExclusion()
|
List<InterceptorMetadataI> |
getInterceptorMetadata()
Return the interceptors that apply to the given component. |
List<InterceptorMetadataI> |
getInterceptorOrder(Object object)
|
void |
invokeLifecycleMethods(Object bean,
LifecycleEvent le)
Override superclass method to invoke all interceptors in the chain if they listen to this method |
protected void |
invokePostConstructAndRegisterShutdownHook(Object instance)
|
protected boolean |
isExcludedAsBusinessInterfaceOnAutodetect(Class<?> potentialBusinessInterface)
Subclasses can override this to exclude further business interfaces |
void |
registerInterceptorMetadata(InterceptorMetadataI im)
Add interceptor metadata. |
void |
registerInterceptorOrder(InterceptorMetadataI im,
Object object)
|
void |
registerSelfInterceptorMethod(Method selfInterceptorMethod)
Set the self interceptor method for this component |
void |
setBeanControlInterface(Class beanControlInterface)
|
void |
setBeanControlInterfaceMethods(Set<Method> beanControlInterfaceMethods)
|
void |
setComponentContext(ApplicationContext componentContext,
BeanDefinitionRegistry bdr)
Set the application context for the superclass and for the inner interceptorMetadata. |
void |
setExcludeClassInterceptors(Object methodOrClass)
|
void |
setExcludeDefaultInterceptors(Object methodOrClass)
|
Methods inherited from class org.springframework.jee.inject.Jsr250Metadata |
---|
addInjection, applyInjections, getBeanDefinition, getBeanDefinitionRegistry, getComponentClass, getComponentContext, getComponentName, getDeploymentUnitMetadata, getInjections, getLifecycleEventCallbackMethod, getUniqueInstanceOfType, inject, injectAndPostConstruct, invokeLifecycleMethod, invokeLifecycleMethod, refresh, registerLifecycleEventCallbackMethod, resolve, resolveByType, setBeanDefinition, setComponentContext, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.jee.interfaces.inject.Jsr250MetadataI |
---|
addInjection, getComponentClass, getComponentName, getDeploymentUnitMetadata, getInjections, getLifecycleEventCallbackMethod, inject, refresh, registerLifecycleEventCallbackMethod |
Constructor Detail |
---|
public InterceptionMetadata(DeploymentUnitMetadataI dum, String name, Class<?> componentClass)
Method Detail |
---|
public void setComponentContext(ApplicationContext componentContext, BeanDefinitionRegistry bdr)
setComponentContext
in class Jsr250Metadata
protected void invokePostConstructAndRegisterShutdownHook(Object instance)
invokePostConstructAndRegisterShutdownHook
in class Jsr250Metadata
public void registerSelfInterceptorMethod(Method selfInterceptorMethod)
registerSelfInterceptorMethod
in interface InterceptionMetadataI
selfInterceptorMethod
- the self interceptor method for this componentpublic void setBeanControlInterface(Class beanControlInterface)
setBeanControlInterface
in interface InterceptionMetadataI
public Class getBeanControlInterface()
public void setBeanControlInterfaceMethods(Set<Method> beanControlInterfaceMethods)
setBeanControlInterfaceMethods
in interface InterceptionMetadataI
public void addBeanControlInterfaceMethod(Method method)
public Set<Method> getBeanControlInterfaceMethods()
public void setExcludeClassInterceptors(Object methodOrClass)
setExcludeClassInterceptors
in interface InterceptionMetadataI
public void setExcludeDefaultInterceptors(Object methodOrClass)
setExcludeDefaultInterceptors
in interface InterceptionMetadataI
public Map<Object,InterceptionMetadata.InterceptorExclusion> getExclusion()
public void registerInterceptorMetadata(InterceptorMetadataI im)
registerInterceptorMetadata
in interface InterceptionMetadataI
im
- interceptormatchingMethod
- method to match onpublic List<InterceptorMetadataI> getInterceptorMetadata()
getInterceptorMetadata
in interface InterceptionMetadataI
public void registerInterceptorOrder(InterceptorMetadataI im, Object object)
registerInterceptorOrder
in interface InterceptionMetadataI
public List<InterceptorMetadataI> getInterceptorOrder(Object object)
public void addBusinessInterface(Class<?> businessInterface)
addBusinessInterface
in interface InterceptionMetadataI
businessInterface
- business interface to addpublic List<Class<?>> getBusinessInterfaces()
public List<Class<?>> findBusinessInterfacesFromClassOrAnnotation(Class<?> clazz)
findBusinessInterfacesFromClassOrAnnotation
in interface InterceptionMetadataI
protected boolean isExcludedAsBusinessInterfaceOnAutodetect(Class<?> potentialBusinessInterface)
potentialBusinessInterface
- candidate interface
public Object createProxyIfNecessary(Object target)
createProxyIfNecessary
in interface InterceptionMetadataI
instance
- the singleton instance to wrap in a proxy
public Object createProxyIfNecessary(Object target, Map<Class,Object> interceptorInstancesForClass)
createProxyIfNecessary
in interface InterceptionMetadataI
instance
- the singleton instance to wrap in a proxyinterceptorInstancesForClass
- map from interceptor class to instance of JEE interceptors
protected void addComponentContractInterceptors(ProxyFactory pf, Object target, Map<Class,Object> interceptorInstancesForClass)
pf
- ProxyFactory used to create proxyprotected void customizeProxyConfig(ProxyFactory pf)
pf
- public void invokeLifecycleMethods(Object bean, LifecycleEvent le)
invokeLifecycleMethods
in interface Jsr250MetadataI
invokeLifecycleMethods
in class Jsr250Metadata
singleton
- normally a proxyle
- lifecycle eventprotected void addJeeInterceptors(Advised advised, Object bean, Map<Class,Object> interceptorInstancesForClass)
advised
- Spring AOP proxy control interfacesingleton
- new JEE component instance being advised (intercepted)interceptorInstancesForClass
- map from interceptor class to interceptor instance. Used to
ensure that we have only one instance of each interceptor
class, as per Core Contract specification 11.7.protected void addJeeInterceptors(Advised advised, List<InterceptorMetadataI> interceptorMetadata, Map<Class,Object> interceptorInstancesForClass, boolean isInterceptorOrder)
advised
- interceptorMetadata
- interceptorInstancesForClass
- protected void addSuperInterceptors(Advised advised, Object baseInterceptorInstance, List<Method> superAroundInvokeMethods, JeeInterceptorPointcutAdvisor baseInterceptorPointcutAdvisor)
protected void addSelfInterceptor(Advised advised, Object bean)
advised
- AOP proxy control interfacesingleton
- target instance that contains an around invoke methodprotected int addSpringAopAdvisors(Advised pf, Object bean)
protected int addAspectJAdvisors(Advised advised, Object bean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |