[
https://issues.apache.org/jira/browse/ONAMI-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585371#comment-13585371
]
Mikhail Mazursky commented on ONAMI-85:
---------------------------------------
Patch looks very good. Few minor things:
- test with Executors.newSingleThreadExecutor() should shutdown the executor in
a finally block to avoid preventing JVM termination by active thread;
- In the same test you can just wait on Future returned by executor;
- I think it's better to always set timeout for waiting in such cases in tests
- like 1 minute. Just to avoid locking JVM in case of some bug in test;
- ConcurrentLazySingletonScope should have private constructor and be final
probably;
- i think ConcurrentLazySingletonScopeImpl's "locks" field should not be static
- this is not an instance independent state i.e. scope for locks is instance of
ConcurrentLazySingletonScopeImpl;
- getLock() should be called just before "try", not inside the block - this
will also allow to remove null check from releaseLock();
- LockRecord instances may be used as lock objects - no need to create separate
objects for that because LockRecord instances are not exposed.
WDYT?
> Add support for LazySingletons and other such scopes
> ----------------------------------------------------
>
> Key: ONAMI-85
> URL: https://issues.apache.org/jira/browse/ONAMI-85
> Project: Apache Onami
> Issue Type: New Feature
> Components: scopes
> Affects Versions: scopes-1.0.0
> Reporter: Jordan Zimmerman
> Fix For: scopes-1.0.0
>
> Attachments: ONAMI-85.patch
>
>
> Add a new sub-component, scopes, that adds various interesting Guice Scopes
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira