1 29 30 package com.caucho.iiop; 31 32 import com.caucho.loader.EnvironmentLocal; 33 import com.caucho.util.Log; 34 35 import java.util.HashMap ; 36 import java.util.logging.Logger ; 37 38 41 public class IiopContext { 42 private static final Logger log = Log.open(IiopContext.class); 43 44 private static final EnvironmentLocal<IiopContext> _localIiop = 45 new EnvironmentLocal<IiopContext>(); 46 47 private HashMap <String ,IiopRemoteService> _serviceMap 48 = new HashMap <String ,IiopRemoteService>(); 49 50 53 public static IiopContext getLocalContext() 54 { 55 return _localIiop.get(); 56 } 57 58 61 public static void setLocalContext(IiopContext context) 62 { 63 _localIiop.set(context); 64 } 65 66 69 public void setService(String url, IiopRemoteService service) 70 { 71 log.fine("IIOP: add-service " + url); 72 _serviceMap.put(url, service); 73 } 74 75 78 public void removeService(String url) 79 { 80 log.fine("IIOP: remove-service " + url); 81 _serviceMap.remove(url); 82 } 83 84 87 public IiopRemoteService getService(String url) 88 { 89 return _serviceMap.get(url); 90 } 91 } 92 | Popular Tags |