org.directwebremoting.extend
Class Factory<T>

java.lang.Object
  extended by org.directwebremoting.extend.Factory<T>

public class Factory<T>
extends java.lang.Object

Factory is not a user facing object, it is designed for system implementors. Factory objects are generally use as helper classes by Factory classes whose methods reflect the methods of Factory, but which are static and proxy the call to the contained Factory instance.

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

Constructor Summary
Factory(java.lang.Class<? extends Builder<T>> created)
          We need to know what type of builder to extract from the Container
 
Method Summary
 T attach(Container container)
          Internal method to allow us to get the Builder from which we will get created objects.
static
<T> Factory<T>
create(java.lang.Class<? extends Builder<T>> created)
          Make it easy for Factories to create a Factory instance.
 T get()
          Accessor for the current object managed by this factory instance.
 T get(ServerContext ctx)
          Accessor for the current object in more complex setups.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory(java.lang.Class<? extends Builder<T>> created)
We need to know what type of builder to extract from the Container

Method Detail

create

public static <T> Factory<T> create(java.lang.Class<? extends Builder<T>> created)
Make it easy for Factories to create a Factory instance.


get

public T get()
Accessor for the current object managed by this factory instance.


get

public T get(ServerContext ctx)
Accessor for the current object 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 object accessed by this Factory.

attach

public T attach(Container container)
Internal method to allow us to get the Builder from which we will get created objects. Do NOT call this method from outside of DWR. This function should only be called during startup. our Container Builder from.


Copyright 2008