org.directwebremoting.impl
Class StartupUtil

java.lang.Object
  extended by org.directwebremoting.impl.StartupUtil

public class StartupUtil
extends java.lang.Object

Some utilities to help get DWR up and running

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
StartupUtil()
           
 
Method Summary
static void initContainerBeans(javax.servlet.ServletConfig servletConfig, javax.servlet.ServletContext servletContext, Container container)
          Get the various objects out of the Container, and configure them.
static HubFactory.HubBuilder initHub(javax.servlet.ServletContext servletContext, Container container)
          Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)
static ServerContextFactory.ServerContextBuilder initServerContext(javax.servlet.ServletConfig servletConfig, javax.servlet.ServletContext servletContext, Container container)
          Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)
static WebContextFactory.WebContextBuilder initWebContext(javax.servlet.ServletConfig servletConfig, javax.servlet.ServletContext servletContext, Container container)
          Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)
static void logStartup(javax.servlet.ServletConfig config)
          Some logging so we have a good clue what we are working with.
static void outOfContainerDestroy(Container container)
          Clean up the current thread when outOfContainerInit() has been called.
static Container outOfContainerInit()
          A way to setup DWR outside of any Containers.
static void setupLogging(javax.servlet.ServletConfig servletConfig, javax.servlet.http.HttpServlet servlet)
          Deprecated. Since version 2.1 DWR does not use Servlet Logging
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StartupUtil

public StartupUtil()
Method Detail

outOfContainerInit

public static Container outOfContainerInit()
                                    throws ContainerConfigurationException
A way to setup DWR outside of any Containers. This method can also serve as a template for in container code wanting to get DWR setup. Callers of this method should clean up after themselves by calling outOfContainerDestroy(Container)

Returns:
A new initialized container.
Throws:
ContainerConfigurationException - If we can't use a bean

outOfContainerDestroy

public static void outOfContainerDestroy(Container container)
Clean up the current thread when outOfContainerInit() has been called.

Parameters:
container - The container created by outOfContainerInit().

logStartup

public static void logStartup(javax.servlet.ServletConfig config)
Some logging so we have a good clue what we are working with.

Parameters:
config - The servlet config

initContainerBeans

public static void initContainerBeans(javax.servlet.ServletConfig servletConfig,
                                      javax.servlet.ServletContext servletContext,
                                      Container container)
Get the various objects out of the Container, and configure them.

Parameters:
servletConfig - The servlet configuration
servletContext - The servlet context
container - The container to save in the ServletContext

initWebContext

@Deprecated
public static WebContextFactory.WebContextBuilder initWebContext(javax.servlet.ServletConfig servletConfig,
                                                                            javax.servlet.ServletContext servletContext,
                                                                            Container container)
Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)

Get the WebContextFactory.WebContextBuilder out of the Container, configure it (call WebContextBuilder#set()) and use it to configure the WebContextFactory.

Parameters:
servletConfig - The servlet configuration
servletContext - The servlet context
container - The container to save in the ServletContext
Returns:
a new WebContextBuilder

initServerContext

@Deprecated
public static ServerContextFactory.ServerContextBuilder initServerContext(javax.servlet.ServletConfig servletConfig,
                                                                                     javax.servlet.ServletContext servletContext,
                                                                                     Container container)
Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)

Get the ServerContextFactory.ServerContextBuilder out of the Container, configure it and use it to configure the ServerContextFactory

Parameters:
servletConfig - The servlet configuration
servletContext - The servlet context
container - The container to save in the ServletContext
Returns:
The newly created ServerContextBuilder

initHub

@Deprecated
public static HubFactory.HubBuilder initHub(javax.servlet.ServletContext servletContext,
                                                       Container container)
Deprecated. Use initContainerBeans(ServletConfig, ServletContext, Container)

Get the HubFactory.HubBuilder out of the Container, configure it and use it to configure the HubFactory

Parameters:
servletContext - The servlet context
container - The container to save in the ServletContext
Returns:
The newly created HubBuilder

setupLogging

@Deprecated
public static void setupLogging(javax.servlet.ServletConfig servletConfig,
                                           javax.servlet.http.HttpServlet servlet)
Deprecated. Since version 2.1 DWR does not use Servlet Logging

We have some special logging classes to maintain an optional dependence on commons-logging. This sets the servlet for when this is not available.

Parameters:
servletConfig - The servlet configuration
servlet - The servlet that we are running under

Copyright ¬ 2005