本文整理汇总了Java中org.springframework.integration.codec.kryo.PojoCodec类的典型用法代码示例。如果您正苦于以下问题:Java PojoCodec类的具体用法?Java PojoCodec怎么用?Java PojoCodec使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PojoCodec类属于org.springframework.integration.codec.kryo包,在下文中一共展示了PojoCodec类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RedisTestBinder
import org.springframework.integration.codec.kryo.PojoCodec; //导入依赖的package包/类
public RedisTestBinder(RedisConnectionFactory connectionFactory) {
RedisMessageChannelBinder binder = new RedisMessageChannelBinder(connectionFactory);
GenericApplicationContext context = new GenericApplicationContext();
context.getBeanFactory().registerSingleton(IntegrationUtils.INTEGRATION_MESSAGE_BUILDER_FACTORY_BEAN_NAME,
new DefaultMessageBuilderFactory());
DefaultHeaderChannelRegistry channelRegistry = new DefaultHeaderChannelRegistry();
channelRegistry.setReaperDelay(Long.MAX_VALUE);
ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
taskScheduler.afterPropertiesSet();
channelRegistry.setTaskScheduler(taskScheduler);
context.getBeanFactory().registerSingleton(
IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME,
channelRegistry);
context.refresh();
binder.setApplicationContext(context);
binder.setCodec(new PojoCodec());
setBinder(binder);
template = new StringRedisTemplate(connectionFactory);
}
示例2: PubSubTestBinder
import org.springframework.integration.codec.kryo.PojoCodec; //导入依赖的package包/类
public PubSubTestBinder(PubSub pubSub){
this.pubSub = pubSub;
PubSubMessageChannelBinder binder = new PubSubMessageChannelBinder(new PubSubResourceManager(pubSub));
GenericApplicationContext context = new GenericApplicationContext();
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
scheduler.setPoolSize(1);
scheduler.afterPropertiesSet();
context.getBeanFactory().registerSingleton(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME, scheduler);
context.refresh();
binder.setApplicationContext(context);
binder.setCodec(new PojoCodec());
this.setBinder(binder);
}