Created
March 16, 2012 14:15
-
-
Save JensRantil/2050235 to your computer and use it in GitHub Desktop.
Java indentation horror
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Get a local cache manager. It's not replicated nor distributed in any | |
| * way. | |
| * @return | |
| */ | |
| public static BasicCacheHandler getCacheManager(){ | |
| //We jump through these hoops so we don't have to deploy a ehcache.xml | |
| if (cache_manager==null) { | |
| // Trying not to make the lock | |
| synchronized (CacheHandler.class) { | |
| if(cache_manager==null) { | |
| // if we did happen to instantiate a cache handler before | |
| // entering the synchronized block | |
| cache_manager = new BasicCacheHandler(); | |
| } | |
| } | |
| } | |
| return cache_manager; | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to figure out if it would be possible to use a
CountDownLatchfor this. Not sure though...