Adding Business Methods to an EJB in NetBeans

3 April 2007

Every EJB has some business methods that can be called after looking up the EJB by it’s JNDI name. To call a business method it should be declared in Remote Interface and the related EJB should have it’s definition. Manually adding a method to a EJB is not an easy task for a J2EE programmer. NetBeans provides an easy way for adding a business method to EJB so that it will be added to Remote Interface and EJB automatically. After adding business method you just have to write business logic in EJB class. Other configuration task will be handled by NetBeans.

Here are the steps to be followed.

  1. Assume you have a session bean named JavaTipsSessionBean already created in IDE. Right click on related EJB module and select “Business Method” option.
  2. ScreenHunter 007

    You will see the following screen.

  3. Now add method name, parameters etc. Click “OK”. Code will be added to bean and to the Remote Interface.
  4. ScreenHunter 008

  5. Now cursor will be automatically prompted to the business method in bean class, so that you can write your logic there.
  6. ScreenHunter 009

When this EJB will be deployed. Any remote client will be able to call this method.

del.icio.us:Adding Business Methods to an EJB in NetBeans digg:Adding Business Methods to an EJB in NetBeans spurl:Adding Business Methods to an EJB in NetBeans wists:Adding Business Methods to an EJB in NetBeans simpy:Adding Business Methods to an EJB in NetBeans newsvine:Adding Business Methods to an EJB in NetBeans blinklist:Adding Business Methods to an EJB in NetBeans furl:Adding Business Methods to an EJB in NetBeans reddit:Adding Business Methods to an EJB in NetBeans fark:Adding Business Methods to an EJB in NetBeans blogmarks:Adding Business Methods to an EJB in NetBeans Y!:Adding Business Methods to an EJB in NetBeans smarking:Adding Business Methods to an EJB in NetBeans magnolia:Adding Business Methods to an EJB in NetBeans segnalo:Adding Business Methods to an EJB in NetBeans gifttagging:Adding Business Methods to an EJB in NetBeans

Top Of Page | Trackback

If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.

It will look like this: Adding Business Methods to an EJB in NetBeans

Leave a Reply