Provide additional interface or annotation "Daemon" or "Singleton"
Opened this issue · 2 comments
watarhu commented
The idea is that with this interface or annotation detected in the adapter or implementation the service repository treat itself as singleton automatically.
watarhu commented
Its not necessary to convert to singleton any daemon, should be better to interpret that a runnable that it's singleton should be started at the beginning by this way you could start a daemon without so much complication,
watarhu commented
From #26 (Add annotation to indicate if the service is or not threadsafe to check possible problems), that proposes a similar problem but with alternative solution:
- Add annotation (for example @ThreadSafe/@threadunsafe) in order to have some flag to control if some service is prepared to be a singleton.
- If the annotation @threadunsafe is found then a warning should be printed in log to warning that use as singleton can create unexpected results.