Showing posts with label EJB. Show all posts
Showing posts with label EJB. Show all posts

EJB 3.1 SessionBean Example with Remote Interface using WebLogic 12.1.1

EJB stands for Enterprise Java Bean. If you are not fimilar with EJB, Please read below in order to move ahead with "Creating EJB 3.1 Application using WebLogic 12.1.1".
  1. What is EJB and Why Comes into Picture
  2. EJB Container and it's Feature
EJB application requires to be run in Application Server like WebLogic, JBoss. As part of current EJB Demo, WebLogic Server 12.1.1 and  JDK 1.7 Update 03 is used.

Suppose, I want to write Stateless Session Bean(Can be local or remote), in My case Remote Component which will provide customer Information upon request from Client.

What is EJB and Why it cames into Picture

Enterprise beans:These are the Java EE server side components that run inside the ejb container and encapsulates the business logic of an enterprise application

Benefits:
-----------------------
1.EBeans are used for developing distributed,large Application.
2.The client developer can focus only on the representation style of the client as all the business logic of the application is contained in the enterprise beans. The client developer does not bother about the code that implements business logic or the logic to access the databases
3.Reusage can be done to develope new app from existing one.
4.EBeans are portable.

Types:
1. session EJB: Execute single or multiple methods for clients. These types of bean are not shared by client and not persistence. Meaning When client terminates, session ejb terminates and no longer associated with client.

EJB Container and Features of EJB Container

EJB container : It program that runs on the server and provides environment for running the enterprise components. Enterprise beans are used in distributed applications that typically contains the business logic

Features of EJB Container :-
----------------------------------------
1.Transaction Management :
Support for Transaction.It uses the Java Transaction APIs(JTA) to expose the transaction services. JTA, interface which is used to control transactions.

2.Security:
Uses JSE to make more secure app. Enterprise beans add this feature to provide transparent security.

3.Remote Accessibility:
Client(remote) can invoke enterprise bean running on host machine using RPC Remote Procedure Call .Basically RMI- Remote Method Invocation concept.