protected void initPerInstanceAspectDefinitionsSet() { if (perInstanceAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_SET) { synchronized(lazyCollectionLock) { if (perInstanceAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_CONCURRENT_SET) { perInstanceAspectDefinitions = new ConcurrentSet<AspectDefinition>(16, .75f, 2); } } } }
/** * Constructs a new set containing the elements in the specified * collection. The <tt>ConcurrentHashMap</tt> is created with default load factor * (0.75) and an initial capacity sufficient to contain the elements in * the specified collection. * * @param c the collection whose elements are to be placed into this set. * @throws NullPointerException if the specified collection is null. */ public ConcurrentSet(Collection<? extends E> c) { super(new ConcurrentHashMap<E, Object>(Math.max((int)(c.size() / .75f) + 1, 16))); addAll(c); }
/** * Defines the concurrent set implementation * * @param <T> the type * @return the set */ public static final <T> Set<T> createConcurrentSet() { return new ConcurrentSet<T>(); }
/** * Restore black list. */ protected void restoreBlackList() { classBlackList = new ConcurrentSet<String>(); resourceBlackList = new ConcurrentSet<String>(); }
public void addPerInstanceJoinpointAspect(Joinpoint joinpoint, AspectDefinition def) { Set<Joinpoint> joinpoints = perInstanceJoinpointAspectDefinitions.get(def); if (joinpoints == null) { joinpoints = new ConcurrentSet<Joinpoint>(); initPerInstanceJoinpointAspectDefinitionsMap(); perInstanceJoinpointAspectDefinitions.put(def, joinpoints); def.registerAdvisor(this); } joinpoints.add(joinpoint); }
void addPerInstanceJoinpointAspect(Set<Joinpoint> joinpoints, AspectDefinition def) { initPerInstanceJoinpointAspectDefinitionsMap(); Set<Joinpoint> setJoinpoints = perInstanceJoinpointAspectDefinitions.get(def); if (setJoinpoints == null) { setJoinpoints = new ConcurrentSet<Joinpoint>(); perInstanceJoinpointAspectDefinitions.put(def, setJoinpoints); def.registerAdvisor(this); } setJoinpoints.addAll(joinpoints); }
public void semiResolved(DependencyItem item) { if (tracking) { ControllerState whenRequired = item.getWhenRequired(); Map<ControllerState, Set<DependencyItem>> semiResolved = this.semiResolved; if (semiResolved == null) { this.semiResolved = new ConcurrentHashMap<ControllerState, Set<DependencyItem>>(); semiResolved = this.semiResolved; } Set<DependencyItem> items = semiResolved.get(whenRequired); if (items == null) { items = new ConcurrentSet<DependencyItem>(); semiResolved.put(whenRequired, items); } items.add(item); removeUnresolved(item, whenRequired); } }
public void unresolved(DependencyItem item) { if (tracking) { ControllerState whenRequired = item.getWhenRequired(); Map<ControllerState, Set<DependencyItem>> unresolved = this.unresolved; if (unresolved == null) { this.unresolved = new ConcurrentHashMap<ControllerState, Set<DependencyItem>>(); unresolved = this.unresolved; } Set<DependencyItem> items = unresolved.get(whenRequired); if (items == null) { items = new ConcurrentSet<DependencyItem>(); unresolved.put(whenRequired, items); } items.add(item); removeSemiResolved(item, whenRequired); } }
if (items == null) items = new ConcurrentSet<DependencyItem>(); unresolved.put(whenRequired, items);
/** * Create a new ClassLoader with no parent. * * @param policy the policy * @throws IllegalArgumentException for a null policy * @throws IllegalStateException if the policy is already associated with a classloader */ public BaseClassLoader(ClassLoaderPolicy policy) { super(null); if (policy == null) throw new IllegalArgumentException("Null policy"); this.policy = policy; BaseClassLoaderPolicy basePolicy = policy; basePolicy.setClassLoader(this); loader = new DelegateLoader(policy); if (basePolicy.isCacheable()) resourceCache = new ConcurrentHashMap<String, URL>(); if (basePolicy.isBlackListable()) blackList = new ConcurrentSet<String>(); log.debugf("Created %1s with policy %2s", this, policy); }
this.registeredKeys = new ConcurrentSet<ProfileKey>(); List<ProfileKey> keys = controller.getActiveProfiles();