In the first part I showed how to install Livecycle Data Services under JBoss and how to set up the enviroment to start developing an EJB3 application with Flex 2 (you can read the full article here : How to install and develop using Flex 2 (FDS) and EJB3 projects - Part 1).
In this second part we create a Java project to develop our Enterprise Java Beans.
I'm using JBoss application server with the Livecycle Data Services 2.5 downloaded from the Adobe Labs.
Before coding we need to install some libraries on the JBoss side. So create a lib folder under the project's folder EJB3_LCDS. We'll have this fodler structure :
EJB3_LCDS/lib
Copy and paste the following libraries from the JBOSS_HOME/client to EJB3_LCDS/lib :
jboss-aop-jdk50-client.jar
jboss-aspect-jdk-client.jar
jboss-ejb3x.jar
jboss-ejb3-client.jar
jbossws-client.jar
jbossall-client.jar
jbossjmx-ant.jar
log4j.jar
Now we can set the Build Path from the Project Properties of our Eclipse IDE. Select the EJB3_LCDS project and right click the mouse. From the contextual menu choose Build Path>Add to Buid Path.
We're ready to code our classes.
Create the Stateless Session Bean that represents the easiest EJB you can develop. It's a bean that gives you the information about the bean component the life cycle of which is related to the life of the client.
One of the new features of EJB3 is that it's enough to create an interface with the methods and a class that represents our bean.
No more several classes and configuration files to create like in the past verison of EJB.
My package is com.ejb3lcds.business so we create our Interface in com.ejb3lcds.business.IService
/**
* Interface
*/
package com.ejb3lcds.business.IService;
import javax.ejb.Local;
import javax.ejb.Remote;
@Local
@Remote
public interface IService {
/**
* Method that returns just
* @param pA
* @param pB
* @return the result of the operations
*/
int multiply(int pA, int pB);
}
Now you have to be patience because I have to go working so I must stop.
In the next post I'll create the service bean class.