org.directwebremoting.extend
Interface Builder<T>

All Known Subinterfaces:
CallbackHelperFactory.CallbackHelperBuilder, HubFactory.HubBuilder, JsonParserFactory.JsonParserBuilder, JsonSerializerFactory.JsonSerializerBuilder, ServerContextFactory.ServerContextBuilder, TaskDispatcherFactory.TaskDispatcherBuilder
All Known Implementing Classes:
DefaultBuilder, DefaultCallbackHelperBuilder, DefaultHubBuilder, DefaultServerContextBuilder, DefaultTaskDispatcherBuilder, JavaccJsonParserBuilder, LocalJsonSerializerBuilder

public interface Builder<T>

Class to enable us to build 'singleton' interface implementations. It is assumed that there is one 'singleton' per ServerContext. Both this class and implementations of it are generally for use by DWR developers. If you are a DWR user then unless you're doing something very deep, you're probably digging too far.

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

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 context)
          Get the object that is associated with this thread, whilst specifying the correct ServerContext.
 

Method Detail

get

T get()
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 get(ServerContext) to ensure that the correct one is used.

Returns:
The object associated with this DWR instance

get

T get(ServerContext context)
Get the object that is associated with this thread, whilst specifying the correct ServerContext.

Parameters:
context - The web application environment
Returns:
The object that is associated with this web application

attach

T attach(Container container)
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.


Copyright 2008