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(java.lang.Object o)
Add a bean.
|
boolean |
addBean(java.lang.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(java.lang.Class<T> clazz) |
java.util.Collection<java.lang.Object> |
getBeans() |
<T> java.util.Collection<T> |
getBeans(java.lang.Class<T> clazz) |
<T> java.util.Collection<T> |
getContainedBeans(java.lang.Class<T> clazz) |
boolean |
isManaged(java.lang.Object bean)
Test if this container manages a bean
|
void |
manage(java.lang.Object bean)
Manages a bean already contained by this aggregate, so that it is started/stopped/destroyed with this
aggregate.
|
boolean |
removeBean(java.lang.Object o)
Removes the given bean.
|
void |
removeEventListener(Container.Listener listener)
Remove an event listener.
|
void |
unmanage(java.lang.Object bean)
Unmanages a bean already contained by this aggregate, so that it is not started/stopped/destroyed with this
aggregate.
|
boolean addBean(java.lang.Object o)
Container.Listener
, then also do an implicit addEventListener(Listener)
.o
- the bean object to addjava.util.Collection<java.lang.Object> getBeans()
getBean(Class)
<T> java.util.Collection<T> getBeans(java.lang.Class<T> clazz)
T
- the Bean typeclazz
- the class of the beansgetBeans()
,
getContainedBeans(Class)
<T> T getBean(java.lang.Class<T> clazz)
T
- the Bean typeclazz
- the class of the beanboolean removeBean(java.lang.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(java.lang.Object bean)
bean
- The bean to unmanage (must already have been added).void manage(java.lang.Object bean)
bean
- The bean to manage (must already have been added).boolean isManaged(java.lang.Object bean)
bean
- the bean to testboolean addBean(java.lang.Object o, boolean managed)
o
- The bean object to addmanaged
- whether to managed the lifecycle of the bean<T> java.util.Collection<T> getContainedBeans(java.lang.Class<T> clazz)
T
- the Bean typeclazz
- the class of the beansCopyright © 1995–2023 Webtide. All rights reserved.