Created
December 26, 2016 19:34
-
-
Save atishn/9daa5c6e5a1f9e7a8fef3ebc185115d7 to your computer and use it in GitHub Desktop.
This file contains 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
@Component | |
@Service | |
public class CacheServiceImpl implements CacheService { | |
@Activate | |
void onActivate() { | |
URL url = getClass().getResource("/ehcache.xml"); | |
cacheManager = CacheManager.create(url); | |
registerMBeans(); | |
cacheManager.clearAll(); | |
} | |
@Deactivate | |
void onDeactivate() { | |
if (cacheManager != null) { | |
cacheManager.shutdown(); | |
cacheManager = null; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment