Class InterceptorConfigurationBuilder
- java.lang.Object
-
- org.infinispan.configuration.cache.AbstractCustomInterceptorsConfigurationChildBuilder
-
- org.infinispan.configuration.cache.InterceptorConfigurationBuilder
-
- All Implemented Interfaces:
Builder<InterceptorConfiguration>
,ConfigurationChildBuilder
public class InterceptorConfigurationBuilder extends AbstractCustomInterceptorsConfigurationChildBuilder implements Builder<InterceptorConfiguration>
This builder defines details of a specific custom interceptor.
-
-
Field Summary
Fields Modifier and Type Field Description protected ConfigurationBuilder
builder
-
Method Summary
-
Methods inherited from class org.infinispan.configuration.cache.AbstractCustomInterceptorsConfigurationChildBuilder
getCustomInterceptorsBuilder
-
-
-
-
Field Detail
-
builder
protected final ConfigurationBuilder builder
-
-
Method Detail
-
after
public InterceptorConfigurationBuilder after(Class<? extends AsyncInterceptor> after)
Dictates that the custom interceptor appears immediately after the specified interceptor. If the specified interceptor is not found in the interceptor chain, aCacheConfigurationException
will be thrown when the cache starts.- Parameters:
after
- the class of the interceptor to look for
-
before
public InterceptorConfigurationBuilder before(Class<? extends AsyncInterceptor> before)
Dictates that the custom interceptor appears immediately before the specified interceptor. If the specified interceptor is not found in the interceptor chain, aCacheConfigurationException
will be thrown when the cache starts.- Parameters:
before
- the class of the interceptor to look for
-
interceptorClass
public InterceptorConfigurationBuilder interceptorClass(Class<? extends AsyncInterceptor> interceptorClass)
Class of the new custom interceptor to add to the configuration.- Parameters:
interceptorClass
- an instance ofAsyncInterceptor
-
interceptor
@Deprecated public InterceptorConfigurationBuilder interceptor(CommandInterceptor interceptor)
Deprecated.Since 9.0, please useinterceptor(AsyncInterceptor)
instead.
-
interceptor
public InterceptorConfigurationBuilder interceptor(AsyncInterceptor interceptor)
An instance of the new custom interceptor to add to the configuration. Warning: if you use this configuration for multiple caches, the interceptor instance will be shared, which will corrupt interceptor stack. UseinterceptorClass(java.lang.Class<? extends org.infinispan.interceptors.AsyncInterceptor>)
instead.- Parameters:
interceptor
- an instance ofAsyncInterceptor
-
index
public InterceptorConfigurationBuilder index(int i)
Specifies a position in the interceptor chain to place the new interceptor. The index starts at 0 and goes up to the number of interceptors in a given configuration. AnIllegalArgumentException
is thrown if the index is less than 0 or greater than the maximum number of interceptors in the chain.- Parameters:
i
- positional index in the interceptor chain to place the new interceptor.
-
position
public InterceptorConfigurationBuilder position(InterceptorConfiguration.Position p)
Specifies a position, denoted by theInterceptorConfiguration.Position
enumeration, where to place the new interceptor.- Parameters:
p
- position to place the new interceptor
-
withProperties
public InterceptorConfigurationBuilder withProperties(Properties properties)
Sets interceptor properties- Returns:
- this InterceptorConfigurationBuilder
-
clearProperties
public InterceptorConfigurationBuilder clearProperties()
Clears the interceptor properties- Returns:
- this InterceptorConfigurationBuilder
-
addProperty
public InterceptorConfigurationBuilder addProperty(String key, String value)
-
removeProperty
public InterceptorConfigurationBuilder removeProperty(String key)
-
validate
public void validate()
Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<InterceptorConfiguration>
-
validate
public void validate(GlobalConfiguration globalConfig)
- Specified by:
validate
in interfaceConfigurationChildBuilder
-
create
public InterceptorConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<InterceptorConfiguration>
- Returns:
-
read
public InterceptorConfigurationBuilder read(InterceptorConfiguration template)
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in interfaceBuilder<InterceptorConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
template
public ConfigurationChildBuilder template(boolean template)
- Specified by:
template
in interfaceConfigurationChildBuilder
-
simpleCache
public ConfigurationChildBuilder simpleCache(boolean simpleCache)
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
simpleCache
public boolean simpleCache()
- Specified by:
simpleCache
in interfaceConfigurationChildBuilder
-
clustering
public ClusteringConfigurationBuilder clustering()
- Specified by:
clustering
in interfaceConfigurationChildBuilder
-
customInterceptors
public CustomInterceptorsConfigurationBuilder customInterceptors()
- Specified by:
customInterceptors
in interfaceConfigurationChildBuilder
-
dataContainer
public DataContainerConfigurationBuilder dataContainer()
- Specified by:
dataContainer
in interfaceConfigurationChildBuilder
-
deadlockDetection
public DeadlockDetectionConfigurationBuilder deadlockDetection()
- Specified by:
deadlockDetection
in interfaceConfigurationChildBuilder
-
encoding
public EncodingConfigurationBuilder encoding()
- Specified by:
encoding
in interfaceConfigurationChildBuilder
-
eviction
public EvictionConfigurationBuilder eviction()
- Specified by:
eviction
in interfaceConfigurationChildBuilder
-
expiration
public ExpirationConfigurationBuilder expiration()
- Specified by:
expiration
in interfaceConfigurationChildBuilder
-
indexing
public IndexingConfigurationBuilder indexing()
- Specified by:
indexing
in interfaceConfigurationChildBuilder
-
invocationBatching
public InvocationBatchingConfigurationBuilder invocationBatching()
- Specified by:
invocationBatching
in interfaceConfigurationChildBuilder
-
jmxStatistics
public JMXStatisticsConfigurationBuilder jmxStatistics()
- Specified by:
jmxStatistics
in interfaceConfigurationChildBuilder
-
persistence
public PersistenceConfigurationBuilder persistence()
- Specified by:
persistence
in interfaceConfigurationChildBuilder
-
locking
public LockingConfigurationBuilder locking()
- Specified by:
locking
in interfaceConfigurationChildBuilder
-
security
public SecurityConfigurationBuilder security()
- Specified by:
security
in interfaceConfigurationChildBuilder
-
storeAsBinary
@Deprecated public StoreAsBinaryConfigurationBuilder storeAsBinary()
Deprecated.- Specified by:
storeAsBinary
in interfaceConfigurationChildBuilder
-
transaction
public TransactionConfigurationBuilder transaction()
- Specified by:
transaction
in interfaceConfigurationChildBuilder
-
versioning
public VersioningConfigurationBuilder versioning()
- Specified by:
versioning
in interfaceConfigurationChildBuilder
-
unsafe
public UnsafeConfigurationBuilder unsafe()
- Specified by:
unsafe
in interfaceConfigurationChildBuilder
-
sites
public SitesConfigurationBuilder sites()
- Specified by:
sites
in interfaceConfigurationChildBuilder
-
compatibility
@Deprecated public CompatibilityModeConfigurationBuilder compatibility()
Deprecated.- Specified by:
compatibility
in interfaceConfigurationChildBuilder
-
memory
public MemoryConfigurationBuilder memory()
- Specified by:
memory
in interfaceConfigurationChildBuilder
-
getBuilder
protected ConfigurationBuilder getBuilder()
-
build
public Configuration build()
- Specified by:
build
in interfaceConfigurationChildBuilder
-
-