Class PagedTopicScheme
- java.lang.Object
-
- com.tangosol.coherence.config.scheme.AbstractScheme
-
- com.tangosol.coherence.config.scheme.AbstractServiceScheme<D>
-
- com.tangosol.coherence.config.scheme.AbstractCachingScheme<com.tangosol.internal.net.service.grid.PartitionedCacheDependencies>
-
- com.tangosol.coherence.config.scheme.DistributedScheme
-
- com.tangosol.coherence.config.scheme.PagedTopicScheme
-
- All Implemented Interfaces:
BackingMapManagerBuilder
,MapBuilder
,NamedCacheBuilder
,NamedCollectionBuilder<NamedTopic>
,ServiceBuilder
,BundlingScheme
,CachingScheme
,ClusteredCachingScheme
,NamedTopicScheme
,ObservableCachingScheme
,Scheme
,ServiceScheme
,TopicScheme<NamedTopic,TopicService>
public class PagedTopicScheme extends DistributedScheme implements NamedTopicScheme
APagedTopicScheme
is responsible for building a topic.- Since:
- Coherence 14.1.1
- Author:
- jk 2015.05.21
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.coherence.config.scheme.DistributedScheme
DistributedScheme.BackupConfig
-
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.MapBuilder
MapBuilder.Dependencies
-
-
Field Summary
-
Fields inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
m_serviceDependencies
-
Fields inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
DELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION
-
-
Constructor Summary
Constructors Constructor Description PagedTopicScheme()
Constructs aPagedTopicScheme
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.tangosol.internal.net.topic.impl.paged.PagedTopicDependencies
createConfiguration(ParameterResolver resolver, ClassLoader loader)
Create aPagedTopicDependencies
based on the values contained in this scheme.TopicService
ensureConfiguredService(ParameterResolver resolver, MapBuilder.Dependencies deps)
Ensure service and its topic configuration.int
getChannelCount(ParameterResolver resolver)
Returns the number of channels in the topic, or thePagedTopic.DEFAULT_CHANNEL_COUNT
value to indicate the topic uses the default channel count.ElementCalculatorBuilder
getElementCalculatorBuilder()
Return the ElementCalculatorBuilder used to build a ElementCalculator.List<NamedEventInterceptorBuilder>
getEventInterceptorBuilders()
Seconds
getExpiryDelay(ParameterResolver resolver)
Return the amount of time that elements offered to the queue remain visible to consumers.long
getHighUnits(ParameterResolver resolver)
Return the high-unitsUnits
getPageSize(ParameterResolver resolver)
Return the binary limit of the size of a page in a topic.Seconds
getReconnectRetryMillis(ParameterResolver resolver)
Return the amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected.Seconds
getReconnectTimeoutMillis(ParameterResolver resolver)
Returns the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected.Seconds
getReconnectWaitMillis(ParameterResolver resolver)
Return the amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected.String
getServiceType()
Return the service type.Expression<String>
getStorageAccessAuthorizer()
Obtains theExpression
defining the name of theStorageAccessAuthorizer
.CachingScheme
getStorageScheme()
Return theBackingMapScheme
used for the storage of this scheme.CachingScheme
getStorageScheme(ParameterResolver resolver)
Return theBackingMapScheme
used for the storage of this scheme.Seconds
getSubscriberTimeout(ParameterResolver resolver)
Returns the subscriber timeout value.Expression<Boolean>
getTransientExpression()
Return theExpression
transient. to use to determine whether the backing map is transient.boolean
isAllowUnownedCommits(ParameterResolver resolver)
Returnstrue
if the topic allows commits for a position in a channel by subscribers that do not own the channel.boolean
isRetainConsumed(ParameterResolver resolver)
Determine whether to retain consumed values.<V> NamedTopic
realize(ValueTypeAssertion<V> typeConstraint, ParameterResolver resolver, MapBuilder.Dependencies deps)
Realizes aNamedCollection
(possibly "ensuring it") based on the state of the builder, the providedParameterResolver
andMapBuilder
dependencies.BackingMapManager
realizeBackingMapManager(ConfigurableCacheFactory ccf)
Realize aBackingMapManager
to be scoped by the specifiedConfigurableCacheFactory
.<T extends NamedCollection>
booleanrealizes(Class<T> type)
Determines whether thisNamedCollectionBuilder
can realize aNamedCollection
of the specified type.void
setAllowUnownedCommits(Expression<Boolean> expr)
Set the flag that indicates whether the topic allows commits for a position in a channel by subscribers that do not own the channelvoid
setChannelCount(Expression<Integer> expr)
Set the number of channels in the topic.void
setElementCalculatorBuilder(ElementCalculatorBuilder builder)
Set the ElementCalculatorBuilder.void
setEventInterceptorBuilders(List<NamedEventInterceptorBuilder> listBuilders)
void
setExpiryDelay(Expression<Seconds> expr)
Set the amount of time that elements offered to the queue remain visible to consumers.void
setHighUnits(Expression<com.oracle.coherence.common.util.MemorySize> expr)
Set the high-unitsvoid
setPageSize(Expression<Units> expr)
Set the page size.void
setReconnectRetryMillis(Expression<Seconds> expr)
Set the amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected.void
setReconnectTimeoutMillis(Expression<Seconds> expr)
Set the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected.void
setReconnectWaitMillis(Expression<Seconds> expr)
Set the amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected.void
setRetainConsumed(Expression<Boolean> expr)
Set whether to retain consumed values.void
setStorageAccessAuthorizer(Expression<String> exprStorageAccessAuthorizer)
Sets theExpression
defining the name of theStorageAccessAuthorizer
.void
setStorageScheme(CachingScheme scheme)
Set theBackingMapScheme
which builds the backing map for the internal caches used to implement this scheme.void
setSubscriberTimeout(Expression<Seconds> expr)
Set the subscriber timeout value.void
setTransient(Expression<Boolean> expr)
Set the transient flag.-
Methods inherited from class com.tangosol.coherence.config.scheme.DistributedScheme
getBackingMapScheme, getBackupMapConfig, getBundleManager, isRunningClusterNeeded, setBackingMapScheme, setBackupMapConfig, setBundleManager
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractCachingScheme
establishMapListeners, getDefaultParameterResolver, getListenerBuilder, realizeCache, realizeMap, setListenerBuilder, validate
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
ensureService, getDefaultServiceName, getScopedServiceName, getScopeName, getServiceBuilder, getServiceDependencies, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, realizeService, setAutoStart, setScopeName, setServiceDependencies, setServiceName, setXml
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymous
-
Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getScopedServiceName, getServiceBuilder, getServiceName, isAutoStart
-
-
-
-
Constructor Detail
-
PagedTopicScheme
public PagedTopicScheme()
Constructs aPagedTopicScheme
.
-
-
Method Detail
-
getServiceType
public String getServiceType()
Return the service type.- Specified by:
getServiceType
in interfaceServiceScheme
- Overrides:
getServiceType
in classDistributedScheme
- Returns:
- the service type
-
realizeBackingMapManager
public BackingMapManager realizeBackingMapManager(ConfigurableCacheFactory ccf)
Description copied from class:AbstractCachingScheme
Realize aBackingMapManager
to be scoped by the specifiedConfigurableCacheFactory
.- Specified by:
realizeBackingMapManager
in interfaceBackingMapManagerBuilder
- Overrides:
realizeBackingMapManager
in classAbstractCachingScheme<com.tangosol.internal.net.service.grid.PartitionedCacheDependencies>
- Parameters:
ccf
- theConfigurableCacheFactory
- Returns:
- a
BackingMapManager
-
realizes
public <T extends NamedCollection> boolean realizes(Class<T> type)
Description copied from interface:NamedCollectionBuilder
Determines whether thisNamedCollectionBuilder
can realize aNamedCollection
of the specified type.- Specified by:
realizes
in interfaceNamedCollectionBuilder<NamedTopic>
- Type Parameters:
T
- the type of the class to verify- Parameters:
type
- theClass
of the type to verify- Returns:
- true if this builder can realize a
NamedCollection
of the specified type.
-
getStorageScheme
public CachingScheme getStorageScheme(ParameterResolver resolver)
Return theBackingMapScheme
used for the storage of this scheme.- Parameters:
resolver
- potentially override default unit-calculator of BINARY- Returns:
- the scheme
-
getStorageScheme
public CachingScheme getStorageScheme()
Return theBackingMapScheme
used for the storage of this scheme.- Returns:
- the scheme
-
setChannelCount
@Injectable("channel-count") public void setChannelCount(Expression<Integer> expr)
Set the number of channels in the topic.- Parameters:
expr
- the number of channels in the topic
-
getChannelCount
public int getChannelCount(ParameterResolver resolver)
Returns the number of channels in the topic, or thePagedTopic.DEFAULT_CHANNEL_COUNT
value to indicate the topic uses the default channel count.- Parameters:
resolver
- the ParameterResolver- Returns:
- the number of channels in the topic, or the
PagedTopic.DEFAULT_CHANNEL_COUNT
value to indicate the topic uses the default channel count
-
setStorageScheme
@Injectable("storage") public void setStorageScheme(CachingScheme scheme)
Set theBackingMapScheme
which builds the backing map for the internal caches used to implement this scheme.- Parameters:
scheme
- the scheme builder
-
getPageSize
public Units getPageSize(ParameterResolver resolver)
Return the binary limit of the size of a page in a topic. Contains the target number of bytes that can be placed in a page before the page is deemed to be full. Legal values are positive integers.- Parameters:
resolver
- the ParameterResolver- Returns:
- the page size
-
setPageSize
@Injectable("page-size") public void setPageSize(Expression<Units> expr)
Set the page size.- Parameters:
expr
- the page high units expression
-
getHighUnits
public long getHighUnits(ParameterResolver resolver)
Return the high-units- Parameters:
resolver
- the ParameterResolver- Returns:
- the unit factor
-
setHighUnits
@Injectable("high-units") public void setHighUnits(Expression<com.oracle.coherence.common.util.MemorySize> expr)
Set the high-units- Parameters:
expr
- the high-units expression
-
getTransientExpression
public Expression<Boolean> getTransientExpression()
Return theExpression
transient. to use to determine whether the backing map is transient.- Returns:
- the
Expression
transient. to use to determine whether the backing map is transient
-
setTransient
@Injectable public void setTransient(Expression<Boolean> expr)
Set the transient flag.- Parameters:
expr
- true to make the backing map transient.
-
getStorageAccessAuthorizer
public Expression<String> getStorageAccessAuthorizer()
Obtains theExpression
defining the name of theStorageAccessAuthorizer
.- Returns:
- the name of the
StorageAccessAuthorizer
ornull
if one has not been configured.
-
setStorageAccessAuthorizer
@Injectable("storage-authorizer") public void setStorageAccessAuthorizer(Expression<String> exprStorageAccessAuthorizer)
Sets theExpression
defining the name of theStorageAccessAuthorizer
.- Parameters:
exprStorageAccessAuthorizer
- theExpression
-
getExpiryDelay
public Seconds getExpiryDelay(ParameterResolver resolver)
Return the amount of time that elements offered to the queue remain visible to consumers.- Parameters:
resolver
- the ParameterResolver- Returns:
- the amount of time that elements offered to the queue remain visible to consumers
-
setExpiryDelay
@Injectable public void setExpiryDelay(Expression<Seconds> expr)
Set the amount of time that elements offered to the queue remain visible to consumers.- Parameters:
expr
- the element expiry delay expression
-
isRetainConsumed
public boolean isRetainConsumed(ParameterResolver resolver)
Determine whether to retain consumed values.- Parameters:
resolver
- the ParameterResolver- Returns:
true
if the topic should retain consumed values
-
setRetainConsumed
@Injectable("retain-consumed") public void setRetainConsumed(Expression<Boolean> expr)
Set whether to retain consumed values.- Parameters:
expr
- the expression to produce the retain-consumed values flag
-
isAllowUnownedCommits
public boolean isAllowUnownedCommits(ParameterResolver resolver)
Returnstrue
if the topic allows commits for a position in a channel by subscribers that do not own the channel.- Parameters:
resolver
- the ParameterResolver- Returns:
true
if the topic allows commits for a position in a channel by subscribers that do not own the channel
-
setAllowUnownedCommits
@Injectable("allow-unowned-commits") public void setAllowUnownedCommits(Expression<Boolean> expr)
Set the flag that indicates whether the topic allows commits for a position in a channel by subscribers that do not own the channel- Parameters:
expr
-true
if the topic allows commits for a position in a channel by subscribers that do not own the channel orfalse
to only accept commits from channel owners
-
getSubscriberTimeout
public Seconds getSubscriberTimeout(ParameterResolver resolver)
Returns the subscriber timeout value.- Parameters:
resolver
- the ParameterResolver- Returns:
- the subscriber timeout value
-
setSubscriberTimeout
@Injectable("subscriber-timeout") public void setSubscriberTimeout(Expression<Seconds> expr)
Set the subscriber timeout value.- Parameters:
expr
- the expression representing the timeout value for subscribers
-
getElementCalculatorBuilder
public ElementCalculatorBuilder getElementCalculatorBuilder()
Return the ElementCalculatorBuilder used to build a ElementCalculator.- Returns:
- the element calculator
-
setElementCalculatorBuilder
@Injectable("element-calculator") public void setElementCalculatorBuilder(ElementCalculatorBuilder builder)
Set the ElementCalculatorBuilder.- Parameters:
builder
- the ElementCalculatorBuilder
-
setEventInterceptorBuilders
@Injectable("interceptors") public void setEventInterceptorBuilders(List<NamedEventInterceptorBuilder> listBuilders)
Description copied from class:DistributedScheme
- Overrides:
setEventInterceptorBuilders
in classDistributedScheme
- Parameters:
listBuilders
- theList
ofNamedEventInterceptorBuilder
s
-
getEventInterceptorBuilders
public List<NamedEventInterceptorBuilder> getEventInterceptorBuilders()
Description copied from class:DistributedScheme
Obtains theList
ofNamedEventInterceptorBuilder
s that have been defined for theServiceScheme
.Note: For those
ServiceScheme
s don't support event interceptors, the returned value must be an empty list.- Specified by:
getEventInterceptorBuilders
in interfaceServiceScheme
- Overrides:
getEventInterceptorBuilders
in classDistributedScheme
- Returns:
- an
List
overNamedEventInterceptorBuilder
s
-
getReconnectTimeoutMillis
public Seconds getReconnectTimeoutMillis(ParameterResolver resolver)
Returns the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected.- Parameters:
resolver
- the parameter resolver- Returns:
- the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected
-
setReconnectTimeoutMillis
@Injectable("reconnect-timeout") public void setReconnectTimeoutMillis(Expression<Seconds> expr)
Set the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected.- Parameters:
expr
- the maximum amount of time publishers and subscribers will attempt to reconnect after being disconnected
-
getReconnectRetryMillis
public Seconds getReconnectRetryMillis(ParameterResolver resolver)
Return the amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected.- Parameters:
resolver
- the parameter resolver- Returns:
- the maximum amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected
-
setReconnectRetryMillis
@Injectable("reconnect-retry") public void setReconnectRetryMillis(Expression<Seconds> expr)
Set the amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected.- Parameters:
expr
- the maximum amount of time publishers and subscribers will wait between attempts to reconnect after being disconnected
-
getReconnectWaitMillis
public Seconds getReconnectWaitMillis(ParameterResolver resolver)
Return the amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected.- Parameters:
resolver
- the parameter resolver- Returns:
- the maximum amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected
-
setReconnectWaitMillis
@Injectable("reconnect-wait") public void setReconnectWaitMillis(Expression<Seconds> expr)
Set the amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected.- Parameters:
expr
- the maximum amount of time publishers and subscribers will wait before attempts to reconnect after being disconnected
-
realize
public <V> NamedTopic realize(ValueTypeAssertion<V> typeConstraint, ParameterResolver resolver, MapBuilder.Dependencies deps)
Description copied from interface:NamedCollectionBuilder
Realizes aNamedCollection
(possibly "ensuring it") based on the state of the builder, the providedParameterResolver
andMapBuilder
dependencies.The
MapBuilder
dependencies are required to satisfy the requirement when realizing aNamedCollection
additionally involves realizing one or more internalMap
s.- Specified by:
realize
in interfaceNamedCollectionBuilder<NamedTopic>
- Type Parameters:
V
- the element type ofNamedCollection
- Parameters:
typeConstraint
- type constraint assertion for elements of thisNamedCollection
resolver
- the ParameterResolverdeps
- theMapBuilder
dependencies- Returns:
- a
NamedCollection
-
ensureConfiguredService
public TopicService ensureConfiguredService(ParameterResolver resolver, MapBuilder.Dependencies deps)
Ensure service and its topic configuration.PagedTopicConfiguration is registered in corresponding service's resource registry.
- Specified by:
ensureConfiguredService
in interfaceTopicScheme<NamedTopic,TopicService>
- Parameters:
resolver
- the ParameterResolverdeps
- theMapBuilder
dependencies- Returns:
- corresponding TopicService for this scheme
-
createConfiguration
public com.tangosol.internal.net.topic.impl.paged.PagedTopicDependencies createConfiguration(ParameterResolver resolver, ClassLoader loader)
Create aPagedTopicDependencies
based on the values contained in this scheme.- Parameters:
resolver
- theParameterResolver
to use to resolve configuration valuesloader
- theClassLoader
to use- Returns:
- a
PagedTopicDependencies
based on the values contained in this scheme
-
-