Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Current »

Overview

The EJB connector was implemented using Java and consumes EJB business logic for Weblogic and Jboss/Wildfly servers.

The connector exposes the following operations:

Business Logic

  • EJB 2  Request : EJB2  Business logic implementation

  • EJB 3 Request : EJB3 Business logic implementation

Prerequisites


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.

Configuration

The connector is equipped with three major configurations.

(a) Weblogic Server

To configure the ejb connector to Weblogic server the following server properties are required:

  1. Host and port settings

  2. Initial context factory

  3. User Name: The username for admin server

  4. Password:  The password for admin server

  5. Weblogic driver

  6. 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>

(b) Jboss/Wildfly Server

To configure the ejb connector to Jboss/Wildfly server the following server properties are required:

  1. Host and port settings

  2. Initial context factory

  3. Package Prefixes

  4. Security Principal: The security Principal for admin server

  5. Security Credentials:  The security credentials for admin server

  6. Security Protocol: The security protocol for admin server

  7. Jboss/Wildfly driver

  8. 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>

(c) SSL connection

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:

  1. Keystore

  2. Truststore

  3. Truststore password

  4. 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>


Operations

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:

  1. 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

  2. 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. 

  3. 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.

  4. Method Name : Name of the method present in remote interface and is mentioned along with the dataTypes.

  5. 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.

  6. 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:

  1. 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.

  2. Method Name : Name of the method present in remote interface and is mentioned along with the dataTypes.

  3. 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>



  • No labels