| java.lang.Object org.directwebremoting.impl.ContainerUtil
ContainerUtil | public class ContainerUtil (Code) | | An abstraction of all the common servlet operations that are required to host
a DWR service that depends on the servlet spec.
It would be good to have a base class for all servlet operations, however
lack of MI prevents us from doing this.
author: Joe Walker [joe at getahead dot ltd dot uk] |
Method Summary | |
public static void | configure(Container container, List<Configurator> configurators) | public static void | configureContainerFully(Container container, ServletConfig servletConfig) | public static boolean | configureFromAnnotations(Container container) Annotations must not break 1.3, so we use reflection to create an
org.directwebremoting.annotations.AnnotationsConfigurator
and the catch all sorts of random exceptions for the benefit of
Websphere. | public static void | configureFromDefaultDwrXml(Container container) | public static boolean | configureFromInitParams(Container container, ServletConfig servletConfig) Add configurators from init params to the end of the list of
configurators. | public static void | configureFromSystemDwrXml(Container container) Configure using the system dwr.xml from within the JAR file. | public static Container | createAndSetupDefaultContainer(ServletConfig servletConfig) A combination of
ContainerUtil.createDefaultContainer(ServletConfig) and
ContainerUtil.setupDefaultContainer(DefaultContainer,ServletConfig) . | public static DefaultContainer | createDefaultContainer(ServletConfig servletConfig) Create a
DefaultContainer , allowing users to upgrade to a child
of DefaultContainer using an
ServletConfig init parameter of
org.directwebremoting.Container . | public static void | createUrlMapping(DefaultContainer container, String url, String propertyName, Class<? extends Handler> handler) Creates entries in the
Container so 2 lookups are possible.
| public static void | debugConfig(Container container) | public static List<Container> | getAllPublishedContainers(ServletContext servletContext) Get a list of all known Containers for the given
ServletContext Parameters: servletContext - The context in which Containers are stored. | public static ServerContext | getSingletonServerContext() If there is only once instance of DWR defined in a ServletContext then
we can get at it using this method. | public static void | prepareForWebContextFilter(ServletContext context, ServletConfig config, Container container, WebContextBuilder webContextBuilder, HttpServlet servlet) Make some changes to the ServletContext so
DwrWebContextFilter can find the Container etc. | public static void | publishContainer(Container container, ServletConfig servletConfig) If helps some situations if people can get at the container by looking
in the servlet context, under some name. | public static void | resolveContainerAbstraction(DefaultContainer container, ServletConfig servletConfig) We need to decide which
ContainerAbstraction should be the
default for this
Container , also we should prepare the default
ServerLoadMonitor . | public static void | setupDefaultContainer(DefaultContainer container, ServletConfig servletConfig) Setup a
DefaultContainer . | public static void | setupDefaults(DefaultContainer container) | public static void | setupFromServletConfig(DefaultContainer container, ServletConfig servletConfig) | public static void | shutdownServerLoadMonitorsInContainerList(List<Container> containers, String title) Internal use only. |
ATTRIBUTE_CONTAINER_LIST | final public static String ATTRIBUTE_CONTAINER_LIST(Code) | | The name under which we publish all
Container s.
|
DEFAULT_SERVERCONTEXT_NAME | final public static String DEFAULT_SERVERCONTEXT_NAME(Code) | | We store a single ServerContext in the contextMap under this name.
|
INIT_CONFIG | final public static String INIT_CONFIG(Code) | | Init parameter: Set a dwr.xml config file.
This is only a prefix since we might have more than 1 config file.
|
INIT_CUSTOM_CONFIGURATOR | final public static String INIT_CUSTOM_CONFIGURATOR(Code) | | Init parameter: If you wish to use a custom configurator, place its
class name here
|
INIT_LOGLEVEL | final public static String INIT_LOGLEVEL(Code) | | Init parameter: If we are doing Servlet.log logging, to what level?
|
INIT_SKIP_DEFAULT | final public static String INIT_SKIP_DEFAULT(Code) | | Init parameter: Skip reading the default config file if none are specified.
|
configure | public static void configure(Container container, List<Configurator> configurators)(Code) | | Allow all the configurators to have a go at the container in turn
Parameters: container - The container to configure Parameters: configurators - A list of configurators to run against the container |
configureFromAnnotations | public static boolean configureFromAnnotations(Container container)(Code) | | Annotations must not break 1.3, so we use reflection to create an
org.directwebremoting.annotations.AnnotationsConfigurator
and the catch all sorts of random exceptions for the benefit of
Websphere.
Parameters: container - The container to configure true if the configuration worked. |
debugConfig | public static void debugConfig(Container container)(Code) | | Create a bunch of debug information about a container
Parameters: container - The container to print debug information about |
getSingletonServerContext | public static ServerContext getSingletonServerContext()(Code) | | If there is only once instance of DWR defined in a ServletContext then
we can get at it using this method.
The one-and-only ServerContext or null if there are more than 1. |
prepareForWebContextFilter | public static void prepareForWebContextFilter(ServletContext context, ServletConfig config, Container container, WebContextBuilder webContextBuilder, HttpServlet servlet)(Code) | | Make some changes to the ServletContext so
DwrWebContextFilter can find the Container etc.
Parameters: context - The servlet context Parameters: config - The servlet configuration Parameters: container - The container to save in the ServletContext Parameters: webContextBuilder - The WebContextBuilder to save Parameters: servlet - The Servlet to save |
publishContainer | public static void publishContainer(Container container, ServletConfig servletConfig)(Code) | | If helps some situations if people can get at the container by looking
in the servlet context, under some name.
The name is specified in an initParameter.
Parameters: container - The container to publish Parameters: servletConfig - Source of initParams to dictate publishing and contexts to publish to |
shutdownServerLoadMonitorsInContainerList | public static void shutdownServerLoadMonitorsInContainerList(List<Container> containers, String title)(Code) | | Internal use only.
If we detect that the server is being shutdown then we want to kill
any reverse ajax threads.
Parameters: containers - The list of containers to look for ServerLoadMonitors in Parameters: title - What causes this (for debug purposes) |
|
|