Client View of Bean  «Prev  Next»

Lesson 9

EJB Client Program Conclusion

This module examined in some detail the EJB client program and how it interacts with the container and the bean.
I initially showed you a typical sequence of operations that the client goes through, and I explained the responsibilities of each of the entities in our session bean architecture.
Moving from the general to the specific, we looked at the concept of a remote reference[1] , and then identified and explained the Home interface[2] and the Home object.
We wrote the code to look up and download the remote reference to the home object from the Name Service, and then, using that reference, we created the bean instance and its EJBObject . The create() call returned the remote reference to the EJBObject, which we used in the client to invoke its business methods. We caught the system exceptions thrown by the infrastructure and application exceptions thrown by the bean.
I explained how a client can acquire a handle to a bean instance. This handle can be used to re-acquire the bean instance at a later time in, perhaps, a different program, in a different JVM.

Container and Server Provider

The container provider supplies an EJB container (the application server). This is the runtime environment in which beans live. The container supplies middleware services to the beans and manages them. Examples of EJB containers are Oracle WebLogic Server 12c, IBM's WebSphere, and JBoss open source code application server.
The server provider is the same as the container provider. Sun has not yet differentiated these (and they may never do so). We will use the terms EJB container and EJB server interchangeably in this course.

Tool Vendors

To facilitate the component development process, there should be a standardized way to build, manage, and maintain components. In the EJB Ecosystem, there are several Integrated Development Environments (IDEs) assist you in rapidly building and debugging components.
Examples are Eclipse IDE as well as NetBeans IDE. Other tools enable you to model components in the Unified Modeling Language (UML), which is the diagram style used in this book. You can then autogenerate EJB code from that UML.
Examples of products in this space are LucidChart, GenMyModel and Gliffy. There are other tools as well, such as tools to organize components, testing tools such as JUnit, and build tools like Ant.

  1. Home object: The EJB bean factory (see above). It listens on the network for client create() and remove() requests.
  2. EJBObject: That skeleton of the bean that implements the bean's interface.
  3. Handle: An object which contains all the information required to access an existing remote session bean.
  4. JVM: The Java Virtual Machine, a software implementation of a portable environment, that executes Java programs.
In the next module, we will actually deploy the Hello bean and then you can test it with the Hello client that I will provide. A client for a simple BankAccount bean will be written from scratch.

[1]Remote reference: The reference to an object, usually the stub, that knows where, and how to communicate with, a remote object.
[2]Home interface: The Java interface that is implemented by the deployer to build the home object.