1 28 29 30 package org.objectweb.corba.runtime; 31 32 35 public class RegistrationServiceImpl 36 extends org.omg.CORBA.LocalObject 37 implements RegistrationService 38 { 39 static final private String _class_name = "RegistrationServiceImpl"; 41 static final private String _service_id = RegistrationService.SERVICE_ID; 42 private java.util.HashMap _schemes; 43 44 protected 46 RegistrationServiceImpl() 47 { 48 _schemes = null; 50 } 51 52 56 static public SystemService 57 create_service() 58 { 59 return new RegistrationServiceImpl(); 60 } 61 62 66 final public void 67 system_configuration_complete(SystemConfiguration cfg) 68 { 69 _schemes = new java.util.HashMap (); 70 71 _schemes.put(FileRegistrationScheme.SCHEME_ID, new FileRegistrationSchemeImpl()); 73 _schemes.put(INSRegistrationScheme.SCHEME_ID, new INSRegistrationSchemeImpl()); 74 } 75 76 final public void 77 destroy() 78 { 79 _schemes.clear(); 80 } 81 82 86 final public String 87 service_id() 88 { 89 return _service_id; 90 } 91 92 96 final public void 97 add_scheme(String location, String entrypt) 98 { 99 if (location!=null) { 101 TheClassLoader.addResource(location); 103 } 104 105 RegistrationScheme scheme = (RegistrationScheme)TheClassLoader.newInstance(entrypt); 107 108 if (scheme==null) { 110 final String opname = "add_scheme"; 112 final String msg = "IGNORE (scheme not created)"; 113 TheLogger.debug(_class_name, opname, msg); 114 } 115 116 _schemes.put(scheme.scheme_id(), scheme); 118 } 119 120 121 final public RegistrationScheme 122 get_scheme(String scheme_id) 123 { 124 return (RegistrationScheme)_schemes.get(scheme_id); 125 } 126 } 127 | Popular Tags |