Class DefaultStreamCachingStrategy

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.engine.DefaultStreamCachingStrategy
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.StreamCachingStrategy, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

public class DefaultStreamCachingStrategy extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.CamelContextAware, org.apache.camel.spi.StreamCachingStrategy
Default implementation of StreamCachingStrategy
  • Constructor Details

    • DefaultStreamCachingStrategy

      public DefaultStreamCachingStrategy()
  • Method Details

    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.apache.camel.CamelContextAware
    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface org.apache.camel.spi.StreamCachingStrategy
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface org.apache.camel.spi.StreamCachingStrategy
    • getAllowClasses

      public Collection<Class<?>> getAllowClasses()
      Specified by:
      getAllowClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • setAllowClasses

      public void setAllowClasses(Class<?>... allowClasses)
      Specified by:
      setAllowClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • setAllowClasses

      public void setAllowClasses(String names)
      Specified by:
      setAllowClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • getDenyClasses

      public Collection<Class<?>> getDenyClasses()
      Specified by:
      getDenyClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • setDenyClasses

      public void setDenyClasses(Class<?>... denyClasses)
      Specified by:
      setDenyClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • setDenyClasses

      public void setDenyClasses(String names)
      Specified by:
      setDenyClasses in interface org.apache.camel.spi.StreamCachingStrategy
    • isSpoolEnabled

      public boolean isSpoolEnabled()
      Specified by:
      isSpoolEnabled in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolEnabled

      public void setSpoolEnabled(boolean spoolEnabled)
      Specified by:
      setSpoolEnabled in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolDirectory

      public void setSpoolDirectory(String path)
      Specified by:
      setSpoolDirectory in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolDirectory

      public void setSpoolDirectory(File path)
      Specified by:
      setSpoolDirectory in interface org.apache.camel.spi.StreamCachingStrategy
    • getSpoolDirectory

      public File getSpoolDirectory()
      Specified by:
      getSpoolDirectory in interface org.apache.camel.spi.StreamCachingStrategy
    • getSpoolThreshold

      public long getSpoolThreshold()
      Specified by:
      getSpoolThreshold in interface org.apache.camel.spi.StreamCachingStrategy
    • getSpoolUsedHeapMemoryThreshold

      public int getSpoolUsedHeapMemoryThreshold()
      Specified by:
      getSpoolUsedHeapMemoryThreshold in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolUsedHeapMemoryThreshold

      public void setSpoolUsedHeapMemoryThreshold(int spoolHeapMemoryWatermarkThreshold)
      Specified by:
      setSpoolUsedHeapMemoryThreshold in interface org.apache.camel.spi.StreamCachingStrategy
    • getSpoolUsedHeapMemoryLimit

      public org.apache.camel.spi.StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit()
      Specified by:
      getSpoolUsedHeapMemoryLimit in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolUsedHeapMemoryLimit

      public void setSpoolUsedHeapMemoryLimit(org.apache.camel.spi.StreamCachingStrategy.SpoolUsedHeapMemoryLimit spoolUsedHeapMemoryLimit)
      Specified by:
      setSpoolUsedHeapMemoryLimit in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolThreshold

      public void setSpoolThreshold(long spoolThreshold)
      Specified by:
      setSpoolThreshold in interface org.apache.camel.spi.StreamCachingStrategy
    • getSpoolCipher

      public String getSpoolCipher()
      Specified by:
      getSpoolCipher in interface org.apache.camel.spi.StreamCachingStrategy
    • setSpoolCipher

      public void setSpoolCipher(String spoolCipher)
      Specified by:
      setSpoolCipher in interface org.apache.camel.spi.StreamCachingStrategy
    • getBufferSize

      public int getBufferSize()
      Specified by:
      getBufferSize in interface org.apache.camel.spi.StreamCachingStrategy
    • setBufferSize

      public void setBufferSize(int bufferSize)
      Specified by:
      setBufferSize in interface org.apache.camel.spi.StreamCachingStrategy
    • isRemoveSpoolDirectoryWhenStopping

      public boolean isRemoveSpoolDirectoryWhenStopping()
      Specified by:
      isRemoveSpoolDirectoryWhenStopping in interface org.apache.camel.spi.StreamCachingStrategy
    • setRemoveSpoolDirectoryWhenStopping

      public void setRemoveSpoolDirectoryWhenStopping(boolean removeSpoolDirectoryWhenStopping)
      Specified by:
      setRemoveSpoolDirectoryWhenStopping in interface org.apache.camel.spi.StreamCachingStrategy
    • isAnySpoolRules

      public boolean isAnySpoolRules()
      Specified by:
      isAnySpoolRules in interface org.apache.camel.spi.StreamCachingStrategy
    • setAnySpoolRules

      public void setAnySpoolRules(boolean anySpoolTasks)
      Specified by:
      setAnySpoolRules in interface org.apache.camel.spi.StreamCachingStrategy
    • getStatistics

      public org.apache.camel.spi.StreamCachingStrategy.Statistics getStatistics()
      Specified by:
      getStatistics in interface org.apache.camel.spi.StreamCachingStrategy
    • shouldSpoolCache

      public boolean shouldSpoolCache(long length)
      Specified by:
      shouldSpoolCache in interface org.apache.camel.spi.StreamCachingStrategy
    • addSpoolRule

      public void addSpoolRule(org.apache.camel.spi.StreamCachingStrategy.SpoolRule rule)
      Specified by:
      addSpoolRule in interface org.apache.camel.spi.StreamCachingStrategy
    • cache

      public org.apache.camel.StreamCache cache(org.apache.camel.Exchange exchange)
      Specified by:
      cache in interface org.apache.camel.spi.StreamCachingStrategy
    • cache

      public org.apache.camel.StreamCache cache(org.apache.camel.Message message)
      Specified by:
      cache in interface org.apache.camel.spi.StreamCachingStrategy
    • cache

      public org.apache.camel.StreamCache cache(Object body)
      Specified by:
      cache in interface org.apache.camel.spi.StreamCachingStrategy
    • isAssignableFrom

      protected static boolean isAssignableFrom(Class<?> source, Collection<Class<?>> targets)
    • resolveSpoolDirectory

      protected String resolveSpoolDirectory(String path)
    • defaultManagementName

      protected String defaultManagementName(String path)
    • customResolveManagementName

      protected String customResolveManagementName(String pattern)
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object