Contact Us 1-800-596-4880

EJB Transport Reference

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

The Enterprise Java Beans (EJB) transport allows EJB session beans to be invoked as part of an event flow. Components can be given an EJB outbound endpoint, which invokes the remote object and optionally returns a result.

Connector

The Mule EJB Connector provides connectivity for EJB beans.

Table 1. Attributes of <connector…​>
Name Description

pollingFrequency

Period (ms) between polling connections.

Type: long
Required: no

securityManager-ref

Bean reference to the security manager that should be used.

Type: name (no spaces)
Required: no

securityPolicy

The security policy (file name) used to enable connections.

Type: string
Required: no

serverClassName

The target class name.

Type: name (no spaces)
Required: no

serverCodebase

The target method.

Type: string
Required: no

No child elements for connector.

For example:

<ejb:connector name="ejb" jndiContext-ref="jndiContext" securityPolicy="rmi.policy" />

Using the EJB Transport

To use the EJB transport, you must define the EJB namespace and schema location at the top of the Mule configuration file. For example:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:spring="http://www.springframework.org/schema/beans"
   xmlns:ejb="http://www.mulesoft.org/schema/mule/ejb"
   xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
      http://www.mulesoft.org/schema/mule/ejb http://www.mulesoft.org/schema/mule/ejb/current/mule-ejb.xsd">
...

Note: In this code example, spring-beans-current.xsd is a placeholder. To locate the correct version, see http://www.springframework.org/schema/beans/.

EJB endpoints are configured the same way as RMI endpoints.

Note: Only outbound endpoints can use the EJB transport. For a given endpoint, you must provide the following information:

  • Registry host

  • Registry port

  • Remote home name

  • Remote method name

Use these values to establish the dispatcher connection, for example:

<ejb:endpoint host="localhost" port="1099" object="SomeService" method="remoteMethod"/>

Alternatively, you can use a URI-based configuration:

<outbound-endpoint address="ejb://localhost:1099/SomeService?method=remoteMethod"/>

If the method takes one or more input arguments, configure their types as a comma-separated list using the methodArgumentTypes attribute. Multiple arguments are passed in as an array of objects as the payload of the Mule message.

Transformers

No specific transformers are required for EJB.