use of org.apache.catalina.Container in project tomcat by apache.
the class SimpleTcpCluster method setContainer.
/**
* Set the Container associated with our Cluster
*
* @param container
* The Container to use
*/
@Override
public void setContainer(Container container) {
Container oldContainer = this.container;
this.container = container;
support.firePropertyChange("container", oldContainer, this.container);
}
use of org.apache.catalina.Container in project tomcat by apache.
the class ContextConfig method getServer.
private Server getServer() {
Container c = context;
while (c != null && !(c instanceof Engine)) {
c = c.getParent();
}
if (c == null) {
return null;
}
Service s = ((Engine) c).getService();
if (s == null) {
return null;
}
return s.getServer();
}
use of org.apache.catalina.Container in project tomcat by apache.
the class HostConfig method undeploy.
private void undeploy(DeployedApplication app) {
if (log.isInfoEnabled())
log.info(sm.getString("hostConfig.undeploy", app.name));
Container context = host.findChild(app.name);
try {
host.removeChild(context);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
log.warn(sm.getString("hostConfig.context.remove", app.name), t);
}
deployed.remove(app.name);
}
use of org.apache.catalina.Container in project tomcat by apache.
the class ValveBase method getObjectNameKeyProperties.
// -------------------- JMX and Registration --------------------
@Override
public String getObjectNameKeyProperties() {
StringBuilder name = new StringBuilder("type=Valve");
Container container = getContainer();
name.append(container.getMBeanKeyProperties());
int seq = 0;
// Pipeline may not be present in unit testing
Pipeline p = container.getPipeline();
if (p != null) {
for (Valve valve : p.getValves()) {
// Skip null valves
if (valve == null) {
continue;
}
// Only compare valves in pipeline until we find this valve
if (valve == this) {
break;
}
if (valve.getClass() == this.getClass()) {
// Duplicate valve earlier in pipeline
// increment sequence number
seq++;
}
}
}
if (seq > 0) {
name.append(",seq=");
name.append(seq);
}
String className = this.getClass().getName();
int period = className.lastIndexOf('.');
if (period >= 0) {
className = className.substring(period + 1);
}
name.append(",name=");
name.append(className);
return name.toString();
}
use of org.apache.catalina.Container in project spring-boot by spring-projects.
the class LocalDevToolsAutoConfigurationTests method devToolsSwitchesJspServletToDevelopmentMode.
@Test
public void devToolsSwitchesJspServletToDevelopmentMode() {
this.context = initializeAndRun(Config.class);
TomcatWebServer tomcatContainer = (TomcatWebServer) ((ServletWebServerApplicationContext) this.context).getWebServer();
Container context = tomcatContainer.getTomcat().getHost().findChildren()[0];
StandardWrapper jspServletWrapper = (StandardWrapper) context.findChild("jsp");
EmbeddedServletOptions options = (EmbeddedServletOptions) ReflectionTestUtils.getField(jspServletWrapper.getServlet(), "options");
assertThat(options.getDevelopment()).isEqualTo(true);
}
Aggregations