use of org.apache.catalina.Container in project tomcat by apache.
the class StandardContext method getMaxTime.
/**
* Gets the maximum processing time of all servlets in this
* StandardContext.
*
* @return Maximum processing time of all servlets in this
* StandardContext
*/
public long getMaxTime() {
long result = 0;
long time;
Container[] children = findChildren();
if (children != null) {
for (int i = 0; i < children.length; i++) {
time = ((StandardWrapper) children[i]).getMaxTime();
if (time > result)
result = time;
}
}
return result;
}
use of org.apache.catalina.Container in project tomcat by apache.
the class StandardContext method getRequestCount.
/**
* Gets the cumulative request count of all servlets in this
* StandardContext.
*
* @return Cumulative request count of all servlets in this
* StandardContext
*/
public int getRequestCount() {
int result = 0;
Container[] children = findChildren();
if (children != null) {
for (int i = 0; i < children.length; i++) {
result += ((StandardWrapper) children[i]).getRequestCount();
}
}
return result;
}
use of org.apache.catalina.Container in project tomcat by apache.
the class StandardService method getDomainInternal.
@Override
protected String getDomainInternal() {
String domain = null;
Container engine = getContainer();
// Use the engine name first
if (engine != null) {
domain = engine.getName();
}
// No engine or no engine name, use the service name
if (domain == null) {
domain = getName();
}
// default
return domain;
}
use of org.apache.catalina.Container in project tomcat by apache.
the class FarmWarDeployer method start.
/*--Logic---------------------------------------------------*/
@Override
public void start() throws Exception {
if (started)
return;
Container hcontainer = getCluster().getContainer();
if (!(hcontainer instanceof Host)) {
log.error(sm.getString("farmWarDeployer.hostOnly"));
return;
}
host = (Host) hcontainer;
// Check to correct engine and host setup
Container econtainer = host.getParent();
if (!(econtainer instanceof Engine)) {
log.error(sm.getString("farmWarDeployer.hostParentEngine", host.getName()));
return;
}
Engine engine = (Engine) econtainer;
String hostname = null;
hostname = host.getName();
try {
oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + hostname);
} catch (Exception e) {
log.error(sm.getString("farmWarDeployer.mbeanNameFail", engine.getName(), hostname), e);
return;
}
if (watchEnabled) {
watcher = new WarWatcher(this, getWatchDirFile());
if (log.isInfoEnabled()) {
log.info(sm.getString("farmWarDeployer.watchDir", getWatchDir()));
}
}
configBase = host.getConfigBaseFile();
// Retrieve the MBean server
mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
started = true;
count = 0;
getCluster().addClusterListener(this);
if (log.isInfoEnabled())
log.info(sm.getString("farmWarDeployer.started"));
}
use of org.apache.catalina.Container in project tomcat by apache.
the class RealmBase method setContainer.
/**
* Set the Container with which this Realm has been associated.
*
* @param container The associated Container
*/
@Override
public void setContainer(Container container) {
Container oldContainer = this.container;
this.container = container;
support.firePropertyChange("container", oldContainer, this.container);
}
Aggregations