While TomcatEmbeddedContext has a TomcatStarter field, it's only ever non-null when the context has been created by TomcatServletWebServerFactory. Review this arrangement to see if TomcatStarter can become servlet-specific and move to the same package as TomcatServletWebServerFactory. This would allow it to become package-private.