1 28 package org.objectweb.carol.util.configuration; 29 30 import java.util.Properties ; 31 import java.util.StringTokenizer ; 32 33 38 public class CarolDefaultValues { 39 40 43 public static final String CAROL_DEFAULT_CONFIGURATION_FILE = "carol-defaults.properties"; 44 45 48 public static final String CAROL_CONFIGURATION_FILE = "carol.properties"; 49 50 53 public static final String CAROL_PREFIX = "carol"; 54 55 58 public static final String SERVER_MODE = CAROL_PREFIX + ".server.mode"; 59 60 63 public static final String SERVER_IIOP_PORT = CAROL_PREFIX + ".iiop.server.port"; 64 65 68 public static final String SERVER_IRMI_PORT = CAROL_PREFIX + ".irmi.server.port"; 69 70 73 public static final String SERVER_JRMP_PORT = CAROL_PREFIX + ".jrmp.server.port"; 74 75 78 public static final String SERVER_JEREMIE_PORT = CAROL_PREFIX + ".jeremie.server.port"; 79 80 83 public static final String SERVER_SSL_IIOP_PORT = CAROL_PREFIX + ".iiop.server.sslport"; 84 85 88 public static final int DEFAULT_SSL_PORT = 2003; 89 90 93 public static final String DEFAULT_HOST = "localhost"; 94 95 98 public static final String JNDI_PREFIX = "jndi"; 99 100 103 public static final String JVM_PREFIX = "jvm"; 104 105 108 public static final String NS_PREFIX = "NameServiceClass"; 109 110 113 public static final String PRO_PREFIX = "PortableRemoteObjectClass"; 114 115 118 public static final String URL_PREFIX = "url"; 119 120 123 public static final String LOCAL_JRMP_PROPERTY = "rmi.local.call"; 124 125 128 public static final String FACTORY_PREFIX = "context.factory"; 129 130 133 public static final String START_NS_PREFIX = "start.ns"; 134 135 138 public static final String START_NS_KEY = "carol.start.ns"; 139 140 143 public static final String START_RMI_KEY = "carol.start.rmi"; 144 145 148 public static final String START_JNDI_KEY = "carol.start.jndi"; 149 150 153 public static final String DEFAULT_PROTOCOLS_KEY = "carol.protocols.default"; 154 155 158 public static final String PROTOCOLS_KEY = "carol.protocols"; 159 160 163 public static final String MULTI_RMI_PREFIX = "multi"; 164 165 168 public static final String MULTI_PROD = "org.objectweb.carol.rmi.multi.MultiPRODelegate"; 169 170 173 public static final String MULTI_JNDI = "org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory"; 174 175 178 public static final String INTERCEPTOR_PKGS_PREFIX = "interceptor.pkgs"; 179 180 183 public static final String INTERCEPTOR_VALUES_PREFIX = "interceptors"; 184 185 186 189 private static Properties mapping = new Properties (); 190 191 static { 192 mapping.setProperty("rmi", "jrmp"); 193 mapping.setProperty("iiop", "iiop"); 194 mapping.setProperty("jrmi", "jeremie"); 195 mapping.setProperty("cmi", "cmi"); 196 } 197 198 203 public static String getRMIProtocol(String url) { 204 if (url != null) { 205 StringTokenizer st = new StringTokenizer (url, "://"); 206 if (!st.hasMoreTokens()) { 207 throw new IllegalArgumentException ("The given url '" + url + "' is not on the format protocol://<something>."); 208 } 209 String pref = st.nextToken().trim(); 210 return mapping.getProperty(pref, pref); 211 } else { 212 return null; 213 } 214 } 215 216 219 private CarolDefaultValues() { 220 221 } 222 } 223 | Popular Tags |