|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.GenericContext
public class GenericContext
A GenericContext is a subclass of GenericService that also implements NameContext and NameContextBindingEventSource. This allows it to contain other services.
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
| 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 | |
|---|---|
GenericContext()
Constructs a new GenericContext |
|
| Method Summary | |
|---|---|
void |
addNameContextBindingListener(NameContextBindingListener pListener)
Adds the specified listener to the list of listeners that will be notified whenever an element is bound into or unbound from this NameContext. |
void |
addNameContextPreBindingListener(atg.naming.NameContextPreBindingListener pListener)
Adds the specified listener to the list of listeners that will be notified whenever an element is bound into or unbound from this NameContext. |
void |
clearElementLock(ComponentName pName)
Clears the lock for the given component when it's no longer required. |
void |
doStopService()
This is called when a Service is required to shut down. |
java.lang.Object |
getAttribute(java.lang.String pName)
Returns an the value of an attribute in the ServletContext. |
java.util.Enumeration |
getAttributeNames()
Returns an Enumeration containing the
attribute names available
within this servlet context. |
atg.nucleus.ConfigurationLock |
getConfigurationLock()
Get a ConfigurationLock for this NameContext. |
javax.servlet.ServletContext |
getContext(java.lang.String uripath)
Returns a ServletContext object that
corresponds to a specified URL on the server. |
java.lang.String |
getContextPath()
Gets the context path. |
java.io.File |
getDocumentRoot()
Returns the document root |
java.lang.Object |
getElement(java.lang.String pName)
Returns the element bound to the specified name. |
atg.nucleus.ConfigurationLock |
getElementLock(ComponentName pName)
Get a ConfigurationLock for the given element name in this NameContext. |
java.lang.String |
getInitParameter(java.lang.String pName)
GenericContext does not have any mechanism for specifying init params. |
java.util.Enumeration |
getInitParameterNames()
GenericContext does not have any mechanism for specifying init params. |
int |
getMajorVersion()
Returns the major version of the Java Servlet API that this Web server supports. |
java.lang.String |
getMimeType(java.lang.String pFile)
Returns the mime type of the specified file or null if the mime type is not recognized. |
MimeTyper |
getMimeTyper()
Returns the mime type mapping object. |
int |
getMinorVersion()
Returns the minor version of the Servlet API that this Web server supports. |
NameContextBindingListener[] |
getNameContextBindingListeners()
Returns the list of NameContextBindingListeners |
atg.naming.NameContextPreBindingListener[] |
getNameContextPreBindingListeners()
Returns the list of NameContextBindingListeners |
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String pName)
GenericContext does not have any mechanism for specifying named servlets in the Servlet 2.2 sense. |
java.lang.Object |
getPendingElement(ComponentName pName)
Get a pending element for this registry. |
java.lang.String |
getRealPath(java.lang.String pPath)
Returns the file system path for the PathInfo specified. |
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String pUrlPath)
Returns a RequestDispatcher object that acts
as a wrapper for the resource located at the named path. |
java.net.URL |
getResource(java.lang.String pPath)
Returns the resource that is mapped to a specified path. |
java.io.InputStream |
getResourceAsStream(java.lang.String pPath)
Returns the resource located at the named path as an InputStream object. |
java.util.Set |
getResourcePaths(java.lang.String pPath)
SERVLET_2_3_UNIMPLEMENTED Stub for a new method in Servlet 2.3 spec. |
java.lang.String |
getServerInfo()
Returns the string identifying the server. |
javax.servlet.Servlet |
getServlet(java.lang.String pName)
Returns a servlet with the specified name. |
java.lang.String |
getServletContextName()
SERVLET_2_3_UNIMPLEMENTED Stub for a new method in Servlet 2.3 spec. |
java.util.Enumeration |
getServletNames()
Returns the list of servlet names as an Enumeration. |
java.util.Enumeration |
getServlets()
Returns the servlets defined in this context |
boolean |
isElementBound(java.lang.String pName)
Returns true if the name has an element bound to it, false if not. |
java.lang.Object |
listElement(java.lang.String pName)
Returns the element bound to the specified name. |
java.util.Enumeration |
listElementNames()
Returns the list of element names as an Enumeration |
java.util.Enumeration |
listElements()
Returns the list of bound elements as an Enumeration |
void |
log(java.lang.Exception e,
java.lang.String pMessage)
Writes the stacktrace and the given log message to the "informational" messages for this servlet. |
void |
log(java.lang.String pMessage)
Logs this message using regular nucleus logging facilities for this context |
void |
log(java.lang.String pMessage,
java.lang.Throwable pThrowable)
Logs this message using regular nucleus logging facilities for this context |
void |
notifyAddedObject(java.lang.String pName,
java.lang.Object pElement)
Notifies pElement that it has just been added to this
name context with the name pName. |
void |
notifyRemovedObject(java.lang.String pName,
java.lang.Object pElement)
Notifies pElement that it has been removed from
this name context. |
void |
preNotifyAddedObject(java.lang.String pName,
java.lang.Object pElement)
Notifies pElement that it is about to be added to
this name context. |
void |
preNotifyRemovedObject(java.lang.String pName,
java.lang.Object pElement)
Notifies pElement that it is about to be removed from
this name context. |
void |
putElement(java.lang.String pName,
java.lang.Object pElement)
Binds the specified element to the specified name. |
void |
putPendingElement(ComponentName pName,
java.lang.Object pElement)
Put a pending element in this registry. |
void |
removeAttribute(java.lang.String pName)
Removes the attribute with the given name from the servlet context. |
void |
removeElement(java.lang.String pName)
Removes the binding for the specified name. |
void |
removeNameContextBindingListener(NameContextBindingListener pListener)
Removes the specified listener from the list of listeners that will be notified whenever an element is bound into or unbound from this NameContext. |
void |
removeNameContextPreBindingListener(atg.naming.NameContextPreBindingListener pListener)
Removes the specified listener from the list of listeners that will be notified whenever an element is bound into or unbound from this NameContext. |
void |
removePendingElement(ComponentName pName)
Removes the pending element for the specified name. |
void |
setAttribute(java.lang.String pName,
java.lang.Object pObject)
Gives an attribute a name in this servlet context. |
void |
setDocumentRoot(java.io.File pDocumentRoot)
Sets the document root |
void |
setMimeTyper(MimeTyper pMimeTyper)
Sets the mime type mapping object |
void |
startService(ServiceEvent pEvent)
Overrides the implementation in GenericService. |
| Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
|---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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, toString, wait, wait, wait |
| Methods inherited from interface atg.naming.NameContextElement |
|---|
getName, getNameContext |
| Methods inherited from interface atg.naming.NameContextBindingListener |
|---|
nameContextElementBound, nameContextElementUnbound |
| Field Detail |
|---|
public static final java.lang.String CLASS_VERSION
| Constructor Detail |
|---|
public GenericContext()
| Method Detail |
|---|
public void addNameContextPreBindingListener(atg.naming.NameContextPreBindingListener pListener)
addNameContextPreBindingListener in interface atg.naming.NameContextPreBindingEventSourcepublic void removeNameContextPreBindingListener(atg.naming.NameContextPreBindingListener pListener)
removeNameContextPreBindingListener in interface atg.naming.NameContextPreBindingEventSourcepublic atg.naming.NameContextPreBindingListener[] getNameContextPreBindingListeners()
public void addNameContextBindingListener(NameContextBindingListener pListener)
addNameContextBindingListener in interface NameContextBindingEventSourcepublic void removeNameContextBindingListener(NameContextBindingListener pListener)
removeNameContextBindingListener in interface NameContextBindingEventSourcepublic NameContextBindingListener[] getNameContextBindingListeners()
public void doStopService()
throws ServiceException
doStopService in class GenericServiceServiceException - if the Service had a problem shutting downpublic java.lang.Object getElement(java.lang.String pName)
getElement in interface NameContext
public void putElement(java.lang.String pName,
java.lang.Object pElement)
putElement in interface NameContext
public void notifyAddedObject(java.lang.String pName,
java.lang.Object pElement)
pElement that it has just been added to this
name context with the name pName.
pName - pElement -
public void notifyRemovedObject(java.lang.String pName,
java.lang.Object pElement)
pElement that it has been removed from
this name context.
- Parameters:
pName - The name the removed object was bound topElement - The object being removed
public void preNotifyRemovedObject(java.lang.String pName,
java.lang.Object pElement)
pElement that it is about to be removed from
this name context.
- Parameters:
pName - The name the removed object was bound topElement - The object being removed
public void preNotifyAddedObject(java.lang.String pName,
java.lang.Object pElement)
pElement that it is about to be added to
this name context.
- Parameters:
pName - The name the removed object was bound topElement - The object being removed
public void removeElement(java.lang.String pName)
removeElement in interface NameContextpublic boolean isElementBound(java.lang.String pName)
isElementBound in interface NameContextpublic java.util.Enumeration listElementNames()
listElementNames in interface NameContextpublic java.util.Enumeration listElements()
listElements in interface NameContextpublic java.lang.Object listElement(java.lang.String pName)
public void startService(ServiceEvent pEvent)
throws ServiceException
startService in interface ServiceListenerstartService in class GenericServicepEvent - the ServiceEvent encapsulating information about
the Service's environment and configuration
NamingException - if there was a problem resolving a name
ServiceException - if an error occurred while attempting
to start the service.public javax.servlet.Servlet getServlet(java.lang.String pName)
getServlet in interface javax.servlet.ServletContextpublic java.lang.String getServletContextName()
getServletContextName in interface javax.servlet.ServletContextpublic java.lang.String getContextPath()
getContextPath in interface javax.servlet.ServletContextpublic java.util.Enumeration getServletNames()
getServletNames in interface javax.servlet.ServletContextpublic java.util.Enumeration getServlets()
getServlets in interface javax.servlet.ServletContextpublic void log(java.lang.String pMessage)
log in interface javax.servlet.ServletContext
public void log(java.lang.Exception e,
java.lang.String pMessage)
log in interface javax.servlet.ServletContextpublic java.lang.String getRealPath(java.lang.String pPath)
getRealPath in interface javax.servlet.ServletContextpublic java.lang.String getMimeType(java.lang.String pFile)
getMimeType in interface javax.servlet.ServletContextpublic java.lang.String getServerInfo()
getServerInfo in interface javax.servlet.ServletContextpublic java.lang.Object getAttribute(java.lang.String pName)
getAttribute in interface javax.servlet.ServletContextpublic java.io.File getDocumentRoot()
public void setDocumentRoot(java.io.File pDocumentRoot)
public MimeTyper getMimeTyper()
public void setMimeTyper(MimeTyper pMimeTyper)
public java.lang.Object getPendingElement(ComponentName pName)
getPendingElement in interface atg.nucleus.ConfigurationLockRegistry
public void putPendingElement(ComponentName pName,
java.lang.Object pElement)
putPendingElement in interface atg.nucleus.ConfigurationLockRegistrypublic void removePendingElement(ComponentName pName)
removePendingElement in interface atg.nucleus.ConfigurationLockRegistrypublic atg.nucleus.ConfigurationLock getConfigurationLock()
getConfigurationLock in interface atg.nucleus.ConfigurationLockRegistrypublic atg.nucleus.ConfigurationLock getElementLock(ComponentName pName)
getElementLock in interface atg.nucleus.ConfigurationLockRegistrypublic void clearElementLock(ComponentName pName)
clearElementLock in interface atg.nucleus.ConfigurationLockRegistryConfigurationLockRegistry.clearElementLock(ComponentName)public javax.servlet.ServletContext getContext(java.lang.String uripath)
ServletContext object that
corresponds to a specified URL on the server.
This method allows servlets to gain
access to the resources located at a specified URL and obtain
RequestDispatcher objects from it.
In security conscious environments, the servlet engine can
return null for a given URL.
getContext in interface javax.servlet.ServletContexturipath - a String specifying the URL for
which you are requesting a ServletContext
object
ServletContext object that
corresponds to the named URLRequestDispatcherpublic int getMajorVersion()
getMajorVersion in interface javax.servlet.ServletContextpublic int getMinorVersion()
getMinorVersion in interface javax.servlet.ServletContext
public java.net.URL getResource(java.lang.String pPath)
throws java.net.MalformedURLException
/dir/dir/file.ext.
This method allows the Web server to make a resource available to a servlet from any source. Resources can be located on a local or remote file system, in a database, or on a remote network site.
This method can return null
if no resource is mapped to the pathname.
The servlet engine must implement the URL handlers
and URLConnection objects that are necessary
to access the resource.
This method has a different purpose than
java.lang.Class.getResource,
which looks up resources based on a class loader. This
method does not use class loaders.
getResource in interface javax.servlet.ServletContextpPath - a String specifying
the path to the resource,
in the form /dir/dir/file.ext
null if there is no resource
at that path
java.net.MalformedURLException - if the pathname is not given in
the correct formpublic java.io.InputStream getResourceAsStream(java.lang.String pPath)
InputStream object.
The data in the InputStream can be
of any type or length. The path must be of
the form /dir/dir/file.ext. This method
returns null if no resource exists at
the specified path.
Metainformation such as content length and content type
that is available when you use the getResource
method is lost when you use this method.
The servlet engine must implement the URL handlers
and URLConnection objects necessary to access
the resource.
This method is different from
java.lang.Class.getResourceAsStream,
which uses a class loader. This method allows servlet engines
to make a resource available
to a servlet from any location, without using a class loader.
getResourceAsStream in interface javax.servlet.ServletContextpPath - a String specifying the path
to the resource,
in the form /dir/dir/file.ext
InputStream returned to the
servlet, or null if no resource
exists at the specified pathpublic java.util.Set getResourcePaths(java.lang.String pPath)
getResourcePaths in interface javax.servlet.ServletContextpublic javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String pUrlPath)
RequestDispatcher object that acts
as a wrapper for the resource located at the named path.
You can use a RequestDispatcher object to forward
a request to the resource or include a resource in a response.
The pathname must be in the form /dir/dir/file.ext.
This method returns null if the ServletContext
cannot return a RequestDispatcher.
The servlet engine is responsible for wrapping the resource
with a RequestDispatcher object.
getRequestDispatcher in interface javax.servlet.ServletContextpUrlPath - a String specifying the pathname
to the resource
RequestDispatcher object
that acts as a wrapper for the resource
at the path you specifyRequestDispatcherpublic javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String pName)
getNamedDispatcher in interface javax.servlet.ServletContextpublic java.util.Enumeration getAttributeNames()
Enumeration containing the
attribute names available
within this servlet context. You can use the
getAttribute(java.lang.String) method with an attribute name
to get the value of an attribute.
getAttributeNames in interface javax.servlet.ServletContextEnumeration of attribute
namesgetAttribute(java.lang.String)
public void setAttribute(java.lang.String pName,
java.lang.Object pObject)
Attribute names should follow the same convention as package
names. The Java Servlet API specification reserves names
matching java.*, javax.*, and
sun.*.
setAttribute in interface javax.servlet.ServletContextpName - a String specifying the name
of the attributepObject - an Object representing the
attribute to be given the namepublic void removeAttribute(java.lang.String pName)
getAttribute(java.lang.String) to retrieve the
attribute's value, getAttribute returns null.
removeAttribute in interface javax.servlet.ServletContextpName - a String specifying the name
of the attribute to be removedpublic java.lang.String getInitParameter(java.lang.String pName)
getInitParameter in interface javax.servlet.ServletContextpublic java.util.Enumeration getInitParameterNames()
getInitParameterNames in interface javax.servlet.ServletContext
public void log(java.lang.String pMessage,
java.lang.Throwable pThrowable)
log in interface javax.servlet.ServletContext
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||