J2EE Connector Architecture
J2EE Connector Architecture
(unofficially abbreviated as JCA or J2C) is a spec from Sun for J2EE that enables programs running in the J2EE environment to connect to external resources.
There are actually three ways in Java EE to connect to external resources:
- JDBC – For connecting to (relational) databases
- JMS – For connecting to messaging systems
- J2EE Connector Architecture – For connecting to everything else
J2C 1.0 connectors were one-way: The Java app could initiate a call via the connector to the resource, but the resource could not initiate a call to the Java app.
J2C 1.5 connectors are two-way: A Java app can call the resource like before, but also the connector can detect an event in the resource and react by initiating a call to the Java app.
Whereas message-driven beans (MDBs) in EJB 2.0 were for JMS messages only, they were expanded in EJB 2.1 to handle a J2C event coming from the connector's resource. Thus there became two types of MDBs, JMS MDBs which connected to JMS providers and received JMS messages, an more general MDBs which connected to non-JMS resources via J2C connectors.
JMS 1.0 did not specify how the app server should connect a pool of MDBs to a JMS destination, so each vendor implemented its own proprietary approach. JMS 1.1 specified that an MDB class/pool should be connected to a JMS destination via an activation spec, a description of a connection that would be instantiated using a J2C 1.5 connector.
Thus J2C 1.5, EJB 2.1 MDBs, and JMS 1.1 all go together.