org.directwebremoting
Class HubFactory

java.lang.Object
  extended by org.directwebremoting.HubFactory

public class HubFactory
extends java.lang.Object

An accessor for the current Hub

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

Nested Class Summary
static interface HubFactory.HubBuilder
          Class to enable us to access servlet parameters.
 
Constructor Summary
HubFactory()
           
 
Method Summary
static Hub get()
          Accessor for the current Hub.
static Hub get(javax.servlet.ServletContext ctx)
          Accessor for the current Hub in more complex setups.
static void setHubBuilder(HubFactory.HubBuilder builder)
          Internal method to allow us to get the HubBuilder from which we will get Hub objects.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HubFactory

public HubFactory()
Method Detail

get

public static Hub get()
Accessor for the current Hub.

Returns:
The current Hub.

get

public static Hub get(javax.servlet.ServletContext ctx)
Accessor for the current Hub in more complex setups. For some setups DWR may not be able to discover the correct environment (i.e. ServletContext), so we need to tell it. This generally happens if you have DWR configured twice in a single context. Unless you are writing code that someone else will configure, it is probably safe to use the simpler get() method.

Parameters:
ctx - The servlet context to allow us to bootstrap
Returns:
The current Hub.

setHubBuilder

public static void setHubBuilder(HubFactory.HubBuilder builder)
Internal method to allow us to get the HubBuilder from which we will get Hub objects. Do not call this method from outside of DWR.

Parameters:
builder - The factory object (from DwrServlet)

Copyright ¬ 2005