JavaBeans: Unlocking the BeanContext API

Since the introduction of the JavaBeans component architecture in the Java Development Kit v 1.1 (JDK) release in February 1997, additional specifications have been added to this component architecture such as the Extensible Runtime Containment and Services Protocol and the InfoBus standard extension. Both of these additions provide APIs that enable Beans to interconnect during run-time. Read on to learn more about the Extensible Runtime Containment and Services Protocol API (BeanContext, for short) and see how this API is implemented in the BeanBox in the Beans Development Kit (BDK) 1.1 and how you can develop dynamically connecting Beans.

Extensible Runtime Containment and Services Protocol

The JavaBeans architecture sets rules for what makes a Java class a reusable software component (Bean, for short). It defines how, via reflection and introspection, the capabilities of a Bean are discovered. Such capabilities can be a Bean’s properties, the events a Bean fires or the public methods of a Bean. This information is used by a development tool to provide a visual programming environment wherein the developer interconnects Beans, wiring one Bean’s events to another Bean’s public methods. The resulting set of connected components can be compiled into an applet or application and delivered to the end user. Thus the connections between the Beans and the customization of their properties occur during what is called design-time. The result of this process is experienced by the end user during run-time.

The BeanContext API adds much more flexibility to this scenario. It enables a Bean to interrogate its environment for certain capabilities and available services. This allows the Bean to dynamically adjust its behavior to the container or context in which it finds itself.

The BeanContext API is a core API in the Java 2 Standard Edition SDK (J2SDK). The API consists of two parts: 1) logical containment hierarchy for JavaBeans components and publishing and 2) discovery of services provided by Beans within such a hierarchy.

To Read More Please Visit Java.Sun.Com