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

Method init

java/org/apache/catalina/manager/ManagerServlet.java:408–468  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406
407
408 @Override
409 public void init() throws ServletException {
410
411 // Ensure that our ContainerServlet properties have been set
412 if (wrapper == null || context == null) {
413 throw new UnavailableException(sm.getString("managerServlet.noWrapper"));
414 }
415
416 // Set our properties from the initialization parameters
417 String value = getServletConfig().getInitParameter("debug");
418 if (value != null) {
419 try {
420 debug = Integer.parseInt(value);
421 } catch (NumberFormatException e) {
422 // Ignore
423 debug = 0;
424 }
425 }
426
427 // Acquire global JNDI resources if available
428 Service service = Container.getService(host);
429 if (service != null) {
430 Server server = service.getServer();
431 if (server != null) {
432 global = server.getGlobalNamingContext();
433 }
434 }
435
436 // Calculate the directory into which we will be deploying applications
437 versioned = (File) getServletContext().getAttribute(ServletContext.TEMPDIR);
438
439 configBase = new File(context.getCatalinaBase(), "conf");
440 Container container = context;
441 Container host = null;
442 Container engine = null;
443 while (container != null) {
444 if (container instanceof Host) {
445 host = container;
446 }
447 if (container instanceof Engine) {
448 engine = container;
449 }
450 container = container.getParent();
451 }
452 if (engine != null) {
453 configBase = new File(configBase, engine.getName());
454 }
455 if (host != null) {
456 configBase = new File(configBase, host.getName());
457 }
458 // Note: The directory must exist for this to work.
459
460 // Log debugging messages as necessary
461 if (debug >= 1) {
462 log("init: Associated with Deployer '" + oname + "'");
463 if (global != null) {
464 log("init: Global resources are available");
465 }

Callers

nothing calls this directly

Calls 13

getServiceMethod · 0.95
getServerMethod · 0.95
getParentMethod · 0.95
getNameMethod · 0.95
getStringMethod · 0.65
getInitParameterMethod · 0.65
getServletConfigMethod · 0.65
getAttributeMethod · 0.65
getServletContextMethod · 0.65
getCatalinaBaseMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected