use of org.apache.catalina.Container in project tomee by apache.
the class GlobalListenerSupport method engineAdded.
/**
* Engine is added.
*
* @param engine tomcat engine
*/
private void engineAdded(final StandardEngine engine) {
addContextListener(engine);
for (final Container child : engine.findChildren()) {
if (child instanceof StandardHost) {
final StandardHost host = (StandardHost) child;
hostAdded(host);
}
}
}
use of org.apache.catalina.Container in project tomee by apache.
the class GlobalListenerSupport method engineRemoved.
/**
* Engine is removed.
*
* @param engine tomcat engine
*/
private void engineRemoved(final StandardEngine engine) {
for (final Container child : engine.findChildren()) {
if (child instanceof StandardHost) {
final StandardHost host = (StandardHost) child;
hostRemoved(host);
}
}
}
use of org.apache.catalina.Container in project tomee by apache.
the class GlobalListenerSupport method serviceAdded.
/**
* Service is added.
*
* @param service tomcat service
*/
private void serviceAdded(final Service service) {
final Container container = service.getContainer();
if (container instanceof StandardEngine) {
final StandardEngine engine = (StandardEngine) container;
engineAdded(engine);
}
}
use of org.apache.catalina.Container in project tomcat by apache.
the class StandardHost method getConfigBaseFile.
/**
* ({@inheritDoc}
*/
@Override
public File getConfigBaseFile() {
if (hostConfigBase != null) {
return hostConfigBase;
}
String path = null;
if (getXmlBase() != null) {
path = getXmlBase();
} else {
StringBuilder xmlDir = new StringBuilder("conf");
Container parent = getParent();
if (parent instanceof Engine) {
xmlDir.append('/');
xmlDir.append(parent.getName());
}
xmlDir.append('/');
xmlDir.append(getName());
path = xmlDir.toString();
}
File file = new File(path);
if (!file.isAbsolute())
file = new File(getCatalinaBase(), path);
try {
file = file.getCanonicalFile();
} catch (IOException e) {
// ignore
}
this.hostConfigBase = file;
return file;
}
use of org.apache.catalina.Container in project tomcat by apache.
the class ApplicationContext method getVirtualServerName.
@Override
public String getVirtualServerName() {
// Constructor will fail if context or its parent is null
Container host = context.getParent();
Container engine = host.getParent();
return engine.getName() + "/" + host.getName();
}
Aggregations