I'd like to configure PicoContainer by giving it a factory method (as @Provides
methods in Guice) to use to create a new instance every time I (re-)start the container. The main point here is that I need that instance to be a singleton during each cycle, in other words I want it to be cached.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I found the solution: configuring a
FactoryInjector
As you can see, pico will create a new instance only the first time. Any subsequent request before stopping the container will return the very same instance.