Class DefaultInterceptorRegistry
java.lang.Object
de.hybris.platform.servicelayer.interceptor.impl.DefaultInterceptorRegistry
- All Implemented Interfaces:
InterceptorRegistry
Provides type interceptors based upon jalo types.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the composed type invalidation listener to the pool.protected voidDOCTODO apidocgetAssignableTypes(String type) Returns all assignable types for a given type in super-type-first order.protected TypeManagergetLoadInterceptors(String type) getPrepareInterceptors(String type) getRemoveInterceptors(String type) protected voidinit()protected booleanisValidTypeCode(String code) Returnstrueif the given composed type code is part of the type systemvoidregisterInterceptor(InterceptorMapping mapping) Register anInterceptorwhich is of theInterceptorMappingto the registry.voidregisterInterceptor(String type, Interceptor interceptor, Collection<Interceptor> replacements) Register a givenInterceptorto the registry.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidsetInterceptorExecutionPolicy(InterceptorExecutionPolicy interceptorExecutionPolicy) voidsetInterceptorMappings(Collection<InterceptorMapping> configuredMappings) voidunregisterInterceptor(InterceptorMapping mapping)
-
Constructor Details
-
DefaultInterceptorRegistry
public DefaultInterceptorRegistry()
-
-
Method Details
-
getLoadInterceptors
- Specified by:
getLoadInterceptorsin interfaceInterceptorRegistry- Parameters:
type- type code mapping string- Returns:
- collection containing
LoadInterceptorfor specific type code mapping
-
getPrepareInterceptors
- Specified by:
getPrepareInterceptorsin interfaceInterceptorRegistry- Parameters:
type- type code mapping string- Returns:
- collection containing
PrepareInterceptorfor specific type code mapping
-
getRemoveInterceptors
- Specified by:
getRemoveInterceptorsin interfaceInterceptorRegistry- Parameters:
type- type code mapping string- Returns:
- collection containing
RemoveInterceptorfor specific type code mapping
-
getValidateInterceptors
- Specified by:
getValidateInterceptorsin interfaceInterceptorRegistry- Parameters:
type- type code mapping string- Returns:
- collection containing
ValidateInterceptorfor specific type code mapping
-
getInitDefaultsInterceptors
- Specified by:
getInitDefaultsInterceptorsin interfaceInterceptorRegistry- Parameters:
type- type code mapping string- Returns:
- collection containing
InitDefaultsInterceptorfor specific type code mapping
-
registerInterceptor
public void registerInterceptor(String type, Interceptor interceptor, Collection<Interceptor> replacements) Register a givenInterceptorto the registry. This Interceptor is registered for the given type (and every subtype) and replaces (if provided) the Interceptors in the given replacements collection. If possible useregisterInterceptor(InterceptorMapping)instead!- Parameters:
type- for thisComposedTypecode (and any subtype) the Interceptor is registered.interceptor- the Interceptorreplacements- the given Interceptor replaces the Interceptors in this collection. Example: a LoadInterceptor for product replaces the LoadInterceptor for items because the productt load interceptor does a special product loading
-
registerInterceptor
Register anInterceptorwhich is of theInterceptorMappingto the registry. The Interceptor is registered for aComposedTypecode (seeInterceptorMapping.setTypeCode(String)and, if provided, replace other registered Interceptors (seeInterceptorMapping.setReplacedInterceptors(Collection). Use this method instead ofregisterInterceptor(String, Interceptor, Collection)because the InterceptorMapping is sortable (SeeOrdered). An Interceptor with a low irder number will be executed first. If no order number is provided the default isOrdered.LOWEST_PRECEDENCE.- Parameters:
mapping- the InterceptorMapping contains the Interceptor, the typecode, the interceptors which will be replaced and an order number
-
unregisterInterceptor
-
init
protected void init() -
addTypeInvalidationListener
protected void addTypeInvalidationListener()Adds the composed type invalidation listener to the pool. -
getAssignableTypes
Returns all assignable types for a given type in super-type-first order. All type codes are lower case! -
setInterceptorMappings
-
assertLoaded
protected void assertLoaded()DOCTODO apidoc -
getJaloTypeManager
- Returns:
- the (cached)
TypeManager.
-
isValidTypeCode
Returnstrueif the given composed type code is part of the type system- Parameters:
code- theComposedTypecode- Returns:
falseotherwise
-
setInterceptorExecutionPolicy
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-