ibm.com/developerWorks
Presented by developerWorks, your source for great tutorials
Apache.org
.
If you do not have an IDE, please download and install Eclipse from the
Eclipse project
site
.
Create a simple EJB component
Start your project by creating a directory on your hard drive called
C:\tutorials\axisEJB\axisEJBHello
.
In
axisEJBHello
, create a subdirectory called
src
. In the
src
directory create another
subdirectory structure to hold the package structure
rickhightower.axis.ejb.tutorial
.
This EJB component is going to need an implementation, a remote interface, a home
interface, and a deployment descriptor.
In the directory
C:\tutorials\axisEJB\axisEJBHello\src\rickhightower\axis\ejb\tutorial
,
create an EJB Implementation class (
HelloService.java
) as follows:
/*
*/
package rickhightower.axis.ejb.tutorial;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
/**
* HelloService session bean.
* @ejb.bean name="Hello" type="Stateless"
*
local jndi name="Hello"
*/
public class HelloService implements SessionBean {
/**
* This method is part of the ejb interface.
* @ejb.interface method view type="both"
* @ejb.transaction type="Required"
*/
public String[] getGreetings() {
return new String[]{
"Hello cruel world!",
"Hello mom",
"Hello all"
};
}
Page 6 of 33
Service enable EJB SessionBeans with the IBM ETTK






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

servlet web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Jsp Web Hosting Cheapest Web Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved