পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Monday, January 16, 2017

EJB - Annotations

Annotations were introduced in Java 5.0. Purpose of annotation is to attach additional information in the class or a meta-data of a class within its source code. In EJB 3.0, annotations are used to describe configuration meta-data in ejb classes. By this way EJB 3.0 eliminates the need to describe configuration data in configuration XML files.

EJB container uses compiler tool to generate required artifacts like interfaces, deployment descriptors by reading those annotations. Following is the list of commonly used annotations.
Sr. No.NameDescription
1javax.ejb.StatelessSpecifies that a given ejb class is a stateless session bean.
Attributes
  • name - Used to specify name of the session bean.
  • mappedName - Used to specify the JNDI name of the session bean.
  • description - Used to provide description of the session bean.
2javax.ejb.StatefulSpecifies that a given ejb class is a stateful session bean.
Attributes
  • name - Used to specify name of the session bean.
  • mappedName - Used to specify the JNDI name of the session bean.
  • description - Used to provide description of the session bean.
3javax.ejb.MessageDrivenBeanSpecifies that a given ejb class is a message driven bean.
Attributes
  • name - Used to specify name of the message driven bean.
  • messageListenerInterface - Used to specify message listener interface for the message driven bean.
  • activationConfig - Used to specify the configuration details of the message-driven bean in operational environment of the message driven bean.
  • mappedName - Used to specify the JNDI name of the session bean.
  • description - Used to provide description of the session bean.
4javax.ejb.EJBUsed to specify or inject a dependency as ejb instance into another ejb.
Attributes
  • name - Used to specify name which will be used to locate the referenced bean in environment.
  • beanInterface - Used to specify the interface type of the referenced bean.
  • beanName - Used to provide name of the referenced bean.
  • mappedName - Used to specify the JNDI name of the referenced bean.
  • description - Used to provide description of the referenced bean.
5javax.ejb.LocalUsed to specify Local interface(s) of a session bean. This local interface states the business methods of the session bean (which can be stateless or stateful).
This interface is used to expose the business methods to local clients which are running in same deployment/application as EJB.
Attributes
  • value - Used to specify the list of local interfaces as an array of interfaces.
6javax.ejb.RemoteUsed to specify Remote interface(s) of a session bean. This remote interface states the business methods of the session bean (which can be stateless or stateful).
This interface is used to expose the business methods to remote clients which are running in different deployment/application as EJB.
Attributes
  • value - Used to specify the list of remote interfaces as an array of interfaces.
7javax.ejb.ActivationConfigProperty Used to specify properties required for a message driven bean. For example end point, destination, message selector etc.
This annotation is passed as a parameter to activationConfig attribute of javax.ejb.MessageDrivenBean annotation.
Attributes
  • propertyName - name of the property.
  • propertyValue - value of the property.
8javax.ejb.PostActivate Used to specify callback method of ejb lifecycle. This method will be called when EJB container just activated/reactivated the bean instance.
This interface is used to expose the business methods to local clients which are running in same deployment/application as EJB

No comments:

Post a Comment