1 26 27 package org.objectweb.openccm.corba; 28 29 36 37 public class NamingContext 38 { 39 45 48 private org.omg.CosNaming.NamingContext namingContext_; 49 50 56 61 public 62 NamingContext(org.omg.CosNaming.NamingContext namingContext) 63 { 64 namingContext_ = namingContext; 65 } 66 67 73 79 84 public org.omg.CosNaming.NamingContext 85 getNamingContext() 86 { 87 return namingContext_; 88 } 89 90 95 public void 96 setNamingContext(org.omg.CosNaming.NamingContext namingContext) 97 { 98 namingContext_ = namingContext; 99 } 100 101 108 public static org.omg.CosNaming.NameComponent [] 109 toName(String path) 110 { 111 113 org.omg.CosNaming.NameComponent [] result = 114 new org.omg.CosNaming.NameComponent [1]; 115 result[0] = new org.omg.CosNaming.NameComponent (path, ""); 116 return result; 117 } 118 119 125 public void 126 rebind(String path, 127 org.omg.CORBA.Object objRef) 128 { 129 try 130 { 131 namingContext_.rebind(toName(path), objRef); 132 } 133 catch(org.omg.CosNaming.NamingContextPackage.InvalidName exc) 134 { 135 throw new UserExceptionWrapper(exc); 137 } 138 catch(org.omg.CosNaming.NamingContextPackage.NotFound exc) 139 { 140 throw new UserExceptionWrapper(exc); 142 } 143 catch(org.omg.CosNaming.NamingContextPackage.CannotProceed exc) 144 { 145 throw new UserExceptionWrapper(exc); 147 } 148 } 149 150 155 public void 156 unbind(String path) 157 { 158 try 159 { 160 namingContext_.unbind(toName(path)); 161 } 162 catch(org.omg.CosNaming.NamingContextPackage.InvalidName exc) 163 { 164 throw new UserExceptionWrapper(exc); 166 } 167 catch(org.omg.CosNaming.NamingContextPackage.NotFound exc) 168 { 169 throw new UserExceptionWrapper(exc); 171 } 172 catch(org.omg.CosNaming.NamingContextPackage.CannotProceed exc) 173 { 174 throw new UserExceptionWrapper(exc); 176 } 177 } 178 } 179 | Popular Tags |