uk.ltd.getahead.dwr.impl
Class DefaultContainer

java.lang.Object
  extended byuk.ltd.getahead.dwr.impl.DefaultContainer
All Implemented Interfaces:
Container

public class DefaultContainer
extends java.lang.Object
implements Container

DefaultContainer is like a mini-IoC container for DWR. At least it is an IoC container by interface (check: no params that have anything to do with DWR), but it is hard coded specifically for DWR. If we want to make more of it we can later, but this is certainly not going to become a full blown IoC container.

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

Constructor Summary
DefaultContainer()
           
 
Method Summary
 void addParameter(java.lang.Object askFor, java.lang.Object value)
          Set the class that should be used to implement the given interface
 void configurationFinished()
          Called to indicate that we finished called setImplementation.
 java.lang.Object getBean(java.lang.String id)
          Get an instance of a bean of a given type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContainer

public DefaultContainer()
Method Detail

addParameter

public void addParameter(java.lang.Object askFor,
                         java.lang.Object value)
                  throws java.lang.InstantiationException,
                         java.lang.IllegalAccessException
Set the class that should be used to implement the given interface

Parameters:
askFor - The interface to implement
value - The new implementation
Throws:
java.lang.IllegalAccessException - If the specified beans could not be accessed
java.lang.InstantiationException - If the specified beans could not be created

configurationFinished

public void configurationFinished()
Called to indicate that we finished called setImplementation.

See Also:
addParameter(Object, Object)

getBean

public java.lang.Object getBean(java.lang.String id)
Description copied from interface: Container
Get an instance of a bean of a given type.

Specified by:
getBean in interface Container
Parameters:
id - The type to get an instance of
Returns:
The object of the given type

Copyright ? 2005