|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.israfil.micro.container.AbstractContainer
net.israfil.micro.container.DefaultAutoWiringAdaptableContainer
public class DefaultAutoWiringAdaptableContainer
A default implementation of AutoWiringAdaptableContainer, a Container that uses an AutoWiringAdapter to ensure that components can be created appropriately with their dependencies satisfied automatically. This adapter is intended for constructor injection, but relies on the adapter to perform such. No reflection is used by this class itself.
| Constructor Summary | |
|---|---|
DefaultAutoWiringAdaptableContainer()
A default constructor that will throw errors regarding circular dependencies at registration time, throw missing dependency errors at wire-up (getComponent()) time, and has no parent. |
|
DefaultAutoWiringAdaptableContainer(boolean failEarly)
Construct this container such that it detects missing dependencies upon invocation of start(). |
|
DefaultAutoWiringAdaptableContainer(Container parent)
This method constructs a DefaultAutoWiringAdaptableContainer that has a parent container for backup resolution. |
|
DefaultAutoWiringAdaptableContainer(Container parent,
boolean failEarly)
Construct this container such that it detects missing dependencies upon invocation of start(). |
|
| Method Summary | |
|---|---|
java.lang.Object |
getComponent(java.lang.Object key)
Returns the component named by the key if it is available, or null if no such component is available. |
void |
registerType(java.lang.Object key,
AutoWiringAdapter componentAdapter)
Register a component. |
void |
registerType(java.lang.Object key,
java.lang.Class componentType)
Register an independent component. |
void |
start()
Begin the lifecycle of the container, after which components should be accessible. |
| Methods inherited from class net.israfil.micro.container.AbstractContainer |
|---|
getParent, getStoredComponent, hasComponent, isRunning, isStored, store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.israfil.micro.container.Container |
|---|
hasComponent, isRunning |
| Constructor Detail |
|---|
public DefaultAutoWiringAdaptableContainer()
failEarly - A boolean to indicate that this container should detect missing or circular dependencies at start() time.public DefaultAutoWiringAdaptableContainer(boolean failEarly)
failEarly - A boolean to indicate that this container should detect missing or circular dependencies at start() time.public DefaultAutoWiringAdaptableContainer(Container parent)
parent - The parent container (optional)
public DefaultAutoWiringAdaptableContainer(Container parent,
boolean failEarly)
failEarly - A boolean to indicate that this container should detect missing or circular dependencies at start() time.parent - The parent Container (optional)| Method Detail |
|---|
public void start()
Container
start in interface AutoWiringAdaptableContainerstart in interface Containerstart in class AbstractContainer
public void registerType(java.lang.Object key,
java.lang.Class componentType)
AutoWiringAdaptableContainer
registerType in interface AutoWiringAdaptableContainer
public void registerType(java.lang.Object key,
AutoWiringAdapter componentAdapter)
AutoWiringAdaptableContainerInjectable.class.isAssignableFrom(type);
to ensure that the provided component implements the lifecycle
mechanisms necessary to auto-wire.
registerType in interface AutoWiringAdaptableContainerpublic java.lang.Object getComponent(java.lang.Object key)
Container
getComponent in interface Container
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||