170 likes | 377 Views
Quontra Solution offering advanced java online training with job placement assistance. We are having real time experienced java faculties which may help you and assist you all the time. There are many chances to become a software programmer if you choose java technology For free demo and any questions feel free to call us
E N D
JAVA-J2EE Contact info: Call : 44 (0)20 3734 1498 / 99 Mail Us: info@quontrasolutions.co.uk
Contents • J2EE • XML • JSTL • EJB • Session Beans • Entity Beans • BMP • Message Driven Beans • Transactions • Java mail
J2EE J2EE Container Containers are the interface between a component and the low-level platform-specific functionality that supports the component. Before a Web, enterprise bean, or application client component can be executed, it must be assembled into a J2EE application and deployed into its container.
XML XML Example Document <?xml version="1.0" encoding="UTF-8"?><note> <to> Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body></note>
J2EE server • The runtime portion of a J2EE product. A J2EE server provides EJB and Web containers. Enterprise JavaBeans (EJB) container • Manages the execution of enterprise beans for J2EE applications. Enterprise beans and their container run on the J2EE server. Web container • Manages the execution of JSP page and servlet components for J2EE applications. Web components and their container run on the J2EE server. Application client container • Manages the execution of application client components. Application clients and their container run on the client. Applet container • Manages the execution of applets. Consists of a Web browser and Java Plug-in running on the client together.
JSTL • The JavaServer Pages Standard Tag Library (JSTL) is a collection of useful JSP tags which encapsulates core functionality common to many JSP applications. • JSTL has support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags. It also provides a framework for integrating existing custom tags with JSTL tags. • The JSTL tags can be classified, according to their functions, into following JSTL tag library groups that can be used when creating a JSP page: • Core Tags • Formatting tags • SQL tags • XML tags • JSTL Functions
EJB • Enterprise Java Beans (EJB) is a development architecture for building highly scalable and robust enterprise level applications to be deployed on J2EE compliant Application Server such as JBOSS, Web Logic etc. • EJB 3.0 is being a great shift from EJB 2.0 and makes development of EJB based applications quite easy. • This tutorial will give you great understanding on EJB concepts needed to create and deploy an enterprise level application up and running.
EJBComponent (EJB Module) Example: LibrarySessionBeanRemote.java package com.tutorialspoint.stateless; import java.util.List; import javax.ejb.Remote; @Remote public interface LibrarySessionBeanRemote { void addBook(String bookName); List getBooks(); }
LibrarySessionBean.java package com.tutorialspoint.stateless; import java.util.ArrayList; import java.util.List; import javax.ejb.Stateless; public class LibrarySessionBean implements LibrarySessionBeanRemote { List<String> bookShelf; public LibrarySessionBean(){ bookShelf = new ArrayList<String>(); } public void addBook(String bookName) { bookShelf.add(bookName); } public List<String> getBooks() { return bookShelf; } }
Session Beans • A session bean represents a single client inside the Application Server. To access an application that is deployed on the server, the client invokes the session bean’s methods. The session bean performs work for its client, shielding the client from complexity by executing business tasks inside the server. • As its name suggests, a session bean is similar to an interactive session. A session bean is not shared; it can have only one client, in the same way that an interactive session can have only one user. Like an interactive session, a session bean is not persistent. (That is, its data is not saved to a database.) When the client terminates, its session bean appears to terminate and is no longer associated with the client.
Entity Beans • Definition of an Entity Bean • An entity bean is a remote object that manages persistent data, performs complex business logic, potentially uses several dependent Java objects, and can be uniquely identified by a primary key. Entity beans are normally coarse-grained persistent objects, in that they utilize persistent data stored within several fine-grained persistent Java objects.
Message Driven Beans • What Is a Message-Driven Bean? • A message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. This type of bean normally acts as a JMS message listener, which is similar to an event listener but receives JMS messages instead of events. The messages can be sent by any Java EE component (an application client, another enterprise bean, or a web component) or by a JMS application or system that does not use Java EE technology. Message-driven beans can process JMS messages or other kinds of messages.
When to Use Message-Driven Beans ? • Session beans allow you to send JMS messages and to receive them synchronously but not asynchronously. To avoid tying up server resources, do not to use blocking synchronous receives in a server-side component; in general, JMS messages should not be sent or received synchronously. To receive messages asynchronously, use a message-driven bean
Java Mail • The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API provides a set of abstract classes defining objects that comprise a mail system. It is an optional package (standard extension) for reading, composing, and sending electronic messages.
Thank u For Reading