|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.directwebremoting.impl.AbstractContainer
org.directwebremoting.impl.DefaultContainer
public class DefaultContainer
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.
Field Summary | |
---|---|
protected java.util.Map |
beans
The beans that we know of indexed by type |
Constructor Summary | |
---|---|
DefaultContainer()
|
Method Summary | |
---|---|
void |
addParameter(java.lang.Object askFor,
java.lang.Object valueParam)
Set the class that should be used to implement the given interface |
java.lang.Object |
getBean(java.lang.String id)
Get an instance of a bean of a given name (usually name=class name). |
java.util.Collection |
getBeanNames()
Get a list of all the available beans. |
void |
setupFinished()
Called to indicate that we finished adding parameters. |
Methods inherited from class org.directwebremoting.impl.AbstractContainer |
---|
callInitializingBeans |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Map beans
Constructor Detail |
---|
public DefaultContainer()
Method Detail |
---|
public void addParameter(java.lang.Object askFor, java.lang.Object valueParam) throws java.lang.InstantiationException, java.lang.IllegalAccessException
askFor
- The interface to implementvalueParam
- The new implementation
java.lang.IllegalAccessException
- If the specified beans could not be accessed
java.lang.InstantiationException
- If the specified beans could not be createdpublic void setupFinished()
Servlet#init(javax.servlet.ServletConfig)
,
where all the setup is done, and where we depend on the undocumented
feature of all servlet containers that they complete the init process
of a Servlet before they begin servicing requests.
addParameter(Object, Object)
public java.lang.Object getBean(java.lang.String id)
Container
getBean
in interface Container
id
- The type to get an instance of
public java.util.Collection getBeanNames()
Container
Container.getBean(String)
. This method should only be used
for debugging purposes.
getBeanNames
in interface Container
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |