1 package org.sapia.ubik.rmi.naming.remote.discovery; 2 3 import java.rmi.RemoteException ; 4 import java.util.Properties ; 5 6 import org.sapia.ubik.rmi.server.StubContainer; 7 8 9 25 public class ServiceDiscoveryEvent { 26 private Properties _attributes; 27 private String _name; 28 private Object _service; 29 30 33 public ServiceDiscoveryEvent(Properties attributes, String name, Object service) { 34 _name = name; 35 _service = service; 36 _attributes = attributes; 37 } 38 39 44 public String getName() { 45 return _name; 46 } 47 48 53 public Object getService() throws RemoteException { 54 if (_service instanceof StubContainer) { 55 return ((StubContainer) _service).toStub(Thread.currentThread() 56 .getContextClassLoader()); 57 } 58 59 return _service; 60 } 61 62 66 public Properties getAttributes() { 67 return _attributes; 68 } 69 70 public String toString() { 71 return "[ name=" + _name + ", service=" + _service + ", attributes=" + 72 _attributes + " ]"; 73 } 74 } 75 | Popular Tags |