Java 类org.apache.camel.spi.StreamCachingStrategy 实例源码

项目:Camel    文件:ManagedStreamCachingStrategyMBean.java   
@ManagedAttribute(description = "Whether used heap memory limit is committed or maximum")
void setSpoolUsedHeapMemoryLimit(StreamCachingStrategy.SpoolUsedHeapMemoryLimit limit);
项目:Camel    文件:ManagedStreamCachingStrategyMBean.java   
@ManagedAttribute(description = "Whether used heap memory limit is committed or maximum")
StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit();
项目:Camel    文件:CamelInternalProcessor.java   
public StreamCachingAdvice(StreamCachingStrategy strategy) {
    this.strategy = strategy;
}
项目:Camel    文件:ManagedStreamCachingStrategy.java   
public ManagedStreamCachingStrategy(CamelContext camelContext, StreamCachingStrategy streamCachingStrategy) {
    super(camelContext, streamCachingStrategy);
    this.camelContext = camelContext;
    this.streamCachingStrategy = streamCachingStrategy;
}
项目:Camel    文件:ManagedStreamCachingStrategy.java   
public StreamCachingStrategy getStreamCachingStrategy() {
    return streamCachingStrategy;
}
项目:Camel    文件:ManagedStreamCachingStrategy.java   
public void setSpoolUsedHeapMemoryLimit(StreamCachingStrategy.SpoolUsedHeapMemoryLimit limit) {
    streamCachingStrategy.setSpoolUsedHeapMemoryLimit(limit);
}
项目:Camel    文件:ManagedStreamCachingStrategy.java   
public StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit() {
    return streamCachingStrategy.getSpoolUsedHeapMemoryLimit();
}
项目:Camel    文件:DefaultCamelContext.java   
public StreamCachingStrategy getStreamCachingStrategy() {
    if (streamCachingStrategy == null) {
        streamCachingStrategy = new DefaultStreamCachingStrategy();
    }
    return streamCachingStrategy;
}
项目:Camel    文件:DefaultCamelContext.java   
public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) {
    this.streamCachingStrategy = streamCachingStrategy;
}
项目:Camel    文件:AbstractCamelContextFactoryBean.java   
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);
            }
        }
    }
}
项目:Camel    文件:AbstractCamelContextFactoryBean.java   
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);
    }
}
项目:microservice-bundle    文件:ManagedCamelContext.java   
@Override
public StreamCachingStrategy getStreamCachingStrategy() {
  return context.getStreamCachingStrategy();
}
项目:microservice-bundle    文件:ManagedCamelContext.java   
@Override
public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) {
  context.setStreamCachingStrategy(streamCachingStrategy);
}
项目:dropwizard-camel    文件:ManagedCamelContext.java   
@Override
public StreamCachingStrategy getStreamCachingStrategy() {
    return context.getStreamCachingStrategy();
}
项目:dropwizard-camel    文件:ManagedCamelContext.java   
@Override
public void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy) {
    context.setStreamCachingStrategy(streamCachingStrategy);
}
项目:Camel    文件:CamelContext.java   
/**
 * Gets the {@link StreamCachingStrategy} to use.
 */
StreamCachingStrategy getStreamCachingStrategy();
项目:Camel    文件:CamelContext.java   
/**
 * Sets a custom {@link StreamCachingStrategy} to use.
 */
void setStreamCachingStrategy(StreamCachingStrategy streamCachingStrategy);