Using JBoss EJB 3 with Eclipse RCP [Part 2]

The Demo-EJB

As a simple example EJB, which will be used in our RCP, we will use a small EJB 3.0 stateless session bean. It's a typical "Hello World" bean:

MyTestStatelessSessionRemote.java

JAVA:
  1. package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
  2.  
  3. import javax.ejb.Remote;
  4.  
  5. public interface MyTestStatelessSessionRemote {
  6.  
  7. public String sayHello();
  8.  
  9. }

MyTestStatelessSessionBean.java

JAVA:
  1. package bz.jmc.blog.tutorial.rcp_with_jboss.ejb;
  2.  
  3. import javax.ejb.Stateless;
  4.  
  5. @Stateless
  6. public class MyTestStatelessSessionBean implements MyTestStatelessSessionRemote {
  7.  
  8. public String sayHello() {
  9. return "Hello World! I'm an Stateless-Session-Bean";
  10. }
  11.  
  12. }

This Bean will be packaged in a JAR-file called MyTestStatelessSession.jar and needs to be deployed to JBoss. After deployment JBoss should echo something like this:

CODE:
  1. 11:31:25,651 INFO  [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 1m:21s:287ms
  2. 11:39:01,958 INFO  [Ejb3Deployment] EJB3 deployment time took: 88
  3. 11:39:02,027 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=MyTestStatelessSession.jar, name=MyTestStatelessSessionBean, service=EJB3 with dependencies:
  4. 11:39:03,276 INFO  [EJBContainer] STARTED EJB: bz.jmc.blog.tutorial.rcp_with_jboss.ejb.MyTestStatelessSessionBean ejbName: MyTestStatelessSessionBean
  5. 11:39:03,697 INFO  [EJB3Deployer] Deployed: file:/Users/jmc/Applications/jboss-4.0.4.GA/server/default/deploy/MyTestStatelessSession.jar

In the next part I'll show you how to create our simple RCP application.

Ein Kommentar


  • tiffany

    The demo was really good…

    29. Juli 2009

Hinterlasse einen Kommentar


Name*

Email (wird nicht veröffentlicht)*

Website

Dein Kommentar*

Kommentar absenden

© Copyright JMCblog - Designed by Pexeto