org.directwebremoting.impl
Class DefaultBuilder<T>

java.lang.Object
  extended by org.directwebremoting.impl.DefaultBuilder<T>
All Implemented Interfaces:
Builder<T>
Direct Known Subclasses:
DefaultCallbackHelperBuilder, DefaultHubBuilder, DefaultTaskDispatcherBuilder, JavaccJsonParserBuilder, LocalJsonSerializerBuilder

public class DefaultBuilder<T>
extends java.lang.Object
implements Builder<T>

A Builder that creates DefaultHubs.

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

Constructor Summary
DefaultBuilder(java.lang.Class<? extends T> created)
          This method calls created.getConstructor(constructorParameters) in order to find a constructor which the Builder can use
 
Method Summary
 T attach(Container container)
          This method should be called during setup only.
 T get()
          Get the object that is associated with this thread, assuming that there is no confusion over the current ServerContext.
 T get(ServerContext serverContext)
          Get the object that is associated with this thread, whilst specifying the correct ServerContext.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuilder

public DefaultBuilder(java.lang.Class<? extends T> created)
This method calls created.getConstructor(constructorParameters) in order to find a constructor which the Builder can use

Parameters:
created - The type we wish to create
Method Detail

get

public T get()
Description copied from interface: Builder
Get the object that is associated with this thread, assuming that there is no confusion over the current ServerContext. There is more than one ServerContext then you need to use Builder.get(ServerContext) to ensure that the correct one is used.

Specified by:
get in interface Builder<T>
Returns:
The object associated with this DWR instance

get

public T get(ServerContext serverContext)
Description copied from interface: Builder
Get the object that is associated with this thread, whilst specifying the correct ServerContext.

Specified by:
get in interface Builder<T>
Parameters:
serverContext - The web application environment
Returns:
The object that is associated with this web application

attach

public T attach(Container container)
Description copied from interface: Builder
This method should be called during setup only. This is a bit like InitializingBean.afterContainerSetup(org.directwebremoting.Container) except that it is called by Factory.attach(org.directwebremoting.Container) which is called after the container has finished setting itself up so we can rely on ServerContextFactory.get() working.

Specified by:
attach in interface Builder<T>

Copyright 2008