Java Doc for ContainerUtil.java in  » Ajax » dwr » org » directwebremoting » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » dwr » org.directwebremoting.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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]


Field Summary
final public static  StringATTRIBUTE_CONTAINER_LIST
     The name under which we publish all Container s.
final public static  StringDEFAULT_SERVERCONTEXT_NAME
     We store a single ServerContext in the contextMap under this name.
final public static  StringINIT_CONFIG
     Init parameter: Set a dwr.xml config file.
final public static  StringINIT_CUSTOM_CONFIGURATOR
    
final public static  StringINIT_LOGLEVEL
    
final public static  StringINIT_SKIP_DEFAULT
     Init parameter: Skip reading the default config file if none are specified.


Method Summary
public static  voidconfigure(Container container, List<Configurator> configurators)
    
public static  voidconfigureContainerFully(Container container, ServletConfig servletConfig)
    
public static  booleanconfigureFromAnnotations(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  voidconfigureFromDefaultDwrXml(Container container)
    
public static  booleanconfigureFromInitParams(Container container, ServletConfig servletConfig)
     Add configurators from init params to the end of the list of configurators.
public static  voidconfigureFromSystemDwrXml(Container container)
     Configure using the system dwr.xml from within the JAR file.
public static  ContainercreateAndSetupDefaultContainer(ServletConfig servletConfig)
     A combination of ContainerUtil.createDefaultContainer(ServletConfig) and ContainerUtil.setupDefaultContainer(DefaultContainer,ServletConfig) .
public static  DefaultContainercreateDefaultContainer(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  voidcreateUrlMapping(DefaultContainer container, String url, String propertyName, Class<? extends Handler> handler)
     Creates entries in the Container so 2 lookups are possible.
public static  voiddebugConfig(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  ServerContextgetSingletonServerContext()
     If there is only once instance of DWR defined in a ServletContext then we can get at it using this method.
public static  voidprepareForWebContextFilter(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  voidpublishContainer(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  voidresolveContainerAbstraction(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  voidsetupDefaultContainer(DefaultContainer container, ServletConfig servletConfig)
     Setup a DefaultContainer .
public static  voidsetupDefaults(DefaultContainer container)
    
public static  voidsetupFromServletConfig(DefaultContainer container, ServletConfig servletConfig)
    
public static  voidshutdownServerLoadMonitorsInContainerList(List<Container> containers, String title)
     Internal use only.

Field Detail
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.





Method Detail
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



configureContainerFully
public static void configureContainerFully(Container container, ServletConfig servletConfig) throws IOException, ParserConfigurationException, SAXException(Code)
Run all the default configuration options on a Container
Parameters:
  container - The container to configure
Parameters:
  servletConfig - The source of init parameters
throws:
  SAXException - If the config file parse fails
throws:
  ParserConfigurationException - If the config file parse fails
throws:
  IOException - If the config file read fails



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.



configureFromDefaultDwrXml
public static void configureFromDefaultDwrXml(Container container) throws IOException, ParserConfigurationException, SAXException(Code)
Configure using the users dwr.xml that sits next in WEB-INF
Parameters:
  container - The container to configure
throws:
  ParserConfigurationException - If the config file parse fails
throws:
  IOException - If the config file read fails
throws:
  SAXException - If the config file parse fails



configureFromInitParams
public static boolean configureFromInitParams(Container container, ServletConfig servletConfig) throws IOException, ParserConfigurationException, SAXException(Code)
Add configurators from init params to the end of the list of configurators.
Parameters:
  container - The container to configure
Parameters:
  servletConfig - The source of init parameters true if any Configurators were read
throws:
  SAXException - If the config file parse fails
throws:
  ParserConfigurationException - If the config file parse fails
throws:
  IOException - If the config file read fails



configureFromSystemDwrXml
public static void configureFromSystemDwrXml(Container container) throws IOException, ParserConfigurationException, SAXException(Code)
Configure using the system dwr.xml from within the JAR file.
Parameters:
  container - The container to configure
throws:
  ParserConfigurationException - If the config file parse fails
throws:
  IOException - If the config file read fails
throws:
  SAXException - If the config file parse fails



createAndSetupDefaultContainer
public static Container createAndSetupDefaultContainer(ServletConfig servletConfig) throws ContainerConfigurationException(Code)
A combination of ContainerUtil.createDefaultContainer(ServletConfig) and ContainerUtil.setupDefaultContainer(DefaultContainer,ServletConfig) .
Parameters:
  servletConfig - The source of init parameters A setup implementation of DefaultContainer
throws:
  ContainerConfigurationException - If the specified class could not be found or instantiated



createDefaultContainer
public static DefaultContainer createDefaultContainer(ServletConfig servletConfig) throws ContainerConfigurationException(Code)
Create a DefaultContainer , allowing users to upgrade to a child of DefaultContainer using an ServletConfig init parameter of org.directwebremoting.Container. Note that while the parameter name is the classname of Container , currently the only this can only be used to create children that inherit from DefaultContainer . This restriction may be relaxed in the future. Unlike ContainerUtil.setupDefaultContainer(DefaultContainer,ServletConfig) , this method does not call any setup methods.
Parameters:
  servletConfig - The source of init parameters An un'setup' implementation of DefaultContainer
throws:
  ContainerConfigurationException - If the specified class could not be found
See Also:   ServletConfig.getInitParameter(String)ContainerUtil.createAndSetupDefaultContainer(ServletConfig)



createUrlMapping
public static void createUrlMapping(DefaultContainer container, String url, String propertyName, Class<? extends Handler> handler) throws ContainerConfigurationException(Code)
Creates entries in the Container so 2 lookups are possible.
Parameters:
  container - The container to create the entries in
Parameters:
  url - The URL of the new Handler
Parameters:
  propertyName - The property name (for injection and lookup)
Parameters:
  handler - The class of Handler
throws:
  ContainerConfigurationException - From DefaultContainer.addParameter(StringObject)



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



getAllPublishedContainers
public static List<Container> getAllPublishedContainers(ServletContext servletContext)(Code)
Get a list of all known Containers for the given ServletContext
Parameters:
  servletContext - The context in which Containers are stored. a list of published Containers.



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



resolveContainerAbstraction
public static void resolveContainerAbstraction(DefaultContainer container, ServletConfig servletConfig) throws ContainerConfigurationException(Code)
We need to decide which ContainerAbstraction should be the default for this Container , also we should prepare the default ServerLoadMonitor .
Parameters:
  container - The container to configure
Parameters:
  servletConfig - Information about the environment
throws:
  ContainerConfigurationException - If we can't use a bean



setupDefaultContainer
public static void setupDefaultContainer(DefaultContainer container, ServletConfig servletConfig) throws ContainerConfigurationException(Code)
Setup a DefaultContainer . Using ContainerUtil.createDefaultContainer(ServletConfig) followed by ContainerUtil.setupFromServletConfig(DefaultContainer,ServletConfig) before calling DefaultContainer.setupFinished .
Parameters:
  container - The container to configure
Parameters:
  servletConfig - The source of init parameters
throws:
  ContainerConfigurationException - If we can't use a bean



setupDefaults
public static void setupDefaults(DefaultContainer container) throws ContainerConfigurationException(Code)
Take a DefaultContainer and setup the default beans
Parameters:
  container - The container to configure
throws:
  ContainerConfigurationException - If we can't use a bean



setupFromServletConfig
public static void setupFromServletConfig(DefaultContainer container, ServletConfig servletConfig) throws ContainerConfigurationException(Code)
Take a DefaultContainer and setup the default beans
Parameters:
  container - The container to configure
Parameters:
  servletConfig - The servlet configuration (null to ignore)
throws:
  ContainerConfigurationException - If we can't use a bean



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)




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.