public interface Container
Modifier and Type | Interface and Description |
---|---|
static interface |
Container.InheritedListener
Inherited Listener.
|
static interface |
Container.Listener
A listener for Container events.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addBean(Object o)
Add a bean.
|
boolean |
addBean(Object o,
boolean managed)
Adds the given bean, explicitly managing it or not.
|
void |
addEventListener(Container.Listener listener)
Add an event listener.
|
<T> T |
getBean(Class<T> clazz) |
Collection<Object> |
getBeans() |
<T> Collection<T> |
getBeans(Class<T> clazz) |
<T> Collection<T> |
getContainedBeans(Class<T> clazz) |
boolean |
isManaged(Object bean)
Test if this container manages a bean
|
void |
manage(Object bean)
Manages a bean already contained by this aggregate, so that it is started/stopped/destroyed with this
aggregate.
|
boolean |
removeBean(Object o)
Removes the given bean.
|
void |
removeEventListener(Container.Listener listener)
Remove an event listener.
|
void |
unmanage(Object bean)
Unmanages a bean already contained by this aggregate, so that it is not started/stopped/destroyed with this
aggregate.
|
boolean addBean(Object o)
Container.Listener
, then also do an implicit addEventListener(Listener)
.o
- the bean object to addCollection<Object> getBeans()
getBean(Class)
<T> Collection<T> getBeans(Class<T> clazz)
T
- the Bean typeclazz
- the class of the beansgetBeans()
,
getContainedBeans(Class)
<T> T getBean(Class<T> clazz)
T
- the Bean typeclazz
- the class of the beanboolean removeBean(Object o)
Container.Listener
, then also do an implicit removeEventListener(Listener)
.o
- the bean to removevoid addEventListener(Container.Listener listener)
listener
- the listener to addaddBean(Object)
void removeEventListener(Container.Listener listener)
listener
- the listener to removeremoveBean(Object)
void unmanage(Object bean)
bean
- The bean to unmanage (must already have been added).void manage(Object bean)
bean
- The bean to manage (must already have been added).boolean isManaged(Object bean)
bean
- the bean to testboolean addBean(Object o, boolean managed)
o
- The bean object to addmanaged
- whether to managed the lifecycle of the bean<T> Collection<T> getContainedBeans(Class<T> clazz)
T
- the Bean typeclazz
- the class of the beansCopyright © 2010 - 2020 Adobe. All Rights Reserved