MCPcopy Create free account
hub / github.com/apache/tomcat / initNaming

Method initNaming

java/org/apache/catalina/startup/Catalina.java:1001–1025  ·  view source on GitHub ↗

Initialize naming support.

()

Source from the content-addressed store, hash-verified

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 /**

Callers 1

loadMethod · 0.95

Calls 6

infoMethod · 0.65
getStringMethod · 0.65
getPropertyMethod · 0.65
isDebugEnabledMethod · 0.65
debugMethod · 0.65
setPropertyMethod · 0.45

Tested by

no test coverage detected