/** * Add interceptors facility for protocols * @param String protocol name * @param String Interceptor Intializer class name */ public static void addInterceptors(String protocolName, String interceptorInitializer) throws RMIConfigurationException { RMIConfiguration rc = getRMIConfiguration(protocolName); if (rc!=null) { String pref=rc.getInterceptorPrefix(); if (pref!=null) { System.setProperty(pref+"."+interceptorInitializer,""); if (TraceCarol.isDebugCarol()) { TraceCarol.debugCarol("Add Initializer for " + protocolName + ": " +pref+"."+interceptorInitializer); } } } }
/** * private constructor for unicicity */ private NameServiceManager() { if (TraceCarol.isDebugJndiCarol()) { TraceCarol.debugJndiCarol("NameServiceManager.NameServiceManager()"); } try { nsTable = new Hashtable(); //get rmi configuration hashtable Hashtable allRMIConfiguration = CarolConfiguration.getAllRMIConfiguration(); int nbProtocol = allRMIConfiguration.size(); for (Enumeration e = allRMIConfiguration.elements() ; e.hasMoreElements() ;) { RMIConfiguration currentConf = (RMIConfiguration)e.nextElement(); String rmiName = currentConf.getName(); NameService nsC = (NameService)Class.forName(currentConf.getNameService()).newInstance(); nsC.setPort(currentConf.getPort()); // get the Name Service nsTable.put(rmiName, nsC); } } catch (Exception e) { String msg = "NameServiceManager.NameServiceManager() fail"; TraceCarol.error(msg,e); } }
for (Enumeration e = allRMIConfiguration.elements() ; e.hasMoreElements() ;) { RMIConfiguration currentConf = (RMIConfiguration)e.nextElement(); String rmiName = currentConf.getName(); prodHashtable.put(rmiName, (PortableRemoteObjectDelegate)Class.forName(currentConf.getPro()).newInstance()); icHashtable.put(rmiName, currentConf.getJndiProperties()); defaultRMI = CarolConfiguration.getDefaultProtocol().getName();
port = getPortOfUrl(this.jndiProperties.getProperty(CarolDefaultValues.JNDI_URL_PREFIX));