@Builtin @Singleton @Name(value="org.eiichiro.jaguar.Container") public class Container extends Object
Container
is the core of Jaguar. Container
deploys and
manages Jaguar components.Constructor and Description |
---|
Container() |
Modifier and Type | Method and Description |
---|---|
<T> T |
assemble(T component)
Assembles the specified component instance by injecting the dependent
components into it.
|
<T> T |
component(Class<T> component)
Returns assembled component instance of the specified component type.
|
<T> T |
component(Descriptor<T> descriptor)
Returns assembled component instance corresponding to the specified
descriptor.
|
<T> T |
component(Key<T> key)
Returns assembled component instance corresponding to the specified key
(Component type and binding annotations).
|
com.google.common.collect.ListMultimap<Class<?>,Descriptor<?>> |
components()
Returns component type-
Descriptor map the container manages. |
Map<Class<? extends Annotation>,Descriptor<? extends Context>> |
contexts()
Returns scope annotation-
Descriptor of Context map the
container manages. |
void |
dispose()
Disposes container-managed objects.
|
void |
initialize()
Initializes
Container instance. |
<T> void |
install(Class<T> component)
Installs the specified component into the container.
|
boolean |
installed(Class<?> component)
Indicates the specified component installed or not in the container.
|
WeakHashMap<Object,Descriptor<?>> |
instances()
Returns component instance-
Descriptor map the container manages. |
com.google.common.collect.ListMultimap<Annotation,Descriptor<?>> |
interceptors()
Returns intercept annotation-
Descriptor map the container
manages. |
public void initialize()
public <T> T component(Class<T> component)
null
.T
- The component type.component
- The component type.public <T> T component(Key<T> key)
null
. If a Default
qualified component is included
in the candidate, this method returns it in preference.T
- The component type.key
- The Key
constructed from the injective field to get
the dependent component.public <T> T component(Descriptor<T> descriptor)
T
- The component type.descriptor
- The Descriptor
.public <T> T assemble(T component)
T
- The component type.component
- The component instance that the dependent components to
be injected.public <T> void install(Class<T> component)
component
- The component instance of the specified component class.public boolean installed(Class<?> component)
component
- The component class to be examined.true
if the specified component installed in the
container.public void dispose()
Jaguar
in shutdown.public Map<Class<? extends Annotation>,Descriptor<? extends Context>> contexts()
Descriptor
of Context
map the
container manages.Descriptor
of Context
map
the container manages.public WeakHashMap<Object,Descriptor<?>> instances()
Descriptor
map the container manages.Descriptor
map the container
manages.public com.google.common.collect.ListMultimap<Class<?>,Descriptor<?>> components()
Descriptor
map the container manages.Descriptor
map the container manages.public com.google.common.collect.ListMultimap<Annotation,Descriptor<?>> interceptors()
Descriptor
map the container
manages.Descriptor
map the container
manages.Copyright © 2011-2014 Eiichiro Uchiumi. All Rights Reserved.