Sunday 25 October 2015

OCEJBCD - 2- Implementing Session Beans

OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification

2.1. Examine session Beans

session bean encapsulates business logic that can be invoked programmatically by a client over local, remote, or web service client views. 

What is a session bean?

2.2. Identify the three types of session beans
  • Stateless
    • they can support multiple clients
    • does not mantain conversational state with the client.
  • Stateful
    • Mantains conversational state with the client.
    • Relationship 1:1 with client.
  • Singleton 
    • new in javaEE6
    • is instantiated once per application and exists for the lifecycle of the application (one per application).
    • A single enterprise bean needs to be accessed by multiple threads concurrently

2.3. Choose the correct session bean type given a business constraint

  • Session stateless - to implement a web service. Transaction-processing applications, which are executed using a procedure call.
  • Session stateful - GUI client (filling fields in a GUI needs conversational state)
  • Singleton- to implement web service endpoints

2.4. Create session beans package and deploy session beans
The javabeans configuration can be defined with annotations or using an xml deployment descriptor located in :
META-INF/ejb-jar.xml

OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification

Saturday 17 October 2015

OCEJBCD - 1- Introduction to JavaEE

OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification

1.1. Gain an understanding of the Java Platform, Enterprise Edition(JavaEE)


An enterprise application provides business logic modules. It uses architectures of distributed layers and it is executed by an applications server.

The features of JavaEE in every version are defined by several specifications (JSR- Java specification request). 

1.2. Examine the JavaEE application architecture

Summary of JavaEE6 APIs:
    • EJB : Enterprise Java Beans Technology
    • Servlets
    • JSF : Java server faces
    • JSP : Java server pages
    • JSP Tag libraries
    • JPA: Java Persistence API
    • JTA: Java Transaction API
    • JAX-RS Java API for RESTful Web Services
    • Managed Beans
    • CDI JSR 299- Contexts and dependency injection for JavaEE
    • JSR 330- Dependency Injection for Java
    • Bean Validation
    • JMS : Java Message API
    • JavaEE Connector Architecture
    • Java Mail API
    • Java Authorization Contract for Containers
    • JASPIC Java Authentication Service Provider for Containers

1.3. Examine JavaEE container services

Types of containers in JavaEE:

  • Client side
    • Application Web Container
    • Applet Container
  • Server side (JavaEE Container)
    • Web Container
    • EJB Container

Popular web containers: Apache Tomcat, Jetty,..
Popular full JavaEE Containers: Jboss(WildFly), Weblogic, Glassfish, ...

Services provided by a full JavaEE container:


  • Security
  • Transaction management
  • JNDI (Java naming directory interface)
  • Java EE remote connectivity (RMI)
  • Manage servlet and bean lifecycle
  • Database connection and persistence
  • Access to JavaEE APIs.

1.4. Examine the EJB component types
  • Enterprise bean class
    • Session bean -- associated with a client. They can be stateless or stateful.
    • Message-driven bean - allows to receive messages asynchronously (JMS)
  • Business interfaces
  • Helper classes (utilities, exceptions..)

1.5. Evaluate the EJB Lite Container

A lightweight subset of Enterprise JavaBeans(EJB 3.1) functionality.
http://www.oracle.com/technetwork/articles/javaee/javaee6overview-part3-139660.html#ejblite
Features included in EJB lite:
  • Stateless, stateful, and singleton session beans
  • Local EJB interfaces or no interfaces
  • Interceptors
  • Container-managed and bean-managed transactions
  • Declarative and programmatic security
  • Embeddable API
OCEJBCD (SCBCD) - 1Z0-895 - Enterprise JavaBeans Developer Certification