Initialize naming support.
()
| 999 | * Initialize naming support. |
| 1000 | */ |
| 1001 | protected void initNaming() { |
| 1002 | // Setting additional variables |
| 1003 | if (!useNaming) { |
| 1004 | log.info(sm.getString("catalina.noNaming")); |
| 1005 | System.setProperty("catalina.useNaming", "false"); |
| 1006 | } else { |
| 1007 | System.setProperty("catalina.useNaming", "true"); |
| 1008 | String value = "org.apache.naming"; |
| 1009 | String oldValue = System.getProperty(javax.naming.Context.URL_PKG_PREFIXES); |
| 1010 | if (oldValue != null) { |
| 1011 | value = value + ":" + oldValue; |
| 1012 | } |
| 1013 | System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, value); |
| 1014 | if (log.isDebugEnabled()) { |
| 1015 | log.debug(sm.getString("catalina.namingPrefix", value)); |
| 1016 | } |
| 1017 | value = System.getProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY); |
| 1018 | if (value == null) { |
| 1019 | System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, |
| 1020 | "org.apache.naming.java.javaURLContextFactory"); |
| 1021 | } else { |
| 1022 | log.debug(sm.getString("catalina.initialContextFactory", value)); |
| 1023 | } |
| 1024 | } |
| 1025 | } |
| 1026 | |
| 1027 | |
| 1028 | /** |
no test coverage detected