public List<ServiceReference> getReferences(String name){ Map<String,List<ServiceReference>> state = getState(); List<ServiceReference> refs = state.get(name); return refs == null ? null : Collections.unmodifiableList(refs); } public ServiceReference getReference(String name){
public ServiceReference getReference(String name){ Map<String,List<ServiceReference>> state = getState(); List<ServiceReference> refs = state.get(name); return refs == null ? null : refs.get(0); } }
public ServiceReference getReference(String name){ Map<String,List<ServiceReference>> state = getState(); List<ServiceReference> refs = state.get(name); return refs == null ? null : refs.get(0); } }
public List<ServiceReference> getReferences(String name){ Map<String,List<ServiceReference>> state = getState(); List<ServiceReference> refs = state.get(name); return refs == null ? null : Collections.unmodifiableList(refs); } public ServiceReference getReference(String name){
/** * Getter for the read only set of names of all currently active and * tracked engines * @return the names of all currently active and tracked engines */ public Set<String> getNames() { Map<String, List<ServiceReference>> state = getState(); lock.writeLock().lock(); try { return Collections.unmodifiableSet(state.keySet()); } finally { lock.writeLock().unlock(); } } /**
/** * Getter for the read only set of names of all currently active and * tracked engines * @return the names of all currently active and tracked engines */ public Set<String> getNames() { Map<String, List<ServiceReference>> state = getState(); lock.writeLock().lock(); try { return Collections.unmodifiableSet(state.keySet()); } finally { lock.writeLock().unlock(); } } /**
/** * Getter for the read only names -> {@link ServiceReference} of the * currently active and tracked engines. * @return the name -> {@link ServiceReference} mapping of all active * engines. */ public Map<String,ServiceReference> getActive() { Map<String,List<ServiceReference>> state = getState(); Map<String,ServiceReference> active = new HashMap<String,ServiceReference>(state.size()); for(Entry<String,List<ServiceReference>> entry : state.entrySet()){ active.put(entry.getKey(), entry.getValue().get(0)); } return Collections.unmodifiableMap(active); } @Override
/** * Getter for the read only names -> {@link ServiceReference} of the * currently active and tracked engines. * @return the name -> {@link ServiceReference} mapping of all active * engines. */ public Map<String,ServiceReference> getActive() { Map<String,List<ServiceReference>> state = getState(); Map<String,ServiceReference> active = new HashMap<String,ServiceReference>(state.size()); for(Entry<String,List<ServiceReference>> entry : state.entrySet()){ active.put(entry.getKey(), entry.getValue().get(0)); } return Collections.unmodifiableMap(active); } @Override