1 / 20

EJB (Enterprise Java Beans)

EJB (Enterprise Java Beans). Agenda. What is an EJB ? EJB Component. EJB Benefit EJB Security Java Beans v/s EJB Some EJB Server References. What is an EJB ?. Development and deployment of Java applications that are: Portable, Multi-tier, Scaleable, Secure, Distributed, Transactional

meg
Download Presentation

EJB (Enterprise Java Beans)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EJB(Enterprise Java Beans)

  2. Agenda • What is an EJB ? • EJB Component. • EJB Benefit • EJB Security • Java Beans v/s EJB • Some EJB Server • References

  3. What is an EJB ? • Development and deployment of Java applications that are: • Portable, Multi-tier, Scaleable, Secure, Distributed, Transactional • Server-side component encapsulating application functionality • Business logic • DB access • Integrate with other legacy systems • Serve multiple clients • Browser • Desktop apps • Other EJBs • Web app components (e.g., Servlets) • Web Service clients

  4. What is an EJB ? • EJB container provides services to bean and manages its life cycle. • A component architecture • A component model • For developing object-oriented • distributed enterprise-level applications

  5. EJB Component

  6. EJB Session Beans • Session beans perform work for a client application • For example, a session bean could charge a credit card for a specific transaction • Two types of session beans • Stateful • Stateless

  7. Session Beans - Stateful • Stateful – A stateful bean maintains a conversational state with a client. The client perceives that it is only talking to one bean, and that bean maintains information between calls

  8. Session Beans - Stateless • Stateless – A stateless bean maintains no client information between method calls – the container can substitute beans as necessary between method calls

  9. Stateless vs. Stateful • Stateful • Possess internal state • Needs to handle passivation and activation • One per client • Stateless • No internal state, nothing maintained across client calls • Does not need to be passivated • Can be pooled to service multiple

  10. EJB - Entity Beans • Entity beans are classes that map to individual entities – typically, an Entity bean references a row in a database table, providing an object representation of that database object. • For example, an entity bean could represent a customer, and changing the values in that entity bean would cause updates to that database row • Entity beans provide an abstraction layer so that working with the entity is not specific to the storage mechanism for that entity.

  11. Entity Beans - Persistence • Container Managed Persistence (CMP) • The EJB container automatically persists the EJB objects, usually to a relational database where each type of object is represented as a table, and each instance of the object is a row in that table • Bean Managed Persistence (BMP) • The EJB container calls bean methods when it is appropriate for the bean to load, save or update data, enforcing transactions without transaction code written by the bean developer

  12. EJB – Message Beans • Message beans are classes that receive asynchronous notification from a Java Message Service server • For example, a message bean could be activated when vendor sends a purchase order to a JMS queue.

  13. EJB - Benefits • Provides a high-level language to discuss design issues. • Provides much of the design. • Combinations of patterns form reusable architectures. • Simplifies the development of middleware components that are secure, transactional, scalable & portable. • Simplifies the process to focus mainly on business logic rather than application development. • Overall increase in developer productivity • Reduces the time to market for mission critical applications

  14. EJB - Sequrity • Two security measures that client must pass when you add security to EJB system – Authentication and Authorization. • Authentication must be performed before any EJB method is called. • Authorization occurs at the beginning of each EJB method call.

  15. Authentication in EJB • Two ways to perform authentication in EJB: • We can call authentication logic through Java Authentication and Authorization Service (JAAS), a separate J2EE API. • JAAS is a portable interface that enables you to authenticate and authorize users in Java. It allows to login to the system without knowing about the underlying security system being used.

  16. Authorization in EJB • Two ways to perform authorization in EJB: • With programmatic authorization, we can hard code security checks into our bean code. • With declarative authorization, the container performs all authorization checks for us.

  17. Java Beans vs. EJB • Can be either visible non-visible. • Local Invocation • Synchronous Invocation • Decidedly non-visible remote objects • Remote and Local Invocation • Synchronous and Asynchronous Invocation • Object Pooling • Transparent Persistence • Supports Transactions • Support Relationships between entity EJBs • J2EE Security Features

  18. Some EJB Server CompanyProduct • IBM WebSphere • BEA Systems BEA WebLogic • Sun Microsystems Sun Application Server • Oracle Oracle Application Server • JBoss JBoss

  19. References • J2EE Tutorial - http://java.sun.com/j2ee/tutorial/1_3-fcs • J2EE Developers Guide - http://java.sun.com/j2ee/sdk_1.2.1/techdocs/guides/ejb/html/DevGuideTOC.html • JNDI - http://java.sun.com/products/jndi/tutorial/ • JMS - http://java.sun.com/products/jms/tutorial/ • JDBC - http://java.sun.com/docs/books/tutorial/jdbc • Servlets - http://java.sun.com/docs/books/tutorial/servlets • JSP - http://java.sun.com/products/jsp/docs.html • JAXP - http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial • http://www.oracle.com/technology/tech/java/index.html

  20. Thank you

More Related