| Method from org.jboss.web.tomcat.tc4.EmbeddedTomcatService Detail: |
public int getActiveThreadCount() {
return stats.concurrentCalls;
}
Get the active thread count |
public String getCatalinaBase() {
return this.catalinaBase;
}
|
public String getCatalinaHome() {
return this.catalinaHome;
}
|
public Element getConfig() {
return this.extendedConfig;
}
|
public boolean getDeleteWorkDirs() {
return this.deleteWorkDirs;
}
Get the delete work dirs on undeployment flag. |
public int getMaxActiveThreadCount() {
return stats.maxConcurrentCalls;
}
Get the maximal active thread count |
public String getName() {
return NAME;
}
|
public int getSnapshotInterval() {
return this.snapshotInterval;
}
Get the snapshot interval |
public String getSnapshotMode() {
return this.snapshotMode;
}
|
public InvocationStatistics getStats() {
return stats;
}
|
public String getSubjectAttributeName() {
return this.subjectAttributeName;
}
|
public boolean getUseJBossWebLoader() {
return useJBossWebLoader;
}
|
protected void performDeploy(WebApplication appInfo,
String warUrl,
WebDescriptorParser webAppParser) throws Exception {
WebMetaData metaData = appInfo.getMetaData();
String ctxPath = metaData.getContextRoot();
if (ctxPath.equals("/"))
{
ctxPath = "";
metaData.setContextRoot(ctxPath);
}
log.info("deploy, ctxPath=" + ctxPath + ", warUrl=" + warUrl);
URL url = new URL(warUrl);
createWebContext(appInfo, url, webAppParser);
log.debug("Initialized: " + appInfo);
}
Perform the tomcat specific deployment steps. |
public void performUndeploy(String warUrl) throws Exception {
// find the javax.servlet.ServletContext in the repository
WebApplication appInfo = getDeployedApp(warUrl);
if (appInfo == null)
{
log.debug("performUndeploy, no WebApplication found for URL " + warUrl);
return;
}
log.info("undeploy, ctxPath=" + appInfo.getMetaData().getContextRoot() + ", warUrl=" + warUrl);
// Unreqister the servlet mbeans
DeploymentInfo di = appInfo.getDeploymentInfo();
Iterator iter = di.mbeans.iterator();
while (iter.hasNext())
{
ObjectName name = (ObjectName) iter.next();
try
{
server.unregisterMBean(name);
}
catch (Exception ignore)
{
}
}
StandardContext context = (StandardContext) appInfo.getAppData();
if (context == null)
throw new DeploymentException("URL " + warUrl + " is not deployed");
File workDir = (File) context.getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
String ctxPath = context.getPath();
Deployer deployer = (Deployer) context.getParent();
deployer.remove(ctxPath);
// Cleanup the webapp resources
Container[] children = context.findChildren();
for(int i = 0; i < children.length; i ++)
context.removeChild(children[i]);
LifecycleListener[] listeners = context.findLifecycleListeners();
for(int i = 0; i < listeners.length; i ++)
context.removeLifecycleListener(listeners[i]);
// Unbind the ENC now that the web app is shutdown
ClassLoader currentLoader = Thread.currentThread().getContextClassLoader();
ClassLoader encLoader = appInfo.getMetaData().getENCLoader();
Thread.currentThread().setContextClassLoader(encLoader);
InitialContext ctx = new InitialContext();
ctx.unbind("java:comp/env");
Thread.currentThread().setContextClassLoader(currentLoader);
context.setLoader(null);
context.setLogger(null);
context.setManager(null);
context.setParent(null);
context.setParentClassLoader(null);
context.setRealm(null);
context.setResources(null);
if (workDir != null && deleteWorkDirs == true)
{
log.debug("Deleting catalina work dir: " + workDir);
Files.delete(workDir);
}
}
Perform the tomcat specific deployment steps. |
public void resetStats() {
stats.resetStats();
}
|
public void setCatalinaBase(String catalinaBase) {
this.catalinaBase = catalinaBase;
}
|
public void setCatalinaHome(String catalinaHome) {
this.catalinaHome = catalinaHome;
}
|
public void setConfig(Element config) {
this.extendedConfig = config;
}
This method is invoked to import an arbitrary XML configuration tree.
Subclasses should override this method if they support such a configuration
capability. This implementation does nothing. |
public void setDeleteWorkDirs(boolean flag) {
this.deleteWorkDirs = flag;
}
Set the delete work dirs on undeployment flag. By default catalina
does not delete its working directories when a context is stopped and
this can cause jsp pages in redeployments to not be recompiled if the
timestap of the file in the war has not been updated. This defaults to true. |
public void setSnapshotInterval(int interval) {
this.snapshotInterval = interval;
}
Set the snapshot interval in milliseconds for snapshot mode = interval |
public void setSnapshotMode(String mode) {
this.snapshotMode = mode;
}
Set the snapshot mode. Currently supported: instant or interval |
public void setSubjectAttributeName(String name) {
this.subjectAttributeName = name;
}
|
public void setUseJBossWebLoader(boolean flag) {
this.useJBossWebLoader = flag;
}
|
public void startService() throws Exception {
// Start create the embeded catalina container but don't let it overwrite the thread class loader
ClassLoader cl = Thread.currentThread().getContextClassLoader();
ClassLoader parent = cl;
while (parent != null)
{
log.trace(parent);
URL[] urls = super.getClassLoaderURLs(parent);
for (int u = 0; u < urls.length; u++)
log.trace(" " + urls[u]);
parent = parent.getParent();
}
// Determine the catalina debug level from the enabled priority
debugLevel = 0;
if (log.isTraceEnabled())
debugLevel = 3;
log.debug("Setting catalina debug level to: " + debugLevel);
try
{
// Set the catalina.home property from the Embedded class location
if (catalinaHome == null)
{
ProtectionDomain pd = Embedded.class.getProtectionDomain();
URL homeURL = pd.getCodeSource().getLocation();
String homePath = homeURL.getFile();
File homeDir = new
File(homePath).getParentFile().getParentFile().getParentFile();
catalinaHome = homeDir.getCanonicalPath();
}
if (catalinaBase == null)
catalinaBase = catalinaHome;
log.debug("Setting catalina.home to: " + catalinaHome);
log.debug("Setting catalina.base to: " + catalinaBase);
System.setProperty("catalina.home", catalinaHome);
System.setProperty("catalina.base", catalinaBase);
initCatalina(cl);
catalina.start();
}
finally
{
Thread.currentThread().setContextClassLoader(cl);
}
log.info("OK");
// Invoke the super method to register as a deployer
super.startService();
}
|
public void stopService() throws Exception {
super.stopService();
if (catalina != null)
{
catalina.stop();
}
}
|