![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Shri Kanaskar | |||||||||||||||||||||||||||||||||||||||
A Java bean is a Java component, which runs on JVM. It is nothing but the java class which implements the . java.io.Serializable interface and . uses ger/set methods to expose its properties. Template TemplateJavaBean.java import java.io.Serializable; public class TemplateJavaBean implements java.io.Serializable{ private String templeteproperty = new String(""); public TemplatejavaBean() { } public String getTemplateProperty() { return templateproperty; } public void setTemplateProperty(String value) { templateProperty = value; }} |
|||||||||||||||||||||||||||||||||||||||
Welcome! | |||||||||||||||||||||||||||||||||||||||
This is a quick introduction to Java Beans |
|||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||
For JSP and JavaBeans example. | |||||||||||||||||||||||||||||||||||||||
EJB | |||||||||||||||||||||||||||||||||||||||
EJB CONTAINER | |||||||||||||||||||||||||||||||||||||||
It is another service provided by J2EE server. EJB's are simple portable, scalable, reusable, deployable software components that can be create enterprise-class applications. They rely on the container in which they run. Container provides following services, how it does is depends on the vendor |
|||||||||||||||||||||||||||||||||||||||
Database connection management. Communication management. Security. Lifecycle management. Transaction management. +++++++++++++++++++++++++++++++ I EJB-1 EJB-2 .....EJB-N |
|||||||||||||||||||||||||||||||||||||||
There are two types of Enterprise JavaBeans | |||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||
Session Bean | |||||||||||||||||||||||||||||||||||||||
![]() |
Entity Bean | ![]() |
|||||||||||||||||||||||||||||||||||||
Session Bean scoped to a single client and performs work on behalf of that client Client communicate bean by invoking its method. There are two type of session beans. | |||||||||||||||||||||||||||||||||||||||
An entity bean represent an entity, such as customer, Inventory Item, shipping statement, hotel reservation etc. The state of the bean exists on some external media-typically a record in a database- and is available for subsequent use, even after the application that created terminates. Like Stateless and Stateful session beans, and entity bean begins life in the 'Does not exist' state, it transitions into the 'POOLED' state. The bean can transition to 'Ready' state as a result of create request from a client(either by find or activation method) |
|||||||||||||||||||||||||||||||||||||||
STATELESS | STATEFULL | ||||||||||||||||||||||||||||||||||||||
It has well defined life cycle, during which it can be two either 'Does not exist' or 'Ready' state. Stateless seiion bean has no permanent association with client. Series of 3 methods-are container initiated-results in the bean transitioning from Does not exist to Ready state. 1> newinstance():-Instantiates the bean 2>setSessioncontext() 3>ejbCreate() :- Perform initialization task |
|||||||||||||||||||||||||||||||||||||||
It is dedicated to one client for the life of the bean, maintains coversational state. Every method invocation from a client is against same instance. Life cycle is complex than stateless bean. 1> newinstance():-Instantiates the bean 2>setSessioncontext() 3>ejbCreate() :- Perform initialization task |
|||||||||||||||||||||||||||||||||||||||