protected void registerHandler(Object key, BaseEjbProxyHandler handler) { HashSet set = (HashSet) getLiveHandleRegistry().get(key); if (set != null) { synchronized (set) { set.add(handler); } } else { set = new HashSet(); set.add(handler); getLiveHandleRegistry().put(key, set); } }
protected void registerHandler(final Object key, final BaseEjbProxyHandler handler) { Set set = (Set) getLiveHandleRegistry().get(key); if (set == null) { set = new HashSet(); final Object existing = getLiveHandleRegistry().putIfAbsent(key, set); if (existing != null) { set = Set.class.cast(existing); } } final ReentrantLock l = lock; l.lock(); try { set.add(handler); } finally { l.unlock(); } }
protected void registerHandler(final Object key, final BaseEjbProxyHandler handler) { Set set = (Set) getLiveHandleRegistry().get(key); if (set == null) { set = new HashSet(); final Object existing = getLiveHandleRegistry().putIfAbsent(key, set); if (existing != null) { set = Set.class.cast(existing); } } final ReentrantLock l = lock; l.lock(); try { set.add(handler); } finally { l.unlock(); } }
protected void invalidateAllHandlers(Object key) { HashSet<BaseEjbProxyHandler> set = (HashSet) getLiveHandleRegistry().remove(key); if (set == null) return; synchronized (set) { for (BaseEjbProxyHandler handler : set) { handler.invalidateReference(); } } }
protected void invalidateAllHandlers(final Object key) { final HashSet<BaseEjbProxyHandler> set = (HashSet) getLiveHandleRegistry().remove(key); if (set == null) { return; } final ReentrantLock l = lock; l.lock(); try { for (final BaseEjbProxyHandler handler : set) { handler.invalidateReference(); } } finally { l.unlock(); } }
protected void invalidateAllHandlers(final Object key) { final HashSet<BaseEjbProxyHandler> set = (HashSet) getLiveHandleRegistry().remove(key); if (set == null) { return; } final ReentrantLock l = lock; l.lock(); try { for (final BaseEjbProxyHandler handler : set) { handler.invalidateReference(); } } finally { l.unlock(); } }