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

项目:Camel    文件:DefaultCamelContext.java   
private static UuidGenerator createDefaultUuidGenerator() {
    if (System.getProperty("com.google.appengine.runtime.environment") != null) {
        // either "Production" or "Development"
        return new JavaUuidGenerator();
    } else {
        return new ActiveMQUuidGenerator();
    }
}
项目:Camel    文件:DefaultCamelContextTest.java   
public void testCreateDefaultUuidGenerator() {
    DefaultCamelContext ctx = new DefaultCamelContext();
    ctx.disableJMX();
    UuidGenerator uuidGenerator = ctx.getUuidGenerator();
    assertNotNull(uuidGenerator);
    assertEquals(uuidGenerator.getClass(), ActiveMQUuidGenerator.class);
}
项目:Camel    文件:CamelContextFactoryBeanTest.java   
public void testGetDefaultUuidGenerator() throws Exception {
    factory.setApplicationContext(new StaticApplicationContext());
    factory.afterPropertiesSet();

    UuidGenerator uuidGenerator = factory.getContext().getUuidGenerator();

    assertTrue(uuidGenerator instanceof ActiveMQUuidGenerator);
}
项目:Camel    文件:CamelContextFactoryBeanTest.java   
public void testGetCustomUuidGenerator() throws Exception {
    StaticApplicationContext applicationContext = new StaticApplicationContext();
    applicationContext.registerSingleton("uuidGenerator", SimpleUuidGenerator.class);
    factory.setApplicationContext(applicationContext);
    factory.afterPropertiesSet();

    UuidGenerator uuidGenerator = factory.getContext().getUuidGenerator();

    assertTrue(uuidGenerator instanceof SimpleUuidGenerator);
}
项目:Camel    文件:DefaultCamelContext.java   
public UuidGenerator getUuidGenerator() {
    return uuidGenerator;
}
项目:Camel    文件:DefaultCamelContext.java   
public void setUuidGenerator(UuidGenerator uuidGenerator) {
    this.uuidGenerator = uuidGenerator;
}
项目: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);
    }
}
项目:Camel    文件:JmsProducer.java   
public UuidGenerator getUuidGenerator() {
    return uuidGenerator;
}
项目:Camel    文件:JmsProducer.java   
public void setUuidGenerator(UuidGenerator uuidGenerator) {
    this.uuidGenerator = uuidGenerator;
}
项目:Camel    文件:InOutProducer.java   
public UuidGenerator getUuidGenerator() {
    return uuidGenerator;
}
项目:Camel    文件:InOutProducer.java   
public void setUuidGenerator(UuidGenerator uuidGenerator) {
    this.uuidGenerator = uuidGenerator;
}
项目:microservice-bundle    文件:ManagedCamelContext.java   
@Override
public UuidGenerator getUuidGenerator() {
  return context.getUuidGenerator();
}
项目:microservice-bundle    文件:ManagedCamelContext.java   
@Override
public void setUuidGenerator(UuidGenerator uuidGenerator) {
  context.setUuidGenerator(uuidGenerator);
}
项目:dropwizard-camel    文件:ManagedCamelContext.java   
@Override
public UuidGenerator getUuidGenerator() {
    return context.getUuidGenerator();
}
项目:dropwizard-camel    文件:ManagedCamelContext.java   
@Override
public void setUuidGenerator(UuidGenerator uuidGenerator) {
    context.setUuidGenerator(uuidGenerator);
}
项目:Camel    文件:CamelContext.java   
/**
 * Gets the current {@link UuidGenerator}
 *
 * @return the uuidGenerator
 */
UuidGenerator getUuidGenerator();
项目:Camel    文件:CamelContext.java   
/**
 * Sets a custom {@link UuidGenerator} (should only be set once) 
 *
 * @param uuidGenerator the UUID Generator
 */
void setUuidGenerator(UuidGenerator uuidGenerator);