1 5 6 package org.joseki.server; 7 8 import java.util.* ; 9 10 19 public class DispatcherRegistry 20 { 21 private DispatcherRegistry() {} 23 24 static DispatcherRegistry instance = new DispatcherRegistry() ; 25 static public DispatcherRegistry getInstance() { return instance ; } 26 27 Map registry = new HashMap() ; 28 29 public void add(String name, Dispatcher dispatcher) 30 { 31 registry.put(name, dispatcher) ; 32 } 33 34 public void remove(String name) 35 { 36 registry.remove(name) ; 37 } 38 39 public Dispatcher find(String name) 40 { 41 return (Dispatcher)registry.get(name) ; 42 } 43 44 public boolean contains(String name) 45 { 46 return registry.containsKey(name) ; 47 } 48 49 public Iterator registeredNames() 50 { 51 return registry.keySet().iterator() ; 52 } 53 54 public Iterator registeredDispatchers() 55 { 56 return registry.values().iterator() ; 57 } 58 } 59 60 86 87 | Popular Tags |