|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
jrunx.kernel.ServiceAdapter
|
+--jrunx.kernel.ServicePartition
|
+--jrunx.kernel.ConfigurableServicePartition
|
+--jrun.j2ee.J2EEModule
|
+--jrun.servlet.WebApplicationService
A Web Application. This class serves as the container for a web application.
| Field Summary | |
protected WebAppSecurity |
appSecurity
|
protected ResourceManager |
resourceManager
|
protected ServletEngine |
servletEngine
|
protected Session |
sessionService
|
| Fields inherited from class jrunx.kernel.ServicePartition |
sortedServices |
| Fields inherited from class jrunx.kernel.ServiceAdapter |
DEFAULT_DEACTIVATED, DEFAULT_DOMAIN, DOMAIN_NAME_SEPARATOR, DOMAIN_NAME_SUFFIX, domainName, jndiBindable, LOGGER_CACHE_TIME, SCHEDULER_SERVICE, SECURITY_MANAGER, server, status, TRANSACTION_MANAGER |
| Fields inherited from interface jrunx.kernel.Service |
INITIALIZED, STARTED, STARTING, STOPPED, STOPPING, UNINITIALIZED |
| Constructor Summary | |
WebApplicationService(WebAppMetaData webAppMetaData)
|
|
| Method Summary | |
void |
addListener(java.lang.Object o)
Add an event listener to the the web app. |
void |
addListener(java.lang.String listenerName)
Add an event listener to the the web app. |
protected void |
addWebXmlServletMappings()
|
protected void |
createClassLoader()
|
void |
destroy()
Every service is eventually destroyed. |
protected void |
destroyListeners()
Destroys any event listeners defined in web.xml in reverse order |
boolean |
equals(java.lang.Object obj)
|
java.lang.Boolean |
getCompile()
Gets whether dynamic compile is enabled |
java.lang.String |
getContextPath()
|
java.lang.String |
getDescription()
Gets the web application description |
java.lang.Boolean |
getDirectoryBrowsing()
Gets whether directory browsing is enabled. |
JRunRequestDispatcher |
getDispatcher(java.lang.String uri,
java.lang.String queryString)
return a JRunRequestDispatcher for this request. |
java.lang.String |
getDisplayName()
Get the web application display name |
java.lang.String |
getDocumentRoot()
Returns the current document root. |
java.lang.Boolean |
getFileServing()
Gets whether file server is enabled for this web application |
FilterManager |
getFilterManager()
Returns the current filter manager or null if there are no filters configured. |
java.util.Vector |
getHttpSessionAttributeListeners()
Returns the list of HttpSessionAttributeListener objects or null if none |
java.util.Vector |
getHttpSessionListeners()
Returns the list of HttpSessionListener objects or null if none |
java.lang.String |
getMimeType(java.lang.String name)
Gets the mime type for the given resource name |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String servletName)
this is the implementation for ServletContext.getNamedDispatcher. |
java.lang.Boolean |
getReload()
Gets whether dynamic reload is enabled |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
this method is the implementation for ServletContext.getRequestDispatcher(String) and returns a (potentially cached) dispatcher for the given resource. |
Resource |
getResource(java.lang.String path)
Gets a Resource at the specified relative path within the document root |
java.io.InputStream |
getResourceAsStream(java.lang.String path)
Gets an InputStream for reading the relative path within the document root |
ServletEngine |
getServer()
Gets the JRun server instance |
java.lang.String |
getServletAlias(java.lang.String name)
Given a servlet name, return the servlet-class or (if a jsp-file) the name of the jsp servlet. |
java.lang.String |
getServletAliasClass(java.lang.String name)
Given a servlet alias name, return the servlet class. |
long |
getServletCheckInterval()
Gets the servlet check interval |
javax.servlet.ServletContext |
getServletContext()
Gets the servlet context for this web application |
java.util.Vector |
getServletContextAttributeListeners()
Returns the list of ServletContextAttributeListener objects or null if none |
java.util.Vector |
getServletContextListeners()
Returns the list of ServletContextListener objects or null if none |
JRunRequestDispatcher |
getServletDispatcher(java.lang.String uri,
java.lang.Class servletClass)
get a request dispatcher for an internal servlet, by class. |
ServletEngine |
getServletEngine()
Returns a direct reference to the servlet engine that this webapp belongs to. |
java.util.Set |
getServletMappings()
Returns the current set of servlet mappings, sorted longest first |
java.lang.Boolean |
getSessionPersistence()
|
java.lang.Boolean |
getSessionReplication()
|
java.util.List |
getSessionReplicationBuddies()
|
Session |
getSessionService()
Returns the current Session service |
java.lang.String |
getUriCharacterEncoding()
|
protected java.net.URL |
getURL(Resource r)
|
java.lang.ClassLoader |
getWebappClassLoader()
|
WebApplication |
getWebApplication()
Returns a direct reference to the web application |
WebAppMetaData |
getWebAppMetaData()
Gets the metadata as read from web.xml |
java.lang.String |
getWebAppName()
Gets the web application name |
java.lang.String |
getWebAppRoot()
Gets the root location of the web application |
java.lang.String |
getWholeContextPath()
|
void |
init()
Not every service needs to init, implement it out of convenience. |
protected void |
initListeners()
Loads any event listeners defined in web.xml. |
protected boolean |
isServlet(java.lang.String name)
Determines if the given servlet mapping represents a servlet |
java.lang.Class |
loadClass(java.lang.String name)
Loads the named class using the ClassLoader for the WebApplication |
javax.servlet.Servlet |
loadServlet(java.lang.String servletName,
java.lang.String className)
Loads the servlet using the ClassLoader for the WebApplication |
protected boolean |
pathIsLegal(java.lang.String decodedUri)
|
void |
persistJRunWebXML()
|
void |
persistWebXML()
|
void |
postStart()
For j2ee modules within an ear that depend on all other modules being started |
protected void |
preloadServlets()
initialize the application's servlets, loading them in pre-load order. |
void |
setCompile(java.lang.Boolean compile)
Set the dynamic compile meta data element. |
void |
setContextPath(java.lang.String path)
Sets the context path of the web application. |
void |
setDirectoryBrowsing(java.lang.Boolean directoryBrowsing)
Set directory browsing fo this web application |
void |
setDisplayName(java.lang.String displayName)
|
void |
setDocumentRoot(java.lang.String documentRoot)
Sets the current document root. |
void |
setFileServing(java.lang.Boolean enable)
Set whether file server is enabled for this web application |
void |
setReload(java.lang.Boolean reload)
Set the dynamic reload meta data element. |
void |
setServletCheckInterval(long ms)
The number of milliseconds between checking for a change in a servlet class file. |
void |
setServletMapping(ServletMapping mapping)
Sets (adds) a new ServletMapping for this web applications. |
void |
setSessionPersistence(java.lang.Boolean persistence)
|
void |
setSessionReplication(java.lang.Boolean replicate)
|
void |
setSessionReplicationBuddies(java.util.List l)
|
void |
setWebAppName(java.lang.String webAppName)
Sets the web application name |
void |
setWebAppRoot(java.lang.String root)
Sets the root location of the web application. |
void |
setWholeContextPath(java.lang.String str)
|
void |
start()
Every service other than mere data collections should start |
void |
stop()
Every service other than mere data collections should stop |
| Methods inherited from class jrun.j2ee.J2EEModule |
getClassLoader, getDeploymentOrigin, getEJBPeers, getJ2EEMetaData, isRunning, resolveEJBLinks, setClassLoader, setDeploymentOrigin, setEJBPeers, setJ2EEMetaData, setName, setRunning |
| Methods inherited from class jrunx.kernel.ConfigurableServicePartition |
destroyServices, initServices, loadAndInit, loadChildren, setChildElements, startServices, stopServices |
| Methods inherited from class jrunx.kernel.ServicePartition |
addService, addService, getServices, invokeChain, iterator, removeService, removeService |
| Methods inherited from interface jrun.servlet.WebApplication |
getLogger |
| Methods inherited from interface jrunx.kernel.ConfigurableServicePartitionMBean |
setChildElements |
| Methods inherited from interface jrunx.kernel.ServicePartitionMBean |
addService, addService, iterator, removeService, removeService |
| Methods inherited from interface jrunx.kernel.ServiceMBean |
bind, getBindToJNDI, getDeactivated, getDomainName, getJRunService, getName, getParentService, getServerName, requestServer, setBindToJNDI, setDeactivated, setDomainName, setName, setParentService, unbind |
| Methods inherited from interface jrunx.kernel.Service |
getStatus, updateStatus |
| Methods inherited from interface jrun.j2ee.J2EEModuleMBean |
getDeploymentOrigin, isRunning, setDeploymentOrigin |
| Field Detail |
protected ResourceManager resourceManager
protected ServletEngine servletEngine
protected Session sessionService
protected WebAppSecurity appSecurity
| Constructor Detail |
public WebApplicationService(WebAppMetaData webAppMetaData)
| Method Detail |
public void init()
throws java.lang.Exception
ServiceAdapterinit in interface Serviceinit in class ConfigurableServicePartition
public void start()
throws java.lang.Exception
ServiceAdapterstart in interface Servicestart in class ConfigurableServicePartition
public void postStart()
throws java.lang.Exception
J2EEModulepostStart in class J2EEModule
public void stop()
throws java.lang.Exception
ServiceAdapterstop in interface Servicestop in class ConfigurableServicePartition
public void destroy()
throws java.lang.Exception
ServiceAdapterdestroy in interface Servicedestroy in class ConfigurableServicePartitionpublic java.lang.String getDescription()
WebApplicationServiceMBeangetDescription in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic void setDisplayName(java.lang.String displayName)
public java.lang.String getDisplayName()
WebApplicationServiceMBeangetDisplayName in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic void setServletCheckInterval(long ms)
WebApplicationServiceMBeansetServletCheckInterval in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeaninterval - Number of ms before checking for a new servlet classpublic long getServletCheckInterval()
WebApplicationServiceMBeangetServletCheckInterval in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic void setWebAppName(java.lang.String webAppName)
WebApplicationServiceMBeansetWebAppName in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanname - The webapp namepublic java.lang.String getWebAppName()
WebApplicationServiceMBeangetWebAppName in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic void setContextPath(java.lang.String path)
WebApplicationServiceMBeansetContextPath in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpath - The context pathpublic java.lang.String getWholeContextPath()
getWholeContextPath in interface WebApplicationServiceMBeanpublic void setWholeContextPath(java.lang.String str)
setWholeContextPath in interface WebApplicationServiceMBeanpublic java.lang.String getContextPath()
public void setWebAppRoot(java.lang.String root)
WebApplicationServiceMBeansetWebAppRoot in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanroot - The root locationpublic java.lang.String getWebAppRoot()
WebApplicationServiceMBeangetWebAppRoot in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic ServletEngine getServer()
WebApplicationgetServer in interface WebApplicationjrun.servlet.WebApplicationpublic java.lang.String getUriCharacterEncoding()
public java.lang.Boolean getReload()
getReload in interface WebApplicationServiceMBeanpublic void setReload(java.lang.Boolean reload)
setReload in interface WebApplicationServiceMBeanenable - Enables/disables dynamic reload
public void persistWebXML()
throws java.rmi.RemoteException
persistWebXML in interface WebApplicationServiceMBean
public void persistJRunWebXML()
throws java.rmi.RemoteException
persistJRunWebXML in interface WebApplicationServiceMBeanpublic java.lang.Boolean getCompile()
getCompile in interface WebApplicationServiceMBeanpublic void setCompile(java.lang.Boolean compile)
setCompile in interface WebApplicationServiceMBeanenable - Enables/disables dynamic reloadpublic java.lang.Boolean getSessionPersistence()
getSessionPersistence in interface WebApplicationServiceMBeanpublic void setSessionPersistence(java.lang.Boolean persistence)
setSessionPersistence in interface WebApplicationServiceMBeanpublic java.lang.Boolean getSessionReplication()
getSessionReplication in interface WebApplicationServiceMBeanpublic void setSessionReplication(java.lang.Boolean replicate)
setSessionReplication in interface WebApplicationServiceMBeanpublic java.util.List getSessionReplicationBuddies()
getSessionReplicationBuddies in interface WebApplicationServiceMBeanpublic void setSessionReplicationBuddies(java.util.List l)
setSessionReplicationBuddies in interface WebApplicationServiceMBeanpublic java.lang.String getDocumentRoot()
getDocumentRoot in interface WebApplicationServiceMBeanpublic void setDocumentRoot(java.lang.String documentRoot)
setDocumentRoot in interface WebApplicationServiceMBeandocumentRoot - The document root for the web applicationpublic void setDirectoryBrowsing(java.lang.Boolean directoryBrowsing)
setDirectoryBrowsing in interface WebApplicationServiceMBeanenable - Enables/disables directory browsing.public java.lang.Boolean getDirectoryBrowsing()
getDirectoryBrowsing in interface WebApplicationServiceMBeanpublic void setFileServing(java.lang.Boolean enable)
setFileServing in interface WebApplicationServiceMBeanenable - Whether file serving is enabledpublic java.lang.Boolean getFileServing()
getFileServing in interface WebApplicationServiceMBean
protected void preloadServlets()
throws javax.servlet.ServletException
protected void addWebXmlServletMappings()
public JRunRequestDispatcher getDispatcher(java.lang.String uri,
java.lang.String queryString)
getDispatcher in interface WebApplicationjava.io.IOException - or ServletException, usually from loading a servlet.protected boolean pathIsLegal(java.lang.String decodedUri)
public java.lang.String getServletAlias(java.lang.String name)
name - The servlet nameprotected boolean isServlet(java.lang.String name)
public WebApplication getWebApplication()
WebApplicationServiceMBeangetWebApplication in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic ServletEngine getServletEngine()
WebApplicationServiceMBeangetServletEngine in interface WebApplicationServiceMBeanpublic java.lang.String getMimeType(java.lang.String name)
WebApplicationgetMimeType in interface WebApplicationjrun.servlet.WebApplicationname - The resource namepublic void setServletMapping(ServletMapping mapping)
WebApplicationServiceMBeansetServletMapping in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanmapping - The new mapping to addpublic java.util.Set getServletMappings()
WebApplicationgetServletMappings in interface WebApplicationjrun.servlet.WebApplicationpublic java.lang.String getServletAliasClass(java.lang.String name)
WebApplicationgetServletAliasClass in interface WebApplicationjrun.servlet.WebApplicationname - The servlet alias namepublic Resource getResource(java.lang.String path)
WebApplicationgetResource in interface WebApplicationjrun.servlet.WebApplicationpath - The relative path
public java.io.InputStream getResourceAsStream(java.lang.String path)
throws java.io.IOException
WebApplicationgetResourceAsStream in interface WebApplicationjrun.servlet.WebApplicationpath - The relative pathpublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
getRequestDispatcher in interface WebApplicationjrun.servlet.WebApplicationpath - The resource pathpublic javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String servletName)
getNamedDispatcher in interface WebApplication
public JRunRequestDispatcher getServletDispatcher(java.lang.String uri,
java.lang.Class servletClass)
public java.lang.Class loadClass(java.lang.String name)
WebApplicationloadClass in interface WebApplicationjrun.servlet.WebApplicationclassName - The class namepublic Session getSessionService()
WebApplicationgetSessionService in interface WebApplicationjrun.servlet.WebApplication
public javax.servlet.Servlet loadServlet(java.lang.String servletName,
java.lang.String className)
throws java.io.IOException,
javax.servlet.ServletException
WebApplicationloadServlet in interface WebApplicationjrun.servlet.WebApplicationservletName - The servlet name. This may be an alias name.protected void createClassLoader()
public java.lang.ClassLoader getWebappClassLoader()
getWebappClassLoader in interface WebApplicationprotected java.net.URL getURL(Resource r)
public javax.servlet.ServletContext getServletContext()
WebApplicationgetServletContext in interface WebApplicationjrun.servlet.WebApplication
protected void initListeners()
throws javax.servlet.ServletException
public void addListener(java.lang.String listenerName)
WebApplicationaddListener in interface WebApplicationpublic void addListener(java.lang.Object o)
WebApplicationaddListener in interface WebApplication
protected void destroyListeners()
throws javax.servlet.ServletException
public java.util.Vector getServletContextListeners()
WebApplicationgetServletContextListeners in interface WebApplicationpublic java.util.Vector getServletContextAttributeListeners()
WebApplicationgetServletContextAttributeListeners in interface WebApplicationpublic java.util.Vector getHttpSessionListeners()
WebApplicationgetHttpSessionListeners in interface WebApplicationpublic java.util.Vector getHttpSessionAttributeListeners()
WebApplicationgetHttpSessionAttributeListeners in interface WebApplicationpublic FilterManager getFilterManager()
WebApplicationgetFilterManager in interface WebApplicationpublic WebAppMetaData getWebAppMetaData()
WebApplicationServiceMBeangetWebAppMetaData in interface WebApplicationServiceMBeanjrun.servlet.WebApplicationServiceMBeanpublic boolean equals(java.lang.Object obj)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||