Methods Summary |
---|
public void | addAlias(java.lang.String alias)Add an alias name that should be mapped to this same Host.
// START OF PE 4989789
//alias = alias.toLowerCase();
// START OF PE 4989789
// Skip duplicate aliases
for (int i = 0; i < aliases.length; i++) {
if (aliases[i].equals(alias))
return;
}
// Add this alias to the list
String newAliases[] = new String[aliases.length + 1];
for (int i = 0; i < aliases.length; i++)
newAliases[i] = aliases[i];
newAliases[aliases.length] = alias;
aliases = newAliases;
// Inform interested listeners
fireContainerEvent(ADD_ALIAS_EVENT, alias);
|
public void | addChild(org.apache.catalina.Container child)Add a child Container, only if the proposed child is an implementation
of Context.
if (!(child instanceof Context))
throw new IllegalArgumentException
(sm.getString("standardHost.notContext"));
super.addChild(child);
|
public void | addDefaultContext(org.apache.catalina.DefaultContext defaultContext)Set the DefaultContext
for new web applications.
DefaultContext oldDefaultContext = this.defaultContext;
this.defaultContext = defaultContext;
support.firePropertyChange("defaultContext",
oldDefaultContext, this.defaultContext);
|
public void | addErrorPage(org.apache.catalina.deploy.ErrorPage errorPage)Adds the given error page to this StandardHost.
// Validate the input parameters
if (errorPage == null) {
throw new IllegalArgumentException
(sm.getString("standardHost.errorPage.required"));
}
// Add the specified error page to our internal collections
synchronized (statusPages) {
statusPages.put(Integer.valueOf(errorPage.getErrorCode()),
errorPage);
}
fireContainerEvent("addErrorPage", errorPage);
|
public void | addValve(org.apache.catalina.Valve valve)
super.addValve(valve);
if (valve instanceof SingleSignOn) {
sso = (SingleSignOn) valve;
}
|
public void | backgroundProcess()Execute a periodic task, such as reloading, etc. This method will be
invoked inside the classloading context of this container. Unexpected
throwables will be caught and logged.
lifecycle.fireLifecycleEvent("check", null);
|
public javax.management.ObjectName | createObjectName(java.lang.String domain, javax.management.ObjectName parent)
if( log.isDebugEnabled())
log.debug("Create ObjectName " + domain + " " + parent );
return new ObjectName( domain + ":type=Host,host=" + getName());
|
public java.lang.String[] | findAliases()Return the set of alias names for this Host. If none are defined,
a zero length array is returned.
return (this.aliases);
|
public org.apache.catalina.Container | findChild(java.lang.String contextRoot)Returns the context deployed at the given context root.
return super.findChild(RequestUtil.URLDecode(contextRoot));
|
public org.apache.catalina.Context | findDeployedApp(java.lang.String contextPath)Return the Context for the deployed application that is associated
with the specified context path (if any); otherwise return
null .
return (getDeployer().findDeployedApp(contextPath));
|
public java.lang.String[] | findDeployedApps()Return the context paths of all deployed web applications in this
Container. If there are no deployed applications, a zero-length
array is returned.
return (getDeployer().findDeployedApps());
|
public org.apache.catalina.deploy.ErrorPage | findErrorPage(int errorCode)Gets the error page for the specified HTTP error code.
return statusPages.get(Integer.valueOf(errorCode));
|
public org.apache.catalina.Host | findMappingObject()
return (Host) getMappingObject();
|
public int[] | findPorts()Gets the port numbers with which this StandardHost is associated.
return getPorts();
|
public java.lang.String[] | getAliases()
return aliases;
|
public java.lang.String | getAppBase()Return the application root for this Host. This can be an absolute
pathname, a relative pathname, or a URL.
return (this.appBase);
|
public boolean | getAutoDeploy()Return the value of the auto deploy flag. If true, it indicates that
this host's child webapps will be dynamically deployed.
return (this.autoDeploy);
|
public java.lang.String | getConfigClass()Return the Java class name of the context configuration class
for new web applications.
return (this.configClass);
|
public java.lang.String | getContextClass()Return the Java class name of the Context implementation class
for new web applications.
return (this.contextClass);
|
public org.apache.catalina.DefaultContext | getDefaultContext()Retrieve the DefaultContext for new web applications.
return (this.defaultContext);
|
public boolean | getDeployOnStartup()Return the value of the deploy on startup flag. If true, it indicates
that this host's child webapps should be discovred and automatically
deployed at startup time.
return (this.deployOnStartup);
|
public org.apache.catalina.Deployer | getDeployer()
if( deployer!= null )
return deployer;
log.info( "Create Host deployer for direct deployment ( non-jmx ) ");
try {
Class c=Class.forName( STANDARD_HOST_DEPLOYER );
deployer=(Deployer)c.newInstance();
Method m=c.getMethod("setHost", new Class[] {Host.class} );
m.invoke( deployer, new Object[] { this } );
} catch( Throwable t ) {
log.error( "Error creating deployer ", t);
}
return deployer;
|
public java.lang.String | getErrorReportValveClass()Return the Java class name of the error report valve class
for new web applications.
return (this.errorReportValveClass);
|
public java.lang.String | getInfo()Return descriptive information about this Container implementation and
the corresponding version number, in the format
<description>/<version> .
return (info);
|
public boolean | getLiveDeploy()Return the value of the live deploy flag. If true, it indicates that
a background thread should be started that looks for web application
context files, WAR files, or unpacked directories being dropped in to
the appBase directory, and deploys new ones as they are
encountered.
return (this.autoDeploy);
|
public java.lang.String | getName()Return the canonical, fully qualified, name of the virtual host
this Container represents.
return (name);
|
public int[] | getPorts()Gets the port numbers with which this StandardHost is associated.
return (int[])this.ports.clone();
|
public org.apache.catalina.authenticator.SingleSignOn | getSingleSignOn()
return sso;
|
public java.lang.String[] | getValveNames()Return the MBean Names of the Valves assoicated with this Host
Valve [] valves = this.getValves();
String [] mbeanNames = new String[valves.length];
for (int i = 0; i < valves.length; i++) {
if( valves[i] == null ) continue;
if( ((ValveBase)valves[i]).getObjectName() == null ) continue;
mbeanNames[i] = ((ValveBase)valves[i]).getObjectName().toString();
}
return mbeanNames;
|
public java.lang.String | getWorkDir()Host work directory base.
return (workDir);
|
public boolean | getXmlNamespaceAware()Get the server.xml attribute's xmlNamespaceAware.
return xmlNamespaceAware;
|
public boolean | getXmlValidation()Get the server.xml attribute's xmlValidation.
return xmlValidation;
|
public void | importDefaultContext(org.apache.catalina.Context context)Import the DefaultContext config into a web application context.
if( this.defaultContext != null )
this.defaultContext.importDefaultContext(context);
|
public void | init()
if( initialized ) return;
/* CR 6368085
initialized=true;
*/
// already registered.
if( getParent() == null ) {
try {
// Register with the Engine
ObjectName serviceName=new ObjectName(domain + ":type=Engine");
if( mserver.isRegistered( serviceName )) {
log.debug("Registering with the Engine");
mserver.invoke( serviceName, "addChild",
new Object[] { this },
new String[] { "org.apache.catalina.Container" } );
}
} catch( Exception ex ) {
ex.printStackTrace();
}
}
if( oname==null ) {
// not registered in JMX yet - standalone mode
try {
StandardEngine engine=(StandardEngine)parent;
domain=engine.getName();
if (log.isDebugEnabled()) {
log.debug("Registering host " + getName()
+ " with domain " + domain);
}
oname=new ObjectName(domain + ":type=Host,host=" +
this.getName());
// START CR 6368091
controller = oname;
// END CR 6368091
Registry.getRegistry().registerComponent(this, oname, null);
} catch( Throwable t ) {
log.info("Error registering ", t );
}
}
// START CR 6368085
initialized = true;
// END CR 6368085
|
public void | install(java.lang.String contextPath, java.net.URL war)Install a new web application, whose web application archive is at the
specified URL, into this container with the specified context path.
A context path of "" (the empty string) should be used for the root
application for this container. Otherwise, the context path must
start with a slash.
If this application is successfully installed, a ContainerEvent of type
INSTALL_EVENT will be sent to all registered listeners,
with the newly created Context as an argument.
getDeployer().install(contextPath, war);
|
public synchronized void | install(java.net.URL config, java.net.URL war)Install a new web application, whose context configuration file
(consisting of a <Context> element) and web
application archive are at the specified URLs.
If this application is successfully installed, a ContainerEvent
of type INSTALL_EVENT will be sent to all registered
listeners, with the newly created Context as an argument.
getDeployer().install(config, war);
|
public void | installDefaultContext(org.apache.catalina.Context context)Install the StandardContext portion of the DefaultContext
configuration into current Context.
if (defaultContext != null &&
defaultContext instanceof StandardDefaultContext) {
((StandardDefaultContext)defaultContext).installDefaultContext(context);
}
|
public boolean | isDeployXML()Deploy XML Context config files flag accessor.
return (deployXML);
|
public boolean | isSecurePagesWithPragma()Returns the value of the securePagesWithPragma property.
return (this.securePagesWithPragma);
|
public boolean | isUnpackWARs()Unpack WARs flag accessor.
return (unpackWARs);
|
public org.apache.catalina.Context | map(java.lang.String uri)Return the Context that would be used to process the specified
host-relative request URI, if any; otherwise return null .
if (log.isDebugEnabled())
log.debug("Mapping request URI '" + uri + "'");
if (uri == null)
return (null);
// Match on the longest possible context path prefix
if (log.isTraceEnabled())
log.trace(" Trying the longest context path prefix");
Context context = null;
String mapuri = uri;
while (true) {
context = (Context) findChild(mapuri);
if (context != null)
break;
int slash = mapuri.lastIndexOf('/");
if (slash < 0)
break;
mapuri = mapuri.substring(0, slash);
}
// If no Context matches, select the default Context
if (context == null) {
if (log.isTraceEnabled())
log.trace(" Trying the default context");
context = (Context) findChild("");
}
// Complain if no Context has been selected
if (context == null) {
log.error(sm.getString("standardHost.mappingError", uri));
return (null);
}
// Return the mapped Context (if any)
if (log.isDebugEnabled())
log.debug(" Mapped to context '" + context.getPath() + "'");
return (context);
|
public javax.management.ObjectName | preRegister(javax.management.MBeanServer server, javax.management.ObjectName oname)
ObjectName res=super.preRegister(server, oname);
String name=oname.getKeyProperty("host");
if( name != null )
setName( name );
return res;
|
public void | remove(java.lang.String contextPath)Remove an existing web application, attached to the specified context
path. If this application is successfully removed, a
ContainerEvent of type REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument.
getDeployer().remove(contextPath);
|
public void | remove(java.lang.String contextPath, boolean undeploy)Remove an existing web application, attached to the specified context
path. If this application is successfully removed, a
ContainerEvent of type REMOVE_EVENT will be sent to all
registered listeners, with the removed Context as
an argument. Deletes the web application war file and/or directory
if they exist in the Host's appBase.
getDeployer().remove(contextPath,undeploy);
|
public void | removeAlias(java.lang.String alias)Remove the specified alias name from the aliases for this Host.
// START OF PE 4989789
//alias = alias.toLowerCase();
// START OF PE 4989789
synchronized (aliases) {
// Make sure this alias is currently present
int n = -1;
for (int i = 0; i < aliases.length; i++) {
if (aliases[i].equals(alias)) {
n = i;
break;
}
}
if (n < 0)
return;
// Remove the specified alias
int j = 0;
String results[] = new String[aliases.length - 1];
for (int i = 0; i < aliases.length; i++) {
if (i != n)
results[j++] = aliases[i];
}
aliases = results;
}
// Inform interested listeners
fireContainerEvent(REMOVE_ALIAS_EVENT, alias);
|
public void | removeValve(org.apache.catalina.Valve valve)
super.removeValve(valve);
if (valve instanceof SingleSignOn) {
sso = null;
}
|
public void | setAppBase(java.lang.String appBase)Set the application root for this Host. This can be an absolute
pathname, a relative pathname, or a URL.
String oldAppBase = this.appBase;
this.appBase = appBase;
support.firePropertyChange("appBase", oldAppBase, this.appBase);
|
public void | setAutoDeploy(boolean autoDeploy)Set the auto deploy flag value for this host.
boolean oldAutoDeploy = this.autoDeploy;
this.autoDeploy = autoDeploy;
support.firePropertyChange("autoDeploy", oldAutoDeploy,
this.autoDeploy);
|
public void | setConfigClass(java.lang.String configClass)Set the Java class name of the context configuration class
for new web applications.
String oldConfigClass = this.configClass;
this.configClass = configClass;
support.firePropertyChange("configClass",
oldConfigClass, this.configClass);
|
public void | setContextClass(java.lang.String contextClass)Set the Java class name of the Context implementation class
for new web applications.
String oldContextClass = this.contextClass;
this.contextClass = contextClass;
support.firePropertyChange("contextClass",
oldContextClass, this.contextClass);
|
public void | setDeployOnStartup(boolean deployOnStartup)Set the deploy on startup flag value for this host.
boolean oldDeployOnStartup = this.deployOnStartup;
this.deployOnStartup = deployOnStartup;
support.firePropertyChange("deployOnStartup", oldDeployOnStartup,
this.deployOnStartup);
|
public void | setDeployXML(boolean deployXML)Deploy XML Context config files flag mutator.
this.deployXML = deployXML;
|
public void | setDeployer(org.apache.catalina.Deployer d)
this.deployer=d;
|
public void | setErrorReportValveClass(java.lang.String errorReportValveClass)Set the Java class name of the error report valve class
for new web applications.
String oldErrorReportValveClassClass = this.errorReportValveClass;
this.errorReportValveClass = errorReportValveClass;
support.firePropertyChange("errorReportValveClass",
oldErrorReportValveClassClass,
this.errorReportValveClass);
|
public void | setLiveDeploy(boolean liveDeploy)Set the live deploy flag value for this host.
setAutoDeploy(liveDeploy);
|
public void | setName(java.lang.String name)Set the canonical, fully qualified, name of the virtual host
this Container represents.
if (name == null)
throw new IllegalArgumentException
(sm.getString("standardHost.nullName"));
// START OF PE 4989789
// name = name.toLowerCase(); // Internally all names are lower case
// END OF PE 4989789
String oldName = this.name;
this.name = name;
support.firePropertyChange("name", oldName, this.name);
|
public void | setPipeline(org.apache.catalina.Pipeline pl)
// ------------------------------------------------------------- Properties
// START SJSAS 6331392
pl.setBasic(new StandardHostValve());
pipeline = pl;
|
public void | setPorts(int[] ports)Associates this StandardHost with the given port numbers.
int[] oldPorts = this.ports;
this.ports = (int[])ports.clone();
support.firePropertyChange("ports", oldPorts, this.ports);
|
public void | setSecurePagesWithPragma(boolean securePagesWithPragma)Sets the securePagesWithPragma property of this Context.
Setting this property to true will result in Pragma and Cache-Control
headers with a value of "No-cache" if proxy caching has been disabled.
Setting this property to false will not add any Pragma header,
but will set the Cache-Control header to "private".
boolean oldSecurePagesWithPragma = this.securePagesWithPragma;
this.securePagesWithPragma = securePagesWithPragma;
support.firePropertyChange("securePagesWithPragma",
Boolean.valueOf(oldSecurePagesWithPragma),
Boolean.valueOf(this.securePagesWithPragma));
|
public void | setUnpackWARs(boolean unpackWARs)Unpack WARs flag mutator.
this.unpackWARs = unpackWARs;
|
public void | setWorkDir(java.lang.String workDir)Host work directory base.
this.workDir = workDir;
|
public void | setXmlNamespaceAware(boolean xmlNamespaceAware)Set the namespace aware feature of the XML parser used when
parsing xml instances.
this.xmlNamespaceAware=xmlNamespaceAware;
|
public void | setXmlValidation(boolean xmlValidation)Set the validation feature of the XML parser used when
parsing xml instances.
this.xmlValidation = xmlValidation;
|
public synchronized void | start()Start this host.
if( started ) {
return;
}
if( ! initialized )
init();
// Look for a realm - that may have been configured earlier.
// If the realm is added after context - it'll set itself.
if( realm == null ) {
ObjectName realmName=null;
try {
realmName=new ObjectName( domain + ":type=Host,host=" + getName());
if( mserver.isRegistered(realmName ) ) {
mserver.invoke(realmName, "setContext",
new Object[] {this},
new String[] { "org.apache.catalina.Container" }
);
}
} catch( Throwable t ) {
if (log.isDebugEnabled()) {
log.debug("No realm for this host " + realmName);
}
}
}
// Set error report valve
if ((errorReportValveClass != null)
&& (!errorReportValveClass.equals(""))) {
try {
Valve valve = (Valve) Class.forName(errorReportValveClass)
.newInstance();
/* START SJSAS 6374691
addValve(valve);
*/
// START SJSAS 6374691
((StandardHostValve) pipeline.getBasic()).setErrorReportValve(valve);
// END SJSAS 6374691
} catch (Throwable t) {
log.error(sm.getString
("standardHost.invalidErrorReportValveClass",
errorReportValveClass));
}
}
// START SJSAS_PE 8.1 5034793
if (log.isDebugEnabled()) {
if (xmlValidation) {
log.debug( sm.getString("standardHost.validationEnabled"));
} else {
log.debug( sm.getString("standardHost.validationDisabled"));
}
}
// END SJSAS_PE 8.1 5034793
super.start();
|
public void | start(java.lang.String contextPath)Start an existing web application, attached to the specified context
path. Only starts a web application if it is not running.
getDeployer().start(contextPath);
|
public void | stop(java.lang.String contextPath)Stop an existing web application, attached to the specified context
path. Only stops a web application if it is running.
getDeployer().stop(contextPath);
|
public java.lang.String | toString()Return a String representation of this component.
StringBuffer sb = new StringBuffer();
if (getParent() != null) {
sb.append(getParent().toString());
sb.append(".");
}
sb.append("StandardHost[");
sb.append(getName());
sb.append("]");
return (sb.toString());
|