1 23 package com.sun.enterprise.jbi.serviceengine.core; 24 import java.util.Hashtable ; 25 import java.util.Iterator ; 26 import java.util.Map ; 27 import javax.xml.namespace.QName ; 28 29 34 public class EndpointRegistry { 35 36 39 private Hashtable endpoints; 40 41 private static EndpointRegistry store; 42 43 44 private EndpointRegistry() { 45 endpoints = new Hashtable (); 46 } 47 48 public static EndpointRegistry getInstance() { 49 if(store == null) 50 store = new EndpointRegistry(); 51 return store; 52 } 53 54 55 56 59 public void put(QName service, String endpointName, ServiceEngineEndpoint endpoint) { 60 Map map= (Map )endpoints.get(service); 61 if(map == null) { 62 map = new Hashtable (); 63 endpoints.put(service, map); 64 } 65 map.put(endpointName, endpoint); 66 67 } 68 69 72 public ServiceEngineEndpoint get(QName service, String endpointName) { 73 74 Map map= (Map )endpoints.get(service); 75 if(map != null) 76 return (ServiceEngineEndpoint)map.get(endpointName); 77 else 78 return null; 79 80 } 81 82 85 public void delete(QName service, String endpointName) { 86 87 Map map= (Map )endpoints.get(service); 88 map.remove(endpointName); 89 90 } 91 92 public Iterator <ServiceEngineEndpoint> list() { 93 return endpoints.values().iterator(); 94 } 95 } 96 | Popular Tags |