Author: markt Date: Fri Nov 20 20:28:32 2015 New Revision: 1715413 URL: http://svn.apache.org/viewvc?rev=1715413&view=rev Log: Service.container is always an Engine to so use Engine explicitly
Modified: tomcat/trunk/java/org/apache/catalina/Service.java tomcat/trunk/java/org/apache/catalina/core/StandardService.java Modified: tomcat/trunk/java/org/apache/catalina/Service.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Service.java?rev=1715413&r1=1715412&r2=1715413&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/Service.java (original) +++ tomcat/trunk/java/org/apache/catalina/Service.java Fri Nov 20 20:28:32 2015 @@ -37,11 +37,13 @@ public interface Service extends Lifecyc // ------------------------------------------------------------- Properties - /** * @return the <code>Container</code> that handles requests for all * <code>Connectors</code> associated with this Service. + * + * @deprecated Return value will be narrowed to Engine in Tomcat 9. */ + @Deprecated public Container getContainer(); /** @@ -49,10 +51,22 @@ public interface Service extends Lifecyc * <code>Connectors</code> associated with this Service. * * @param container The new Container + * + * @deprecated Use {@link #setContainer(Engine)} Will be removed in Tomcat + * 9. */ + @Deprecated public void setContainer(Container container); /** + * Set the <code>Engine</code> that handles requests for all + * <code>Connectors</code> associated with this Service. + * + * @param engine The new Engine + */ + public void setContainer(Engine engine); + + /** * @return the name of this Service. */ public String getName(); Modified: tomcat/trunk/java/org/apache/catalina/core/StandardService.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardService.java?rev=1715413&r1=1715412&r2=1715413&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardService.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardService.java Fri Nov 20 20:28:32 2015 @@ -91,7 +91,10 @@ public class StandardService extends Lif /** * The Container associated with this Service. + * + * @deprecated Will be made private in 9.0.x */ + @Deprecated protected Container container = null; private ClassLoader parentClassLoader = null; @@ -128,20 +131,19 @@ public class StandardService extends Lif } - /** - * Set the <code>Container</code> that handles requests for all - * <code>Connectors</code> associated with this Service. - * - * @param container The new Container - */ @Override public void setContainer(Container container) { + setContainer((Engine) container); + } + + @Override + public void setContainer(Engine engine) { Container oldContainer = this.container; if (oldContainer instanceof Engine) { ((Engine) oldContainer).setService(null); } - this.container = container; + this.container = engine; if (this.container instanceof Engine) { ((Engine) this.container).setService(this); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org