2. The problem
My company decided to migrate to EJB an old legacy
asynchronous application. The requirements are:
● Re – use legacy code from the application
● Define EJB3 design that :
● Employ Jboss Web Service calls to order requests and
monitor their status
● Employ a JMS Queue that will handle and process
requests on a strict order
● Employ a Jboss service to receive a callback from the
JMS queue when processing is finished.
Unified IT Services http:www.uit.gr
3. Comply with EJB3.0 standards
● Use J2EE annotations instead of XML
deployment descriptors
● Do not use threads
● Do not use I/O
● Benefit from EJB3.0 offered Jboss resources,
like Pojo Services, JMX platform....
Unified IT Services http:www.uit.gr
4. Design Synopsis
● Design a Web Service to offer clients the ability to:
to create requests and monitor request status
● Design a Jboss JMS Queue that will process WS
calls and handle the processing status. Processing
is taking place in strict order.
● Design a Web Service that will be called from the
JMS queue when request processing is finished.
Unified IT Services http:www.uit.gr
5. Interfaces – Requests Web Service
Clients can order jobs and monitor their request
@Remote
public interface RequestProxyRemote {
int processAsynch(String inData);
String processStatus(int jobId);
}
Unified IT Services http:www.uit.gr
6. Interfaces – Results Web Service
This Web Service is called when the JMS queue
finishes with a request. This web service has remote
interface:
@Local
public interface ResultsProxyRemote {
void processResults(int jobId, String results);
}
Unified IT Services http:www.uit.gr
12. QUEUE Deployment Descriptor for
JBOSS
File: queue-example-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<server>
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=tutorial">
<attribute
name="JNDIName">queue/tutorial/example</attribute>
<depends optional-attribute-
name="DestinationManager">jboss.mq:service=DestinationManager</d
epends>
</mbean>
</server>
This must be deployed once to the JBOSS deployment directory
Unified IT Services http:www.uit.gr