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

Method init

solr/core/src/java/org/apache/solr/servlet/SolrServlet.java:48–69  ·  view source on GitHub ↗
(ServletConfig config)

Source from the content-addressed store, hash-verified

46 private CoreContainerProvider containerProvider;
47
48 @Override
49 public void init(ServletConfig config) throws ServletException {
50 try {
51 super.init(config);
52 containerProvider = CoreContainerProvider.serviceForContext(config.getServletContext());
53 boolean isCoordinator =
54 NodeRoles.MODE_ON.equals(getCores().nodeRoles.getRoleMode(NodeRoles.Role.COORDINATOR));
55 solrCallFactory =
56 isCoordinator ? new CoordinatorHttpSolrCall.Factory() : new HttpSolrCallFactory() {};
57 if (log.isTraceEnabled()) {
58 log.trace("init(): {}", this.getClass().getClassLoader());
59 }
60 } catch (Throwable t) {
61 // catch this so our servlet still works
62 log.error("Could not start Servlet.", t);
63 if (t instanceof Error) {
64 throw (Error) t;
65 }
66 } finally {
67 log.trace("init() done");
68 }
69 }
70
71 /**
72 * The CoreContainer. It's guaranteed to be constructed before this servlet is initialized, but

Callers

nothing calls this directly

Calls 7

serviceForContextMethod · 0.95
getCoresMethod · 0.95
getRoleModeMethod · 0.80
getClassLoaderMethod · 0.80
initMethod · 0.65
equalsMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected