Enterprise Integration Zone is brought to you in partnership with:

Ouertani Slim was born in Tunisia in 1981. Now he is a software engineer since 2004 and he is Java 6 and Spring certified with 100% and 94% respectively. He is very interested in Java technology, Scala and open source projects. He believes that programming is one of the hardest jobs and most beautiful in the world. Slim has posted 32 posts at DZone. You can read more from them at their website. View Full User Profile

XML/RPC driver as JCA Scala connector

  • submit to reddit

Interoperability and reusability are key features of SOA architecture.  

The Java EE Connector architecture defines a standard architecture for connecting the Java EE platform to heterogeneous EISs. This article presents an XML/RPC  adapter using a Scala JCA outbound connector to an IN/AIR legacy system.

JCA and integration

"For enterprise application integration, bi-directional connectivity between enterprise applications and EIS is essential. The Java EE Connector architecture defines standard contracts that allow bi-directional connectivity between enterprise applications and EISs. It also formalizes the relationships, interactions, and the packaging of the integration layer, thus enabling enterprise application integration." 
JCA 1.6 p 35

The connector architecture defines a set of scalable, secure, and transactional mechanisms that enable the integration of EISs with application servers and enterprise application.

 ESB and JCA
Using a UCIP JCA connector rather than using an XML/RPC raw driver lets you:

  1. Hide connection complexity.
  2. Use connection pooling and scalability.
  3. Use a standard adapter that can be deployed with any JEE 6 server from an m x n integration problem to an m + n solution


The use of a JCA resource adapter inside a JEE solution is the same as interacting with a database or queue: protocol communication and wire negotiation... are hidden to the final user.  

Two interfaces are presented to a customer:

1) A factory trait:

trait AirConnectorFactory extends Referenceable with Function0[AirConnector] 
2) The connector trait:
trait AirConnector {
   def fire(elem : Elem) : Option[Elem]
As an outbound communication where the resource adapter allows an ESB or EE application server to connect to an IN/AIR node and perform work. All communication is initiated by the application. The Air connector factory should be injected as any resource and used like the following.
var airConnectorFactory : AirConnectorFactory = _

val output = airConnectorFactory().fire(input)
Published at DZone with permission of its author, Slim Ouertani.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)