The EJB connector was implemented using Java and consumes EJB business logic for Weblogic and Jboss/Wildfly servers.
The connector exposes the following operations:
EJB 2 Request : EJB2 Business logic implementation.
EJB 3 Request : EJB3 Business logic implementation.
Application/Service | Version |
Mule Runtime | 4.X |
Java | 1.8 and later |
This document assumes that you are familiar with Mule, Anypoint Connectors, Anypoint Studio, Mule concepts, elements in a Mule flow and Global Elements.
For hardware and software requirements and compatibility information, see the Connector Release Notes.
To use this connector with Maven, view the pom.xml dependency information in the Dependency Snippets in Anypoint Exchange.
The connector is equipped with three major configurations.
To configure the ejb connector to Weblogic server the following server properties are required:
Host and port settings
Initial context factory
User Name: The username for admin server
Password: The password for admin server
Weblogic driver
Ejb server jar that contains the business logic
<EjbPrefix:config name="Ejb_Config" doc:name="Ejb Config" doc:id="799e7cea-739e-475d-8660-a6703804e250" > <EjbPrefix:web-logic-alias-connection userName="admin" password="admin@123" host="localhost" port="8080"/> </EjbPrefix:config> |
To configure the ejb connector to Jboss/Wildfly server the following server properties are required:
Host and port settings
Initial context factory
Package Prefixes
Security Principal: The security Principal for admin server
Security Credentials: The security credentials for admin server
Security Protocol: The security protocol for admin server
Jboss/Wildfly driver
Ejb server jar that contains the business logic
<EjbPrefix:config name="Ejb_Config_Jboss" doc:name="Ejb Config" doc:id="c35eb389-648a-4634-9044-931ca7cf2732" > <EjbPrefix:j-boss-alias-connection packagePrefixes="org.jboss.ejb.client.naming" keyStoreFile="C:/Users/tanni/OneDrive/Documents/keystore-truststore/client.keystore" trustStoreFile="C:/Users/tanni/OneDrive/Documents/keystore-truststore/client.truststore" trustStorePassword="abcdef" keyStorePassword="abcdef" username="admin" password="admin@123" protocol="JAAS" host="localhost" port="8080" principal="admin" credentials="admin@123"/> </EjbPrefix:config> |
To configure Jboss/Wildfly server or Weblogic server over SSL the following server properties are required. Here Keystore & Truststore is a file location which can be either absolute path or relative path starting from the resource folder. These properties can be configurable in the advanced tab:
Keystore
Truststore
Truststore password
Keystore password
<EjbPrefix:config name="Ejb_Config" doc:name="Ejb Config" doc:id="799e7cea-739e-475d-8660-a6703804e250" > <EjbPrefix:web-logic-alias-connection userName="admin" password="admin@123" host="localhost" port="8080" keyStoreFile="./client.keystore" trustStoreFile="./client.truststore" trustStorePassword="abcdef" keyStorePassword="abcdef"/> </EjbPrefix:config> |
For all the operations most of the parameters are found in the General tab.
(a) EJB2 Request:
To configure the ejb connector the following server properties are required:
Home Interface: home interfaces are used to specify what methods a client uses to create or retrieve an entity bean instance. The remote home interface extends javax.ejb.EJBHome
Session create method: A remote client invokes the EJB through its remote interface. The client invokes the create
method that is declared within the remote home interface. The container passes the client call to the ejbCreate
method–with the appropriate parameter signature–within the bean implementation.
Remote Interface Name: Clients not located in the same application server instance as the bean are the remote clients who uses the remote interface to access the bean. Calls to the remote interface require marshalling arguments, transportation of the marshalled data over the network, un-marshaling the arguments, and dispatch at the receiving end.
Method Name : Name of the method present in remote interface and is mentioned along with the dataTypes.
JNDI Name : The EJB is deployed and registered with a default jndi name based on the deployment ear file and ejb jar file names and class name.
Arguments: Values to be passed to the selected method. Any DataTypes can be passed.
<EjbPrefix:ejb2 sessionCreateMethod="create" doc:name="Ejb 2" doc:id="7de1df3f-6527-40b0-a253-1d09d2d7fec1" config-ref="Ejb_Config" homeInterface="com.infoTech.Bean.BankingServiceHome" remoteInterface="com.infoTech.Bean.BankingService" lookupBean='com.infoTech.Bean.BankingServiceEJB' methodName="stringIntBoolean (String arg0, int arg1, Boolean arg2)"><EjbPrefix:arguments ><![CDATA[#[{user: "abc",password: 123,istrue: true}]]]></EjbPrefix:arguments></EjbPrefix:ejb2> |
(b) EJB3 Request:
To configure the ejb connector the following server properties are required:
Lookup Bean: You can directly look up a bean instance from JNDI and retrieve a bean instance. In the case of remote access, the actual location of a referenced enterprise bean and EJB container are, in general, transparent to the client using the remote business interface of the bean.
Method Name : Name of the method present in remote interface and is mentioned along with the dataTypes.
Arguments: Values to be passed to the selected method. Any DataTypes can be passed.
<EjbPrefix:ejb3 doc:name="Ejb 3" doc:id="931a7944-8236-4dbe-9229-8664a2944ea0" config-ref="Ejb_Config" lookupBean="BankingServiceBean#com.ibytecode.business.BankingService" methodName="stringIntBoolean (String arg0, int arg1, Boolean arg2)"> <EjbPrefix:arguments ><![CDATA[#[{user: "abc", password: 123, istrue: true}]]]></EjbPrefix:arguments> </EjbPrefix:ejb3> |