@ManagedAttribute(description = "Whether used heap memory limit is committed or maximum") void setSpoolUsedHeapMemoryLimit(StreamCachingStrategy.SpoolUsedHeapMemoryLimit limit);
@ManagedAttribute(description = "Whether used heap memory limit is committed or maximum") StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit();
public StreamCachingAdvice(StreamCachingStrategy strategy) { this.strategy = strategy; }
public ManagedStreamCachingStrategy(CamelContext camelContext, StreamCachingStrategy streamCachingStrategy) { super(camelContext, streamCachingStrategy); this.camelContext = camelContext; this.streamCachingStrategy = streamCachingStrategy; }
public StreamCachingStrategy getStreamCachingStrategy() { return streamCachingStrategy; }
public void setSpoolUsedHeapMemoryLimit(StreamCachingStrategy.SpoolUsedHeapMemoryLimit limit) { streamCachingStrategy.setSpoolUsedHeapMemoryLimit(limit); }
public StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit() { return streamCachingStrategy.getSpoolUsedHeapMemoryLimit(); }
public StreamCachingStrategy getStreamCachingStrategy() { if (streamCachingStrategy == null) { streamCachingStrategy = new DefaultStreamCachingStrategy(); } return streamCachingStrategy; }
public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) { this.streamCachingStrategy = streamCachingStrategy; }
protected void initStreamCachingStrategy() throws Exception { CamelStreamCachingStrategyDefinition streamCaching = getCamelStreamCachingStrategy(); if (streamCaching == null) { return; } Boolean enabled = CamelContextHelper.parseBoolean(getContext(), streamCaching.getEnabled()); if (enabled != null) { getContext().getStreamCachingStrategy().setEnabled(enabled); } String spoolDirectory = CamelContextHelper.parseText(getContext(), streamCaching.getSpoolDirectory()); if (spoolDirectory != null) { getContext().getStreamCachingStrategy().setSpoolDirectory(spoolDirectory); } Long spoolThreshold = CamelContextHelper.parseLong(getContext(), streamCaching.getSpoolThreshold()); if (spoolThreshold != null) { getContext().getStreamCachingStrategy().setSpoolThreshold(spoolThreshold); } Integer spoolUsedHeap = CamelContextHelper.parseInteger(getContext(), streamCaching.getSpoolUsedHeapMemoryThreshold()); if (spoolUsedHeap != null) { getContext().getStreamCachingStrategy().setSpoolUsedHeapMemoryThreshold(spoolUsedHeap); } String limit = CamelContextHelper.parseText(getContext(), streamCaching.getSpoolUsedHeapMemoryLimit()); if (limit != null) { StreamCachingStrategy.SpoolUsedHeapMemoryLimit ul = CamelContextHelper.mandatoryConvertTo(getContext(), StreamCachingStrategy.SpoolUsedHeapMemoryLimit.class, limit); getContext().getStreamCachingStrategy().setSpoolUsedHeapMemoryLimit(ul); } String spoolChiper = CamelContextHelper.parseText(getContext(), streamCaching.getSpoolChiper()); if (spoolChiper != null) { getContext().getStreamCachingStrategy().setSpoolChiper(spoolChiper); } Boolean remove = CamelContextHelper.parseBoolean(getContext(), streamCaching.getRemoveSpoolDirectoryWhenStopping()); if (remove != null) { getContext().getStreamCachingStrategy().setRemoveSpoolDirectoryWhenStopping(remove); } Boolean statisticsEnabled = CamelContextHelper.parseBoolean(getContext(), streamCaching.getStatisticsEnabled()); if (statisticsEnabled != null) { getContext().getStreamCachingStrategy().getStatistics().setStatisticsEnabled(statisticsEnabled); } Boolean anySpoolRules = CamelContextHelper.parseBoolean(getContext(), streamCaching.getAnySpoolRules()); if (anySpoolRules != null) { getContext().getStreamCachingStrategy().setAnySpoolRules(anySpoolRules); } String spoolRules = CamelContextHelper.parseText(getContext(), streamCaching.getAnySpoolRules()); if (spoolRules != null) { Iterator<Object> it = ObjectHelper.createIterator(spoolRules); while (it.hasNext()) { String name = it.next().toString(); StreamCachingStrategy.SpoolRule rule = getContext().getRegistry().lookupByNameAndType(name, StreamCachingStrategy.SpoolRule.class); if (rule != null) { getContext().getStreamCachingStrategy().addSpoolRule(rule); } } } }
private void setupCustomServices() { ModelJAXBContextFactory modelJAXBContextFactory = getBeanForType(ModelJAXBContextFactory.class); if (modelJAXBContextFactory != null) { LOG.info("Using custom ModelJAXBContextFactory: {}", modelJAXBContextFactory); getContext().setModelJAXBContextFactory(modelJAXBContextFactory); } ClassResolver classResolver = getBeanForType(ClassResolver.class); if (classResolver != null) { LOG.info("Using custom ClassResolver: {}", classResolver); getContext().setClassResolver(classResolver); } FactoryFinderResolver factoryFinderResolver = getBeanForType(FactoryFinderResolver.class); if (factoryFinderResolver != null) { LOG.info("Using custom FactoryFinderResolver: {}", factoryFinderResolver); getContext().setFactoryFinderResolver(factoryFinderResolver); } ExecutorServiceManager executorServiceStrategy = getBeanForType(ExecutorServiceManager.class); if (executorServiceStrategy != null) { LOG.info("Using custom ExecutorServiceStrategy: {}", executorServiceStrategy); getContext().setExecutorServiceManager(executorServiceStrategy); } ThreadPoolFactory threadPoolFactory = getBeanForType(ThreadPoolFactory.class); if (threadPoolFactory != null) { LOG.info("Using custom ThreadPoolFactory: {}", threadPoolFactory); getContext().getExecutorServiceManager().setThreadPoolFactory(threadPoolFactory); } ProcessorFactory processorFactory = getBeanForType(ProcessorFactory.class); if (processorFactory != null) { LOG.info("Using custom ProcessorFactory: {}", processorFactory); getContext().setProcessorFactory(processorFactory); } Debugger debugger = getBeanForType(Debugger.class); if (debugger != null) { LOG.info("Using custom Debugger: {}", debugger); getContext().setDebugger(debugger); } UuidGenerator uuidGenerator = getBeanForType(UuidGenerator.class); if (uuidGenerator != null) { LOG.info("Using custom UuidGenerator: {}", uuidGenerator); getContext().setUuidGenerator(uuidGenerator); } NodeIdFactory nodeIdFactory = getBeanForType(NodeIdFactory.class); if (nodeIdFactory != null) { LOG.info("Using custom NodeIdFactory: {}", nodeIdFactory); getContext().setNodeIdFactory(nodeIdFactory); } StreamCachingStrategy streamCachingStrategy = getBeanForType(StreamCachingStrategy.class); if (streamCachingStrategy != null) { LOG.info("Using custom StreamCachingStrategy: {}", streamCachingStrategy); getContext().setStreamCachingStrategy(streamCachingStrategy); } MessageHistoryFactory messageHistoryFactory = getBeanForType(MessageHistoryFactory.class); if (messageHistoryFactory != null) { LOG.info("Using custom MessageHistoryFactory: {}", messageHistoryFactory); getContext().setMessageHistoryFactory(messageHistoryFactory); } }
@Override public StreamCachingStrategy getStreamCachingStrategy() { return context.getStreamCachingStrategy(); }
@Override public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) { context.setStreamCachingStrategy(streamCachingStrategy); }
/** * Gets the {@link StreamCachingStrategy} to use. */ StreamCachingStrategy getStreamCachingStrategy();
/** * Sets a custom {@link StreamCachingStrategy} to use. */ void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy);