Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
So far we've talked about some sophisticated mechanisms for connecting Java Beans together at design time and runtime. However, we haven't talked at all about the environment in which JavaBeans live. To build advanced, extensible applications we need a way for Java Beans to find each other or "rendezvous" at run time. The java.beans.beancontext package provides this kind of container environment It also provides a generic "services" lookup mechanism for Beans that wish to advertise their capabilities.
Beans that implement the BeanContextChild interface (or a subinterface) are passed a reference to the container's BeanContext, which is the source for all container-related information. The BeanContext implements many useful interfaces that describe the Bean environment. (To use it, cast it to the appropriate interface.) The two interfaces that we will talk about here are Collection and BeanContextServices.