Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -CacheService
- -CacheServiceBean
- -getMyObject()
- -insertMyObject(MyObject)
- -size()
- -SomeOtherBean
- cache = jndiLookup(CacheService)
- cache.insertMyObject(x)
- cache.size() -> 1
- @Stateless
- public class CacheSessionBean implements CacheSessionLocal {
- private static Map<String, Object> cacheMap = new HashMap<String, Object>();
- public Object getCache(String key) {
- return cacheMap.get(key);
- }
- public void putCache(String key, Object o) {
- cacheMap.put(key, o);
- }
- }
Add Comment
Please, Sign In to add comment