atg.service.webappregistry
Class WebAppRegistry

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.webappregistry.WebAppRegistry
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener
Direct Known Subclasses:
FileSystemWebAppRegistry, MergedWebAppRegistry, ServletContextWebAppRegistry, StaticWebAppRegistry

public abstract class WebAppRegistry
extends GenericService

WebAppRegistry is an abstract class that implements the basic properties and methods for a registry that contains deployed web applications. Discovery of the web applications is left to the particular implementation of this class.


Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
WebAppRegistry()
           
 
Method Summary
static void addListener(WebAppListener pListener)
          addListener
protected  javax.servlet.Servlet createAdminServlet()
          Creates and returns a new Servlet that will administer this service.
 void doStartService()
          Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values.
 void doStopService()
          doStopService
static java.lang.String[] getHiddenWebApps()
          Get the value of HiddenWebApps.
 java.lang.String getSiteHttpServerName()
          Returns the name of the server configured to serve HTTP requests.
 int getSiteHttpServerPort()
           
 java.lang.String getUrl(java.lang.String pAppName)
           
 java.lang.String getUrl(WebApp pWebApp)
           
 WebApp getWebAppByContextRoot(java.lang.String pContextRoot)
           
 WebApp getWebAppByName(java.lang.String pName)
           
 WebApp getWebAppByProperty(java.lang.String pPropName, java.lang.String pPropValue)
           
abstract  java.util.Map getWebApps()
          Get the Map of currently deployed web applications
static boolean isHiddenWebApp(java.lang.String pName)
           
 void register(java.lang.Object pObj)
          registerWebApp
static void removeListener(WebAppListener pListener)
          removeListener
 boolean removeWebApp(java.lang.String pName)
           
 void savePropertyFilesToDir(java.lang.String pPath)
           
static void sendEvent(WebAppRegistry pRegistry, WebApp pWebApp)
          Send an event to pRegistry's listeners about pWebApp.
static void setHiddenWebApps(java.lang.String[] v)
          Set the value of HiddenWebApps.
 void setSiteHttpServerName(java.lang.String pSiteHttpServerName)
          Sets the name of the server configured to serve HTTP requests.
 void setSiteHttpServerPort(int pSiteHttpServerPort)
           
 java.lang.String toString()
           
 void unregister(java.lang.Object pObj)
           
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Constructor Detail

WebAppRegistry

public WebAppRegistry()
Method Detail

getSiteHttpServerName

public java.lang.String getSiteHttpServerName()
Returns the name of the server configured to serve HTTP requests. This is used for loopback requests when running in another app server.


setSiteHttpServerName

public void setSiteHttpServerName(java.lang.String pSiteHttpServerName)
Sets the name of the server configured to serve HTTP requests. This is used for loopback requests when running in another app server.


setSiteHttpServerPort

public void setSiteHttpServerPort(int pSiteHttpServerPort)

getSiteHttpServerPort

public int getSiteHttpServerPort()

getHiddenWebApps

public static java.lang.String[] getHiddenWebApps()
Get the value of HiddenWebApps.

Returns:
value of HiddenWebApps.

setHiddenWebApps

public static void setHiddenWebApps(java.lang.String[] v)
Set the value of HiddenWebApps.

Parameters:
v - Value to assign to HiddenWebApps.

isHiddenWebApp

public static boolean isHiddenWebApp(java.lang.String pName)

getWebApps

public abstract java.util.Map getWebApps()
Get the Map of currently deployed web applications

Returns:
a Map of deployed WebApps

register

public void register(java.lang.Object pObj)
registerWebApp

Parameters:
pObj - a Object of WebApps

unregister

public void unregister(java.lang.Object pObj)

removeWebApp

public boolean removeWebApp(java.lang.String pName)

getWebAppByName

public WebApp getWebAppByName(java.lang.String pName)

getWebAppByContextRoot

public WebApp getWebAppByContextRoot(java.lang.String pContextRoot)

getWebAppByProperty

public WebApp getWebAppByProperty(java.lang.String pPropName,
                                  java.lang.String pPropValue)

doStartService

public void doStartService()
                    throws ServiceException
Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values. Makes sure all the required properties have been set in the .properties file.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the service had a problem starting up

doStopService

public void doStopService()
                   throws ServiceException
doStopService

Overrides:
doStopService in class GenericService
Throws:
ServiceException - if an error occurs

createAdminServlet

protected javax.servlet.Servlet createAdminServlet()
Creates and returns a new Servlet that will administer this service.

Overrides:
createAdminServlet in class GenericService
Returns:
a Servlet value

addListener

public static void addListener(WebAppListener pListener)
addListener

Parameters:
pListener - a WebAppListener value

removeListener

public static void removeListener(WebAppListener pListener)
removeListener

Parameters:
pListener - a WebAppListener value

sendEvent

public static void sendEvent(WebAppRegistry pRegistry,
                             WebApp pWebApp)
Send an event to pRegistry's listeners about pWebApp.

Parameters:
pRegistry - the WebAppRegistry whose listeners should be notified of an event.
pWebApp - the web-application to send an event concerning

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

savePropertyFilesToDir

public void savePropertyFilesToDir(java.lang.String pPath)

getUrl

public java.lang.String getUrl(java.lang.String pAppName)

getUrl

public java.lang.String getUrl(WebApp pWebApp)