1 45 package org.exolab.jms.net.orb; 46 47 import java.rmi.AlreadyBoundException ; 48 import java.rmi.NotBoundException ; 49 import java.rmi.RemoteException ; 50 import java.rmi.server.ObjID ; 51 52 import org.exolab.jms.net.proxy.Proxy; 53 import org.exolab.jms.net.registry.LocalRegistry; 54 55 56 63 class RegistryService implements LocalRegistry { 64 65 68 private RegistryImpl _registry = new RegistryImpl(); 69 70 71 78 public RegistryService(ORB orb) throws RemoteException { 79 if (orb == null) { 80 throw new IllegalArgumentException ("Argument 'orb' is null"); 81 } 82 orb.exportObject(_registry, new ObjID (ObjID.REGISTRY_ID)); 83 } 84 85 92 public Proxy lookup(String name) throws NotBoundException { 93 return _registry.lookup(name); 94 } 95 96 103 public void bind(String name, Proxy proxy) throws AlreadyBoundException { 104 _registry.doBind(name, proxy); 105 } 106 107 113 public synchronized void unbind(String name) throws NotBoundException { 114 _registry.doUnbind(name); 115 } 116 117 123 public void setReadOnly(boolean readOnly) { 124 _registry.setReadOnly(readOnly); 125 } 126 127 132 public boolean getReadOnly() { 133 return _registry.getReadOnly(); 134 } 135 136 } 137 | Popular Tags |