Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 19. Java Beans > BeanContext and BeanContextServices

19.5. BeanContext and BeanContextServices

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial