File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes web services, EIS and state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "web services, EIS and state" Watch "web services, EIS and state" New topic
Author

web services, EIS and state

grigoris philippoussis
Greenhorn

Joined: Oct 22, 2007
Posts: 16
Hi

I want to wrap an EIS (C++ app) and make it available to J2EE componenets.

The service needs to accept calls to init(), start(), stop(), doStuff() etc - so it needs to maintain state. Ideally, it would sit in the background runnning, waiting for requests.

Would it be correct to wrap it in a web-service? Or should I be looking at using a resource adapter?

Thanks,
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Gregory,

Please check your private messages.


"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Would it be correct to wrap it in a web-service?


Web services are supposed to be stateless - maintaining any kind of state adversely affects scalability of the service. That doesn't mean that you cannot interact with long-running transactions through web services. It simply means that the state is stored somewhere else (like a database) other than the service. To identify which "state" the service is operating on, you have to include a correlation identifier in every message that follows the initial request that initiates the "conversation".

Given what you have outlined I think that the resource connector is the better solution in your case. It should give better performance than a web service and you can always expose the functionality supported by the connector through a web service hosted within the application server. However the connector needs to be designed carefully. If state is stored within the connector then you need server affinity support because all the request of the same "conversation" (with the same correlation identifier) need to be routed to the same server within a cluster. If you can store the state on the EIS any connector instance on any server will do.
grigoris philippoussis
Greenhorn

Joined: Oct 22, 2007
Posts: 16
thanks.
Do you know of any good RA resources on the net?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
There are some in this topic.
A search on the EJB and Other Java EE Technologies forum may turn up more.
This article Choosing among JCA, JMS, and Web services for EAI might also be of interest.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web services, EIS and state
 
Similar Threads
Data tier or EIS
Clarifications for Architect Part II Exam
Right tier of the EJB implementing an exposed web service
JCA Adapter Development - Inbound Message
deploying a core java application