J2EE???• J2EE defines a standard platform for developing multi-tierenterprise applications that are highly flexible.• The Java2 Enterprise Edition(J2EE) provides a distributedenvironment for developing, deploying and executingapplications.• J2EE allows to focus on business logic in the program.
J2EE Components• Application logic is divided into components according tofunction, and the various application components.• There are three kinds of defined components:- Client-tier components run on the client machine.- Web-tier components run on the J2EE server.- Business-tier components run on the J2EE server.- Enterprise information system (EIS)-tier software runs onthe EIS server.
Client Component• Application clients and applet clients are componentsthat run on the client.• An application client runs on a client machine andprovides a way for users to access the J2EE services.• A web page received from the web tier can include anembedded applet. An applet is a small clientapplication written in Java language that executes inthe Java virtual machine installed in the web browser.
Web Component• J2EE web components are either servlets or pagescreated using JSP technology(JSP Pages).• Servlets are Java programming language classes thatdynamically process requests and constructresponses.• JSP are server-side programming that accept,storeand search data coming from client application. Theyconverts to servlets before processing.
Business Component• Business code, which is logic that solves the needs ofa particular business domain such as banking, retail,or ﬁnance, is handled by enterprise beans running inthe business tier.• Enterprise JavaBeans are server-side, modular, andreusable components that comprise specific units offunctionality.• There are three kinds of enterprise beans:session beans, entity beans, and message-drivenbeans.
Business Component (contd…)• Session beans: These may beeither stateful or stateless, and are primarily used toencapsulate business logic, carry out tasks on behalf of aclient, and act as controllers for other beans.• Entity beans: An entity bean represents persistent datastored in one row of a database table. If the client terminates orif the server shuts down,the underlying services ensure that theentity bean data is saved.• Message-driven beans: Message-driven beans listenasynchronously for Java Message Service (JMS) messagesfrom any client or component.
Enterprise Information System Tier• The enterprise information system tier handles J2EEarchitecture’s connectivity to resources that are notpart of J2EE.• These include a variety of resources such asenterprise resource planning(ERP),database systems,and other legacy information systems.• This tier provides flexibility.
J2EE Container• The application server maintains control and providesservices through an interface or framework known asa container.• J2EE containers provide runtime support for J2EEapplication components.• J2EE application components use the protocols andmethods of the container to access other applicationcomponents and services provided by the server.
J2EE Container (contd…)• There are five defined container types in the J2EEspecification.• Two of these are server-side containers:An EJB container, A Web container.• The other two container types are client-side:An application container, An applet container.
The web container• The Web Container is a J2EE container that hostsweb applications.• Manages the execution of JSP page and servletcomponents for J2EE applications.• Web components and their container run on the J2EEserver.
The EJB Container• The EJB container acts as an interface between anenterprise bean and the clients.• Manages the execution of enterprise beans for J2EEapplications.• Enterprise beans and their container run on the J2EE server.• The container is responsible for creating the enterprise bean,binding the enterprise bean to the naming service.• It provides security by ensuring that only authorized clientshave access to the enterprise bean and its business methods.• It saves the bean’s state to persistent storage, and activatingor passivating the bean when necessary.
Application Client Container• Manages the execution of application clientcontainers.• Application clients and their container run on theclient.
Applet container• Manages the execution of applets.• It consists of a web browser and Java Plug-in runningon the client together.