View RSS Feed

EJB

Enterprise Java Beans (EJB) tutorials. Focusing on EJB 3.0 (EJB3) and above.

  1. Business Methods

    by
    EJB
    , 01-02-2012 at 06:06 PM
    Business method or business process is the collection of structured and related tasks which create a certain product for specified customers. Let us now code the business methods for addition/deletion and also for the retrieval of the Book Entity Beans objects.

    Java Code: This is an example of business methods
    import java.util.Collection; 
    import javax.ejb.Stateless; 
    import javax.persistence.EntityManager; 
    import javax.persistence.PersistenceContext; 
    import com.visualbuilder.entity.Book;
    ...

    Updated 01-14-2012 at 06:17 PM by EJB

    Categories
    Tutorial
  2. The lifecycle of stateless bean

    by
    EJB
    , 01-02-2012 at 06:03 PM
    Stateless session bean’s life cycle consists of 2 stages namely; ready for the invocation of the business method and non existent. Client initiates the life cycle by seeking references towards the stateless bean. Dependency injection is performed by the container and then the method annotated @PostConstruct is invoked. Now bean is ready to invoke the business methods by client. Method annotated @PreDestroy is called by the EJB container at the end of life cycle, if any. Then for garbage collection, ...
    Categories
    EJB Bean
  3. Interface and bean-class

    by
    EJB
    , 01-02-2012 at 06:02 PM
    Home interfaces and remote interfaces present the bean however beans are insulated by the container and client application’s direct access. Whenever a bean is deleted, created or requested the whole process is managed by the container.

    Component’s life cycle methods are presented by the home interfaces however bean’s business method is presented by the remote interfaces. Home & remote interfaces extends the javax.ejb.EJBHome interface and javax.ejb.EJBObject interface. Such types ...
    Categories
    Session Bean
  4. When to use Session Beans

    by
    EJB
    , 01-02-2012 at 05:57 PM
    Just one client can access the bean instance at any given time. There exists no persistency in case of state of the bean. They just exist for shorter time duration.

    State full session beans are suitable whenever:

    • The state of bean presents the interaction b/w a specific client and the bean.
    • The bean requires retention of certain information regarding the client, across method invocations.
    • There occurs the mediation b/w other application components and client
    ...
    Tags: session bean Add / Edit Tags
    Categories
    Session Bean , EJB Bean
  5. Stateless Session Bean

    by
    EJB
    , 01-02-2012 at 05:55 PM
    A stateless session (EJB Component) is an enterprise bean which gives its users a stateless service. Interface javax.ejb.SessionBean is implemented by the stateless session bean (EJB Component) and deploys to the “stateless” declarative attribute. They are known as “stateless” as conversational states are not maintained by them that are specific to the client’s session. Stateless session beans are same as the static methods or procedural applications; no instance state is present therefore to execute ...

    Updated 01-14-2012 at 06:14 PM by EJB

    Categories
    Session Bean , EJB Bean
  6. Stateful Session Bean

    by
    EJB
    , 01-02-2012 at 05:52 PM
    A stateful session bean is an enterprise bean (EJB component) that serves to be a client’s server side extension. It is created by one client and hence it works for just that client till the drop takes place in client connection or removal of the bean takes place explicitly. The stateful Bean (EJB Component) implements the interface javax.ejb.SessionBean and deploys to the “stateful” which is the declarative attribute. They are called stateful as conversational state is being maintained by them ...

    Updated 01-14-2012 at 06:12 PM by EJB

    Categories
    Session Bean
  7. What is a Session Bean?

    by
    EJB
    , 01-02-2012 at 05:49 PM
    Inside J2EE server, single client is presented in a session bean. It is considered as a non persistent object which makes the implementation of other business logics that run at server. Session beans are not able to survive the shut down of the system.

    Two types of session beans are there:

    • Stateless session beans (By multiple EJB clients, each session bean could be reused)
    • Stateful session beans (every session bean is linked to just one EJB client)
    Tags: session bean Add / Edit Tags
    Categories
    Session Bean
  8. EJB Container

    by
    EJB
    , 01-02-2012 at 05:48 PM
    The EJB container is an interface b/w enterprise bean which provides the business logic in the Java EE server or a Java EE application. EJB container is run at the Java EE server & it manages the application's enterprise beans execution.

    Name:  26.JPG
Views: 452
Size:  23.8 KB

    EJB Container
    Categories
    EJB Container
  9. When to use / When not EJB

    by
    EJB
    , 01-02-2012 at 05:45 PM
    When to Use EJB
    • Distributed transactions are needed.
    • Component security needed.
    • Persistence needed.
    • Integration along with the legacy applications are needed.
    • Scalability is needed.


    When not use EJB
    • When one doesn’t require application integration, transactions or other infrastructure like facilities in their application.
    Categories
    Tutorial
  10. Advantages/Disadvantages of EJB

    by
    EJB
    , 01-02-2012 at 05:43 PM
    EJB Advantages
    • To access EJB free security is provided.
    • Declarative transactions are provided.
    • EJBs are cached & pooled. Containers manage the EJB life cycles.
    • Remote access capabilities are present & are clustered for sake of scalability.
    • OO concepts are supported for example inheritance.
    • Usage of attributes or annotation based programming is possible.
    • Free usage & access of complex resources


    EJB Disadvantages
    • Complicated and large specification
    • Increased
    ...
  11. EJB Architecture

    by
    EJB
    , 01-01-2012 at 08:57 PM
    Architecture of EJB is given below. 3 kinds of interfaces are exposed by the help of EJB which are as following:
    1. Home interface
    2. Remote interface
    3. JMS Message Listener Interface

    Name:  25.JPG
Views: 1917
Size:  36.1 KB

    EJB Architecture
    Categories
    Tutorial
  12. What is EJB?

    by
    EJB
    , 01-01-2012 at 08:54 PM
    EJB is multi tier system that is distributed & remote. It supports the protocols for example, HTTP, IIOP and JRMP etc. Rapid development of the versatile, reusable and portable business components takes place across the scalable, middle ware and transactional applications. For J2EE servers, EJB is considered as a specification. System level programming and business logic are present in EJB components for example security, threading, transactions, instance pooling, persistence etc which are managed ...

    Updated 01-15-2012 at 07:50 AM by EJB

    Categories
    Tutorial
  13. EJB Architecture

    by
    EJB
    , 01-01-2012 at 08:53 PM
    EJB is multi tier system that is distributed & remote. It supports the protocols for example, HTTP, IIOP and JRMP etc. Rapid development of the versatile, reusable and portable business components takes place across the scalable, middle ware and transactional applications. For J2EE servers, EJB is considered as a specification. System level programming and business logic are present in EJB components for example security, threading, transactions, instance pooling, persistence etc which are managed ...