Class BundleManager.BundleConfig

  • Enclosing class:
    BundleManager

    public static class BundleManager.BundleConfig
    extends Object
    The BundleConfig class contains the configuration for a Bundle.
    • Constructor Detail

      • BundleConfig

        public BundleConfig()
    • Method Detail

      • isAutoAdjust

        public boolean isAutoAdjust​(ParameterResolver resolver)
        Return true if the auto adjustment of the preferred size value (based on the run-time statistics) is allowed.
        Parameters:
        resolver - the ParameterResolver
        Returns:
        true if auto-adjust is enabled
      • setAutoAdjust

        @Injectable
        public void setAutoAdjust​(Expression<Boolean> expr)
        Set the flag to auto adjust the preferred size value, based on the run-time statistics.
        Parameters:
        expr - true if auto adjustment is enabled
      • getDelayMillis

        public long getDelayMillis​(ParameterResolver resolver)
        Specifies the maximum amount of time that individual execution requests are allowed to be deferred for a purpose of "bundling" them and passing into a corresponding bulk operation. If the preferred-size threshold is reached before the specified delay, the bundle is processed immediately.
        Parameters:
        resolver - the ParameterResolver
        Returns:
        the write delay
      • setDelayMillis

        @Injectable
        public void setDelayMillis​(Expression<Millis> expr)
        Set the write delay.
        Parameters:
        expr - the write delay
      • getOperationName

        public String getOperationName​(ParameterResolver resolver)
        Return the operation name for which calls performed concurrently on multiple threads are "bundled" into a functionally analogous "bulk" operation that takes a collection of arguments instead of a single one.
        Parameters:
        resolver - the ParameterResolver
        Returns:
        the operation name
      • setOperationName

        @Injectable
        public void setOperationName​(Expression<String> expr)
        Set the operation name for which calls performed concurrently on multiple threads are bundled.
        Parameters:
        expr - the operation name
      • getPreferredSize

        public int getPreferredSize​(ParameterResolver resolver)
        Return the bundle size threshold. When a bundle size reaches this value, the corresponding "bulk" operation is invoked immediately. This value is measured in context-specific units.
        Parameters:
        resolver - the ParameterResolver
        Returns:
        the size threshold
      • setPreferredSize

        @Injectable
        public void setPreferredSize​(Expression<Integer> expr)
        Set the bundle size threshold.
        Parameters:
        expr - the size threshold
      • getThreadThreshold

        public int getThreadThreshold​(ParameterResolver resolver)
        Return the minimum number of threads that must be concurrently executing individual(non-bundled) requests for the bundler to switch from a pass-through to a bundling mode.
        Parameters:
        resolver - the ParameterResolver
        Returns:
        the thread threshold
      • setThreadThreshold

        @Injectable
        public void setThreadThreshold​(Expression<Integer> expr)
        Set the thread threshold.
        Parameters:
        expr - the thread threshold
      • validate

        protected void validate​(ParameterResolver resolver)
        Validate the bundle configuration.
        Parameters:
        resolver - the ParameterResolver for resolving expressions and runtime parameters