14-03-2012, 04:35 PM
Hello World application with EJB
ejb case study.pdf (Size: 66.24 KB / Downloads: 507)
Steps to be followed
1. Component development
* Describe Remote interface
* Describe Home interface
* Implement the Bean class
2. Write deployment descriptor(s)
3. Package in an archive (jar file) all EJB files
4. Deployment into the container
5. Implement the client application
4
Remote interface : HelloWorld.java
z Corresponds to the interface description
z Gives the list of the methods the client can call
Home interface : HelloWorldHome.java
z Provides methods for the client to create, find or remove an EJB.
z To use an EJB, a client must first get a reference to its Home
interface using JNDI (Java Naming and Directory Interface).
z The create() method returns a reference to the EJB remote
interface (HelloWorld).
Packaging and deploying the EJB
z An EJB must be packaged in a “.jar” file containing
ª Class files
ª Deployment descriptors
z In order to be used, an EJB must first be deployed
ª Copy the jar file in a specific directory for the container to get it from