- public ChatHome chatHome(
- ChatroomFactory chatroomFactory,
- StorageStrategy storageStrategy)
- {
- return new ChatHome(chatroomFactory, storageStrategy.readChatrooms());
- }
-
- @Bean
- public StorageStrategy storageStrategy(
- ChatBackendProperties properties,
- ObjectMapper mapper,
- ChatroomFactory chatroomFactory)
- {
- return new LocalJsonFilesStorageStrategy(
- Paths.get(properties.getDatadir()),
- mapper,
- chatroomFactory);
- }
-
- @Bean
- ChatroomFactory chatroomFactory(ChatBackendProperties properties)
- {
- return new InMemoryChatroomFactory(properties.getChatroomBufferSize());
- }
-
- @Bean
- public Clock clock()