Class PagedTopicScheme

java.lang.Object
com.tangosol.coherence.config.scheme.AbstractScheme
com.tangosol.coherence.config.scheme.AbstractServiceScheme<com.tangosol.internal.net.service.grid.PartitionedCacheDependencies>
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
A PagedTopicScheme is responsible for building a topic.
Since:
Coherence 14.1.1
Author:
jk 2015.05.21
  • Constructor Details

  • Method Details

    • getServiceType

      public String getServiceType()
      Return the service type.
      Specified by:
      getServiceType in interface ServiceScheme
      Overrides:
      getServiceType in class DistributedScheme
      Returns:
      the service type
    • realizeBackingMapManager

      public BackingMapManager realizeBackingMapManager(ConfigurableCacheFactory ccf)
      Description copied from class: AbstractCachingScheme
      Realize a BackingMapManager to be scoped by the specified ConfigurableCacheFactory.
      Specified by:
      realizeBackingMapManager in interface BackingMapManagerBuilder
      Overrides:
      realizeBackingMapManager in class AbstractCachingScheme<com.tangosol.internal.net.service.grid.PartitionedCacheDependencies>
      Parameters:
      ccf - the ConfigurableCacheFactory
      Returns:
      a BackingMapManager
    • realizes

      public <T extends NamedCollection> boolean realizes(Class<T> type)
      Description copied from interface: NamedCollectionBuilder
      Determines whether this NamedCollectionBuilder can realize a NamedCollection of the specified type.
      Specified by:
      realizes in interface NamedCollectionBuilder<NamedTopic>
      Type Parameters:
      T - the type of the class to verify
      Parameters:
      type - the Class 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 the BackingMapScheme used for the storage of this scheme.
      Parameters:
      resolver - potentially override default unit-calculator of BINARY
      Returns:
      the scheme
    • getStorageScheme

      public CachingScheme getStorageScheme()
      Return the BackingMapScheme 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 the PagedTopic.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 the BackingMapScheme 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 the Expression 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 the Expression defining the name of the StorageAccessAuthorizer.
      Returns:
      the name of the StorageAccessAuthorizer or null if one has not been configured.
    • setStorageAccessAuthorizer

      @Injectable("storage-authorizer") public void setStorageAccessAuthorizer(Expression<String> exprStorageAccessAuthorizer)
      Sets the Expression defining the name of the StorageAccessAuthorizer.
      Parameters:
      exprStorageAccessAuthorizer - the Expression
    • 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)
      Returns true 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 or false 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 class DistributedScheme
      Parameters:
      listBuilders - the List of NamedEventInterceptorBuilders
    • getEventInterceptorBuilders

      public List<NamedEventInterceptorBuilder> getEventInterceptorBuilders()
      Description copied from class: DistributedScheme
      Obtains the List of NamedEventInterceptorBuilders that have been defined for the ServiceScheme.

      Note: For those ServiceSchemes don't support event interceptors, the returned value must be an empty list.

      Specified by:
      getEventInterceptorBuilders in interface ServiceScheme
      Overrides:
      getEventInterceptorBuilders in class DistributedScheme
      Returns:
      an List over NamedEventInterceptorBuilders
    • 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 a NamedCollection (possibly "ensuring it") based on the state of the builder, the provided ParameterResolver and MapBuilder dependencies.

      The MapBuilder dependencies are required to satisfy the requirement when realizing a NamedCollection additionally involves realizing one or more internal Maps.

      Specified by:
      realize in interface NamedCollectionBuilder<NamedTopic>
      Type Parameters:
      V - the element type of NamedCollection
      Parameters:
      typeConstraint - type constraint assertion for elements of this NamedCollection
      resolver - the ParameterResolver
      deps - the MapBuilder 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 interface TopicScheme<NamedTopic,TopicService>
      Parameters:
      resolver - the ParameterResolver
      deps - the MapBuilder dependencies
      Returns:
      corresponding TopicService for this scheme
    • createConfiguration

      public com.tangosol.internal.net.topic.impl.paged.PagedTopicDependencies createConfiguration(ParameterResolver resolver, ClassLoader loader)
      Create a PagedTopicDependencies based on the values contained in this scheme.
      Parameters:
      resolver - the ParameterResolver to use to resolve configuration values
      loader - the ClassLoader to use
      Returns:
      a PagedTopicDependencies based on the values contained in this scheme